summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMaor Gottlieb <maorg@mellanox.com>2020-07-06 14:27:16 +0200
committerJason Gunthorpe <jgg@nvidia.com>2020-07-07 00:32:23 +0200
commit6f3ca6f4f5e05b52bf6851ada21026faa106de76 (patch)
tree721ee536ae5d41958bd28bc876ac20a752307945 /include/rdma
parentRDMA/core: Clean ib_alloc_xrcd() and reuse it to allocate XRC domain (diff)
downloadlinux-6f3ca6f4f5e05b52bf6851ada21026faa106de76.tar.xz
linux-6f3ca6f4f5e05b52bf6851ada21026faa106de76.zip
RDMA/core: Optimize XRC target lookup
Replace the mutex with read write semaphore and use xarray instead of linked list for XRC target QPs. This will give faster XRC target lookup. In addition, when QP is closed, don't insert it back to the xarray if the destroy command failed. Link: https://lore.kernel.org/r/20200706122716.647338-4-leon@kernel.org Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index db6f78c5394f..20c801730fed 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1567,9 +1567,8 @@ struct ib_xrcd {
struct ib_device *device;
atomic_t usecnt; /* count all exposed resources */
struct inode *inode;
-
- struct mutex tgt_qp_mutex;
- struct list_head tgt_qp_list;
+ struct rw_semaphore tgt_qps_rwsem;
+ struct xarray tgt_qps;
};
struct ib_ah {