Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jack Wang and committed by
Doug Ledford
102c5ce0 93b1f29d

+3 -3
+3 -3
drivers/infiniband/core/cma.c
··· 2656 2656 static int cma_bind_loopback(struct rdma_id_private *id_priv) 2657 2657 { 2658 2658 struct cma_device *cma_dev, *cur_dev; 2659 - struct ib_port_attr port_attr; 2660 2659 union ib_gid gid; 2660 + enum ib_port_state port_state; 2661 2661 u16 pkey; 2662 2662 int ret; 2663 2663 u8 p; ··· 2673 2673 cma_dev = cur_dev; 2674 2674 2675 2675 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) { 2678 2678 cma_dev = cur_dev; 2679 2679 goto port_found; 2680 2680 }