Skip to content

Commit 8d09e6b

Browse files
Hariprasad Shenaidavem330
authored andcommitted
cxgb4/cxgb4vf: Fixes regression in perf when tx vlan offload is disabled
The commit 637d3e9 ("cxgb4: Discard the packet if the length is greater than mtu") introduced a regression in the VLAN interface performance when Tx VLAN offload is disabled. Check if skb is tagged, regardless of whether it is hardware accelerated or not. Presently we were checking only for hardware acclereated one, which caused performance to drop to ~0.17Mbps on a 10GbE adapter for VLAN interface, when tx vlan offload is turned off using ethtool. The ethernet head length calculation was going wrong in this case, and driver ended up dropping packets. Fixes: 637d3e9 ("cxgb4: Discard the packet if the length is greater than mtu") Signed-off-by: Hariprasad Shenai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b2df430 commit 8d09e6b

File tree

2 files changed

+2
-2
lines changed
  • drivers/net/ethernet/chelsio

2 files changed

+2
-2
lines changed

drivers/net/ethernet/chelsio/cxgb4/sge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ out_free: dev_kfree_skb_any(skb);
11921192

11931193
/* Discard the packet if the length is greater than mtu */
11941194
max_pkt_len = ETH_HLEN + dev->mtu;
1195-
if (skb_vlan_tag_present(skb))
1195+
if (skb_vlan_tagged(skb))
11961196
max_pkt_len += VLAN_HLEN;
11971197
if (!skb_shinfo(skb)->gso_size && (unlikely(skb->len > max_pkt_len)))
11981198
goto out_free;

drivers/net/ethernet/chelsio/cxgb4vf/sge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
11881188

11891189
/* Discard the packet if the length is greater than mtu */
11901190
max_pkt_len = ETH_HLEN + dev->mtu;
1191-
if (skb_vlan_tag_present(skb))
1191+
if (skb_vlan_tagged(skb))
11921192
max_pkt_len += VLAN_HLEN;
11931193
if (!skb_shinfo(skb)->gso_size && (unlikely(skb->len > max_pkt_len)))
11941194
goto out_free;

0 commit comments

Comments
 (0)