]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/core: Move ucaps into ib_uverbs_support.ko
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 26 May 2026 01:22:41 +0000 (22:22 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 26 May 2026 13:11:43 +0000 (10:11 -0300)
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>
drivers/infiniband/core/Makefile
drivers/infiniband/core/ucaps.c
drivers/infiniband/core/uverbs_main.c
include/rdma/ib_ucaps.h

index e2ff9c2be9d3774d336fcc102ea17351d69d441c..47f645cb76f69eb075749d4bc6f4f4f246398596 100644 (file)
@@ -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
index 948093260dbda1869079a7fb0056c749235f7d71..c5721d3b0d33c038a6a904cb43d7454e170ffbb3 100644 (file)
@@ -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);
index ab6f1e3cb47a184aec6fde6f9f257b623ccf0af2..3ccf58e96aedebb6f8886ef5b8fad5660475c4c7 100644 (file)
@@ -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();
 }
 
index d9f96be3a553f8f7b330e43090b08839864ac524..b629c99117d8fe136290c1e6671be5c896da2564 100644 (file)
@@ -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);