Skip to content

Commit b6488b1

Browse files
xli98kuba-moo
authored andcommitted
bnxt: Use generic HBH removal helper in tx path
Eric Dumazet implemented Big TCP that allowed bigger TSO/GRO packet sizes for IPv6 traffic. See patch series: 'commit 89527be ("net: add IFLA_TSO_{MAX_SIZE|SEGS} attributes")' This reduces the number of packets traversing the networking stack and should usually improves performance. However, it also inserts a temporary Hop-by-hop IPv6 extension header. Using the HBH header removal method in the previous patch, the extra header be removed in bnxt drivers to allow it to send big TCP packets (bigger TSO packets) as well. Tested: Compiled locally To further test functional correctness, update the GSO/GRO limit on the physical NIC: ip link set eth0 gso_max_size 181000 ip link set eth0 gro_max_size 181000 Note that if there are bonding or ipvan devices on top of the physical NIC, their GSO sizes need to be updated as well. Then, IPv6/TCP packets with sizes larger than 64k can be observed. Signed-off-by: Coco Li <[email protected]> Reviewed-by: Michael Chan <[email protected]> Tested-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8930046 commit b6488b1

File tree

1 file changed

+25
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+25
-1
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
389389
return NETDEV_TX_BUSY;
390390
}
391391

392+
if (unlikely(ipv6_hopopt_jumbo_remove(skb)))
393+
goto tx_free;
394+
392395
length = skb->len;
393396
len = skb_headlen(skb);
394397
last_frag = skb_shinfo(skb)->nr_frags;
@@ -11315,6 +11318,7 @@ static bool bnxt_exthdr_check(struct bnxt *bp, struct sk_buff *skb, int nw_off,
1131511318
u8 **nextp)
1131611319
{
1131711320
struct ipv6hdr *ip6h = (struct ipv6hdr *)(skb->data + nw_off);
11321+
struct hop_jumbo_hdr *jhdr;
1131811322
int hdr_count = 0;
1131911323
u8 *nexthdr;
1132011324
int start;
@@ -11342,9 +11346,27 @@ static bool bnxt_exthdr_check(struct bnxt *bp, struct sk_buff *skb, int nw_off,
1134211346

1134311347
if (hdrlen > 64)
1134411348
return false;
11349+
11350+
/* The ext header may be a hop-by-hop header inserted for
11351+
* big TCP purposes. This will be removed before sending
11352+
* from NIC, so do not count it.
11353+
*/
11354+
if (*nexthdr == NEXTHDR_HOP) {
11355+
if (likely(skb->len <= GRO_LEGACY_MAX_SIZE))
11356+
goto increment_hdr;
11357+
11358+
jhdr = (struct hop_jumbo_hdr *)hp;
11359+
if (jhdr->tlv_type != IPV6_TLV_JUMBO || jhdr->hdrlen != 0 ||
11360+
jhdr->nexthdr != IPPROTO_TCP)
11361+
goto increment_hdr;
11362+
11363+
goto next_hdr;
11364+
}
11365+
increment_hdr:
11366+
hdr_count++;
11367+
next_hdr:
1134511368
nexthdr = &hp->nexthdr;
1134611369
start += hdrlen;
11347-
hdr_count++;
1134811370
}
1134911371
if (nextp) {
1135011372
/* Caller will check inner protocol */
@@ -13657,6 +13679,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1365713679
dev->features &= ~NETIF_F_LRO;
1365813680
dev->priv_flags |= IFF_UNICAST_FLT;
1365913681

13682+
netif_set_tso_max_size(dev, GSO_MAX_SIZE);
13683+
1366013684
#ifdef CONFIG_BNXT_SRIOV
1366113685
init_waitqueue_head(&bp->sriov_cfg_wait);
1366213686
#endif

0 commit comments

Comments
 (0)