diff options
author | Eli Cohen <eli@mellanox.com> | 2016-06-04 15:15:18 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-07 09:50:52 -0400 |
commit | d7012467a95b767b4d3beb2e027aa24a83f12f0f (patch) | |
tree | 1b21abb92c85ae3dcdfc9f14493548c76660f85b /drivers/infiniband/core | |
parent | 495fbae6e2c115099921ba33b1e1bea1190b5280 (diff) | |
download | op-kernel-dev-d7012467a95b767b4d3beb2e027aa24a83f12f0f.zip op-kernel-dev-d7012467a95b767b4d3beb2e027aa24a83f12f0f.tar.gz |
IB/core: Fix query port failure in RoCE
Currently ib_query_port always attempts to to read the subnet prefix by
calling ib_query_gid(). For RoCE/iWARP there is no subnet manager and no
subnet prefix. Fix this by querying GID[0] only for IB networks.
Fixes: fad61ad4e755 ('IB/core: Add subnet prefix to port info')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 8b8a8d9..5c155fa 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -661,6 +661,9 @@ int ib_query_port(struct ib_device *device, if (err || port_attr->subnet_prefix) return err; + if (rdma_port_get_link_layer(device, port_num) != IB_LINK_LAYER_INFINIBAND) + return 0; + err = ib_query_gid(device, port_num, 0, &gid, NULL); if (err) return err; |