summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2026-05-25 22:22:41 -0300
committerJason Gunthorpe <jgg@nvidia.com>2026-05-26 10:11:43 -0300
commit1a76adc9b38c678a176edc04db6dd057bcb2298c (patch)
tree3905fd7f6fdeecb4bbaa274b1d14b2f39af12649
parent2274d8cb4912ab32bcff80d6c7cbae453614ae08 (diff)
downloadlinux-stable-1a76adc9b38c678a176edc04db6dd057bcb2298c.tar.gz
linux-stable-1a76adc9b38c678a176edc04db6dd057bcb2298c.zip
RDMA/core: Move ucaps into ib_uverbs_support.ko
mlx5 uses these move them into the support module from ib_uverbs.ko. Link: https://patch.msgid.link/r/5-v3-43aba1969751+1988-ib_uverbs_support_ko_jgg@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r--drivers/infiniband/core/Makefile6
-rw-r--r--drivers/infiniband/core/ucaps.c10
-rw-r--r--drivers/infiniband/core/uverbs_main.c1
-rw-r--r--include/rdma/ib_ucaps.h1
4 files changed, 7 insertions, 11 deletions
diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile
index e2ff9c2be9d3..47f645cb76f6 100644
--- a/drivers/infiniband/core/Makefile
+++ b/drivers/infiniband/core/Makefile
@@ -46,7 +46,7 @@ ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_marshall.o \
uverbs_std_types_async_fd.o \
uverbs_std_types_srq.o \
uverbs_std_types_wq.o \
- uverbs_std_types_qp.o \
- ucaps.o
+ uverbs_std_types_qp.o
-ib_uverbs_support-y := rdma_core.o
+ib_uverbs_support-y := rdma_core.o \
+ ucaps.o
diff --git a/drivers/infiniband/core/ucaps.c b/drivers/infiniband/core/ucaps.c
index 948093260dbd..c5721d3b0d33 100644
--- a/drivers/infiniband/core/ucaps.c
+++ b/drivers/infiniband/core/ucaps.c
@@ -46,12 +46,7 @@ static const struct file_operations ucaps_cdev_fops = {
.open = simple_open,
};
-/**
- * ib_cleanup_ucaps - cleanup all API resources and class.
- *
- * This is called once, when removing the ib_uverbs module.
- */
-void ib_cleanup_ucaps(void)
+static __exit void ib_cleanup_ucaps(void)
{
mutex_lock(&ucaps_mutex);
if (!ucaps_class_is_registered) {
@@ -265,3 +260,6 @@ end:
mutex_unlock(&ucaps_mutex);
return ret;
}
+EXPORT_SYMBOL_NS_GPL(ib_get_ucaps, "rdma_core");
+
+module_exit(ib_cleanup_ucaps);
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index ab6f1e3cb47a..3ccf58e96aed 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -1350,7 +1350,6 @@ static void __exit ib_uverbs_cleanup(void)
IB_UVERBS_NUM_FIXED_MINOR);
unregister_chrdev_region(dynamic_uverbs_dev,
IB_UVERBS_NUM_DYNAMIC_MINOR);
- ib_cleanup_ucaps();
mmu_notifier_synchronize();
}
diff --git a/include/rdma/ib_ucaps.h b/include/rdma/ib_ucaps.h
index d9f96be3a553..b629c99117d8 100644
--- a/include/rdma/ib_ucaps.h
+++ b/include/rdma/ib_ucaps.h
@@ -14,7 +14,6 @@ enum rdma_user_cap {
RDMA_UCAP_MAX
};
-void ib_cleanup_ucaps(void);
int ib_get_ucaps(int *fds, int fd_count, uint64_t *idx_mask);
#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
int ib_create_ucap(enum rdma_user_cap type);