bnxt_en: Add support for UDP GSO on 5760X chips
The new 5760X chips supports UDP GSO. Tested using udpgso_bench_tx. Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://lore.kernel.org/r/20231212005122.2401-12-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6ce3062254
commit
feeef68f6f
@ -587,12 +587,21 @@ normal_tx:
|
||||
|
||||
txbd1->tx_bd_hsize_lflags = lflags;
|
||||
if (skb_is_gso(skb)) {
|
||||
bool udp_gso = !!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4);
|
||||
u32 hdr_len;
|
||||
|
||||
if (skb->encapsulation)
|
||||
hdr_len = skb_inner_tcp_all_headers(skb);
|
||||
else
|
||||
if (skb->encapsulation) {
|
||||
if (udp_gso)
|
||||
hdr_len = skb_inner_transport_offset(skb) +
|
||||
sizeof(struct udphdr);
|
||||
else
|
||||
hdr_len = skb_inner_tcp_all_headers(skb);
|
||||
} else if (udp_gso) {
|
||||
hdr_len = skb_transport_offset(skb) +
|
||||
sizeof(struct udphdr);
|
||||
} else {
|
||||
hdr_len = skb_tcp_all_headers(skb);
|
||||
}
|
||||
|
||||
txbd1->tx_bd_hsize_lflags |= cpu_to_le32(TX_BD_FLAGS_LSO |
|
||||
TX_BD_FLAGS_T_IPID |
|
||||
@ -8345,6 +8354,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||
flags_ext2 = le32_to_cpu(resp->flags_ext2);
|
||||
if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)
|
||||
bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;
|
||||
if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_UDP_GSO_SUPPORTED)
|
||||
bp->flags |= BNXT_FLAG_UDP_GSO_CAP;
|
||||
|
||||
bp->tx_push_thresh = 0;
|
||||
if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED) &&
|
||||
@ -14351,6 +14362,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM |
|
||||
NETIF_F_GSO_PARTIAL | NETIF_F_RXHASH |
|
||||
NETIF_F_RXCSUM | NETIF_F_GRO;
|
||||
if (bp->flags & BNXT_FLAG_UDP_GSO_CAP)
|
||||
dev->hw_features |= NETIF_F_GSO_UDP_L4;
|
||||
|
||||
if (BNXT_SUPPORTS_TPA(bp))
|
||||
dev->hw_features |= NETIF_F_LRO;
|
||||
@ -14361,6 +14374,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_GRE |
|
||||
NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM |
|
||||
NETIF_F_GSO_IPXIP4 | NETIF_F_GSO_PARTIAL;
|
||||
if (bp->flags & BNXT_FLAG_UDP_GSO_CAP)
|
||||
dev->hw_enc_features |= NETIF_F_GSO_UDP_L4;
|
||||
if (bp->flags & BNXT_FLAG_CHIP_P7)
|
||||
dev->udp_tunnel_nic_info = &bnxt_udp_tunnels_p7;
|
||||
else
|
||||
|
@ -2044,6 +2044,7 @@ struct bnxt {
|
||||
#define BNXT_FLAG_MULTI_HOST 0x100000
|
||||
#define BNXT_FLAG_DSN_VALID 0x200000
|
||||
#define BNXT_FLAG_DOUBLE_DB 0x400000
|
||||
#define BNXT_FLAG_UDP_GSO_CAP 0x800000
|
||||
#define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
|
||||
#define BNXT_FLAG_DIM 0x2000000
|
||||
#define BNXT_FLAG_ROCE_MIRROR_CAP 0x4000000
|
||||
|
Loading…
Reference in New Issue
Block a user