Skip to content

Commit 8914a59

Browse files
daxtensdavem330
authored andcommitted
bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than ~9700 bytes, it will cause a firmware error that will bring the card down: bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert! bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT_LIST_INDEX 0x2 bnx2x: [bnx2x_mc_assert:736(enP24p1s0f0)]XSTORM_ASSERT_INDEX 0x0 = 0x00000000 0x25e43e47 0x00463e01 0x00010052 bnx2x: [bnx2x_mc_assert:750(enP24p1s0f0)]Chip Revision: everest3, FW Version: 7_13_1 ... (dump of values continues) ... Detect when the mac length of a GSO packet is greater than the maximum packet size (9700 bytes) and disable GSO. Signed-off-by: Daniel Axtens <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2b16f04 commit 8914a59

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12934,6 +12934,24 @@ static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
1293412934
struct net_device *dev,
1293512935
netdev_features_t features)
1293612936
{
12937+
/*
12938+
* A skb with gso_size + header length > 9700 will cause a
12939+
* firmware panic. Drop GSO support.
12940+
*
12941+
* Eventually the upper layer should not pass these packets down.
12942+
*
12943+
* For speed, if the gso_size is <= 9000, assume there will
12944+
* not be 700 bytes of headers and pass it through. Only do a
12945+
* full (slow) validation if the gso_size is > 9000.
12946+
*
12947+
* (Due to the way SKB_BY_FRAGS works this will also do a full
12948+
* validation in that case.)
12949+
*/
12950+
if (unlikely(skb_is_gso(skb) &&
12951+
(skb_shinfo(skb)->gso_size > 9000) &&
12952+
!skb_gso_validate_mac_len(skb, 9700)))
12953+
features &= ~NETIF_F_GSO_MASK;
12954+
1293712955
features = vlan_features_check(skb, features);
1293812956
return vxlan_features_check(skb, features);
1293912957
}

0 commit comments

Comments
 (0)