From: Jason Gunthorpe Date: Tue, 26 May 2026 01:22:41 +0000 (-0300) Subject: RDMA/core: Move ucaps into ib_uverbs_support.ko X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a76adc9b38c678a176edc04db6dd057bcb2298c;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile index e2ff9c2be9d37..47f645cb76f69 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 948093260dbda..c5721d3b0d33c 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 ab6f1e3cb47a1..3ccf58e96aede 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 d9f96be3a553f..b629c99117d8f 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);