Skip to content

Commit 1037ebb

Browse files
shamoyadavem330
authored andcommitted
net/mlx4_en: Disbale GRO for incoming loopback/selftest packets
Packets which are sent from the selftest (ethtool) flow, should not be passed to GRO stack but rather dropped by the driver after validation. To achieve that, we disable GRO for the duration of the selftest. Fixes: dd65bea ("net/mlx4_en: Extend usage of napi_gro_frags") Reported-by: Carol Soto <[email protected]> Signed-off-by: Ido Shamay <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f5956fa commit 1037ebb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/mellanox/mlx4/en_selftest.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
8181
{
8282
u32 loopback_ok = 0;
8383
int i;
84-
84+
bool gro_enabled;
8585

8686
priv->loopback_ok = 0;
8787
priv->validate_loopback = 1;
88+
gro_enabled = priv->dev->features & NETIF_F_GRO;
8889

8990
mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
91+
priv->dev->features &= ~NETIF_F_GRO;
9092

9193
/* xmit */
9294
if (mlx4_en_test_loopback_xmit(priv)) {
@@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
108110
mlx4_en_test_loopback_exit:
109111

110112
priv->validate_loopback = 0;
113+
114+
if (gro_enabled)
115+
priv->dev->features |= NETIF_F_GRO;
116+
111117
mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
112118
return !loopback_ok;
113119
}

0 commit comments

Comments
 (0)