summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorChengchang Tang <tangchengchang@huawei.com>2024-09-27 18:33:22 +0800
committerLeon Romanovsky <leon@kernel.org>2024-10-07 08:53:23 +0300
commit51976c6cd786151b6a1bdf8b8b3334beac0ba99c (patch)
tree9c4a089bc2931c9000884566f41f81c5f347c855 /include/rdma
parent8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff)
downloadlinux-51976c6cd786151b6a1bdf8b8b3334beac0ba99c.tar.gz
linux-51976c6cd786151b6a1bdf8b8b3334beac0ba99c.tar.bz2
linux-51976c6cd786151b6a1bdf8b8b3334beac0ba99c.zip
RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap pages
Provide a new api rdma_user_mmap_disassociate() for drivers to disassociate mmap pages for a device. Since drivers can now disassociate mmaps by calling this api, introduce a new disassociation_lock to specifically prevent races between this disassociation process and new mmaps. And thus the old hw_destroy_rwsem is not needed in this api. Signed-off-by: Chengchang Tang <tangchengchang@huawei.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Link: https://patch.msgid.link/20240927103323.1897094-2-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index aa8ede439905..9cb8b5fe7eee 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2948,6 +2948,14 @@ int rdma_user_mmap_entry_insert_range(struct ib_ucontext *ucontext,
size_t length, u32 min_pgoff,
u32 max_pgoff);
+#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
+void rdma_user_mmap_disassociate(struct ib_device *device);
+#else
+static inline void rdma_user_mmap_disassociate(struct ib_device *device)
+{
+}
+#endif
+
static inline int
rdma_user_mmap_entry_insert_exact(struct ib_ucontext *ucontext,
struct rdma_user_mmap_entry *entry,