Skip to content

Commit b7bfcb4

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Set TSO max segs on devices with limits
Firmware will now advertise a non-zero TSO max segments if the device has a limit. 0 means no limit. The latest 5760X chip (early revs) has a limit of 2047 that cannot be exceeded. If exceeded, the chip will send out just a small number of segments. Call netif_set_tso_max_segs() if the device has a limit. Fixes: 2012a6a ("bnxt_en: Add 5760X (P7) PCI IDs") Reviewed-by: Ajit Khaparde <[email protected]> Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8ad0440 commit b7bfcb4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8996,6 +8996,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
89968996
memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN);
89978997
#endif
89988998
}
8999+
bp->tso_max_segs = le16_to_cpu(resp->max_tso_segs);
89999000

90009001
hwrm_func_qcaps_exit:
90019002
hwrm_req_drop(bp, req);
@@ -15363,6 +15364,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1536315364
dev->priv_flags |= IFF_UNICAST_FLT;
1536415365

1536515366
netif_set_tso_max_size(dev, GSO_MAX_SIZE);
15367+
if (bp->tso_max_segs)
15368+
netif_set_tso_max_segs(dev, bp->tso_max_segs);
1536615369

1536715370
dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
1536815371
NETDEV_XDP_ACT_RX_SG;

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@ struct bnxt {
23182318
u8 rss_hash_key_updated:1;
23192319

23202320
u16 max_mtu;
2321+
u16 tso_max_segs;
23212322
u8 max_tc;
23222323
u8 max_lltc; /* lossless TCs */
23232324
struct bnxt_queue_info q_info[BNXT_MAX_QUEUE];

0 commit comments

Comments
 (0)