Add support for reporting physical state when calling query_port() via the sysfs interface. Signed-off-by: Kamal Heib <kamalheib1@xxxxxxxxx> --- drivers/infiniband/hw/cxgb3/iwch_provider.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index e775c1a1a450..7b0b7bfc570a 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -1004,18 +1004,24 @@ static int iwch_query_port(struct ib_device *ibdev, props->max_mtu = IB_MTU_4096; props->active_mtu = ib_mtu_int_to_enum(netdev->mtu); - if (!netif_carrier_ok(netdev)) + if (!netif_carrier_ok(netdev)) { props->state = IB_PORT_DOWN; - else { + props->phys_state = 3; + } else { inetdev = in_dev_get(netdev); if (inetdev) { - if (inetdev->ifa_list) + if (inetdev->ifa_list) { props->state = IB_PORT_ACTIVE; - else + props->phys_state = 5; + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } in_dev_put(inetdev); - } else + } else { props->state = IB_PORT_INIT; + props->phys_state = 4; + } } props->port_cap_flags = -- 2.20.1