IB/mlx4: Fix IBoE link state
authorEli Cohen <eli@dev.mellanox.co.il>
Thu, 11 Nov 2010 21:05:58 +0000 (21:05 +0000)
committerRoland Dreier <rolandd@cisco.com>
Thu, 2 Dec 2010 00:11:29 +0000 (16:11 -0800)
Use netif_running() and netif_carrier_ok() to report link state,
exactly as is done to report Ethernet link state in sysfs.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/main.c

index e165dd36e908d848a0044992164ddfff0411847c..30e09caf0da95af71ce17e4017eaefb13db6cb7d 100644 (file)
@@ -242,7 +242,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
        tmp = iboe_get_mtu(ndev->mtu);
        props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256;
 
-       props->state            = netif_running(ndev) &&  netif_oper_up(ndev) ?
+       props->state            = (netif_running(ndev) && netif_carrier_ok(ndev)) ?
                                        IB_PORT_ACTIVE : IB_PORT_DOWN;
        props->phys_state       = state_to_phys_state(props->state);