summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@profitbricks.com>2017-01-02 13:22:05 +0100
committerDoug Ledford <dledford@redhat.com>2017-01-12 23:00:04 -0500
commit102c5ce082f557405a0f71ad5a8920f9df50cd9e (patch)
tree8e751c555edf74253255f51f41e0975c4e08a8a1
parent93b1f29de71f3bd3b88ec8a2c2874c3847cd38bc (diff)
downloadop-kernel-dev-102c5ce082f557405a0f71ad5a8920f9df50cd9e.zip
op-kernel-dev-102c5ce082f557405a0f71ad5a8920f9df50cd9e.tar.gz
RDMA/cma: use cached port state when bind loopback
Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com> Reviewed-by: Michael Wang <yun.wang@profitbricks.com> Acked-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/cma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 40e2b72..a14a18c 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2656,8 +2656,8 @@ static void cma_set_loopback(struct sockaddr *addr)
static int cma_bind_loopback(struct rdma_id_private *id_priv)
{
struct cma_device *cma_dev, *cur_dev;
- struct ib_port_attr port_attr;
union ib_gid gid;
+ enum ib_port_state port_state;
u16 pkey;
int ret;
u8 p;
@@ -2673,8 +2673,8 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
cma_dev = cur_dev;
for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
- if (!ib_query_port(cur_dev->device, p, &port_attr) &&
- port_attr.state == IB_PORT_ACTIVE) {
+ if (!ib_get_cached_port_state(cur_dev->device, p, &port_state) &&
+ port_state == IB_PORT_ACTIVE) {
cma_dev = cur_dev;
goto port_found;
}
OpenPOWER on IntegriCloud