net/mlx4_en: Fix selftest failing on non 10G link speed
authorAmir Vadai <amirv@mellanox.com>
Sun, 2 Mar 2014 08:25:02 +0000 (10:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Mar 2014 01:04:01 +0000 (20:04 -0500)
Connect-X devices selftest speed test shouldn't fail on 1G and 40G link
speeds.

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 c11d063473e5f9aaa162aacd32b4cac386d53464..03e5f6ac67e7660dbc68c6fe69e5123247588bf0 100644 (file)
@@ -129,8 +129,10 @@ static int mlx4_en_test_speed(struct mlx4_en_priv *priv)
        if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
                return -ENOMEM;
 
-       /* The device currently only supports 10G speed */
-       if (priv->port_state.link_speed != SPEED_10000)
+       /* The device supports 1G, 10G and 40G speeds */
+       if (priv->port_state.link_speed != 1000 &&
+           priv->port_state.link_speed != 10000 &&
+           priv->port_state.link_speed != 40000)
                return priv->port_state.link_speed;
        return 0;
 }