net/mlx4_en: Run loopback test only when port is up
authorEugenia Emantayev <eugenia@mellanox.com>
Tue, 8 Jul 2014 08:25:20 +0000 (11:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jul 2014 02:58:44 +0000 (19:58 -0700)
Loopback can't work when port is down.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_selftest.c

index 03e5f6ac67e7660dbc68c6fe69e5123247588bf0..49d5afc7cfb84cfcd413b73d6e7ff9b938802256 100644 (file)
@@ -159,7 +159,8 @@ 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);
-                       buf[4] = mlx4_en_test_loopback(priv);
+                       if (priv->port_up)
+                               buf[4] = mlx4_en_test_loopback(priv);
                }
 
                if (carrier_ok)