提交 1037ebbb 编写于 作者: I Ido Shamay 提交者: David S. Miller

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: dd65beac ("net/mlx4_en: Extend usage of napi_gro_frags")
Reported-by: NCarol Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: NIdo Shamay <idos@mellanox.com>
Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f5956faf
......@@ -81,12 +81,14 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
{
u32 loopback_ok = 0;
int i;
bool gro_enabled;
priv->loopback_ok = 0;
priv->validate_loopback = 1;
gro_enabled = priv->dev->features & NETIF_F_GRO;
mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
priv->dev->features &= ~NETIF_F_GRO;
/* xmit */
if (mlx4_en_test_loopback_xmit(priv)) {
......@@ -108,6 +110,10 @@ static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
mlx4_en_test_loopback_exit:
priv->validate_loopback = 0;
if (gro_enabled)
priv->dev->features |= NETIF_F_GRO;
mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
return !loopback_ok;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册