Skip to content

Commit 102c5ce

Browse files
Jack Wangdledford
authored andcommitted
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>
1 parent 93b1f29 commit 102c5ce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • drivers/infiniband/core

‎drivers/infiniband/core/cma.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,8 +2656,8 @@ static void cma_set_loopback(struct sockaddr *addr)
26562656
static int cma_bind_loopback(struct rdma_id_private *id_priv)
26572657
{
26582658
struct cma_device *cma_dev, *cur_dev;
2659-
struct ib_port_attr port_attr;
26602659
union ib_gid gid;
2660+
enum ib_port_state port_state;
26612661
u16 pkey;
26622662
int ret;
26632663
u8 p;
@@ -2673,8 +2673,8 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
26732673
cma_dev = cur_dev;
26742674

26752675
for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) {
2676-
if (!ib_query_port(cur_dev->device, p, &port_attr) &&
2677-
port_attr.state == IB_PORT_ACTIVE) {
2676+
if (!ib_get_cached_port_state(cur_dev->device, p, &port_state) &&
2677+
port_state == IB_PORT_ACTIVE) {
26782678
cma_dev = cur_dev;
26792679
goto port_found;
26802680
}

0 commit comments

Comments
 (0)