aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/sa_query.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-03-21 17:16:35 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-03-23 10:58:05 -0600
commit114cc9c4b18232452f7dcc8bb3e5749f8d9a6837 (patch)
tree51d182911abb1814a0ba2644affef379ec30ed27 /drivers/infiniband/core/sa_query.c
parentIB/core: Refer to RoCE port property instead of GID table property (diff)
downloadlinux-dev-114cc9c4b18232452f7dcc8bb3e5749f8d9a6837.tar.xz
linux-dev-114cc9c4b18232452f7dcc8bb3e5749f8d9a6837.zip
IB/cma: Resolve route only while receiving CM requests
Currently CM request for RoCE follows following flow. rdma_create_id() rdma_resolve_addr() rdma_resolve_route() For RC QPs: rdma_connect() ->cma_connect_ib() ->ib_send_cm_req() ->cm_init_av_by_path() ->ib_init_ah_attr_from_path() For UD QPs: rdma_connect() ->cma_resolve_ib_udp() ->ib_send_cm_sidr_req() ->cm_init_av_by_path() ->ib_init_ah_attr_from_path() In both the flows, route is already resolved before sending CM requests. Therefore, code is refactored to avoid resolving route second time in ib_cm layer. ib_init_ah_attr_from_path() is extended to resolve route when it is not yet resolved for RoCE link layer. This is achieved by caller setting route_resolved field in path record whenever it has route already resolved. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/sa_query.c')
-rw-r--r--drivers/infiniband/core/sa_query.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 1cfec68c7911..a61ec7e33613 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -1248,6 +1248,9 @@ roce_resolve_route_from_path(struct ib_device *device, u8 port_num,
} sgid_addr, dgid_addr;
int ret;
+ if (rec->roce.route_resolved)
+ return 0;
+
if (!device->get_netdev)
return -EOPNOTSUPP;
@@ -1287,6 +1290,8 @@ roce_resolve_route_from_path(struct ib_device *device, u8 port_num,
dev_put(ndev);
done:
dev_put(idev);
+ if (!ret)
+ rec->roce.route_resolved = true;
return ret;
}