Make use of netif_running() and netif_carrier_ok() to report link state, in the
same manner it is done to report Ethernet link state in sysfs.

Signed-off-by: Eli Cohen <e...@mellanox.co.il>
---
I find this version even more correct than the previous one. This
exactly the same logic used to show the carrier in sysfs.

 drivers/infiniband/hw/mlx4/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c 
b/drivers/infiniband/hw/mlx4/main.c
index 018007c..f200b96 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -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);
 
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to