summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.com>2017-12-13 19:12:09 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-14 00:38:36 +0300
commit78034f5fdd622520eb843301cf35ce6c626543a7 (patch)
treeca1fc1615aa51719a504c392267f8996d81cde1f /drivers/net/ethernet/mellanox/mlx4/en_selftest.c
parentde9c4e06bbe872d725f306e34f3eea21155488e2 (diff)
downloadlinux-78034f5fdd622520eb843301cf35ce6c626543a7.tar.xz
net/mlx4_en: Fix selftest for small MTUs
Set the minimal MTU threshold for running loopback selftest. MTU should be big enough to include packet payload, NET_IP_ALIGN, Ethernet headers and preamble length. Fixes: e7c1c2c46201 ("mlx4_en: Added self diagnostics test implementation") Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_selftest.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_selftest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
index 88699b181946..946d9db7c8c2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
@@ -185,7 +185,7 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf)
if (priv->mdev->dev->caps.flags &
MLX4_DEV_CAP_FLAG_UC_LOOPBACK) {
buf[3] = mlx4_en_test_registers(priv);
- if (priv->port_up)
+ if (priv->port_up && dev->mtu >= MLX4_SELFTEST_LB_MIN_MTU)
buf[4] = mlx4_en_test_loopback(priv);
}