IB/uverbs: Enable ioctl() uAPI by default for new verbs
authorMatan Barak <matanb@mellanox.com>
Mon, 19 Mar 2018 13:02:40 +0000 (15:02 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 19 Mar 2018 20:45:17 +0000 (14:45 -0600)
Enable the ioctl() uAPI for IB by default if the standard write()
uAPI (INFINIBAND_USER_ACCESS) is enabled. Verbs that are
also available under the old write() uAPI are put inside a new
INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI Kconfig.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/Kconfig
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/core/uverbs_std_types_cq.c

index 8517d6ea91a67554e04f491eaf881cf10e61c2f1..ee270e065ba999ea75360474751e72884d2de0bf 100644 (file)
@@ -35,14 +35,13 @@ config INFINIBAND_USER_ACCESS
          libibverbs, libibcm and a hardware driver library from
          rdma-core <https://github.com/linux-rdma/rdma-core>.
 
-config INFINIBAND_EXP_USER_ACCESS
-       bool "Enable the full uverbs ioctl interface (EXPERIMENTAL)"
+config INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI
+       bool "Allow experimental legacy verbs in new ioctl uAPI  (EXPERIMENTAL)"
        depends on INFINIBAND_USER_ACCESS
        ---help---
-         IOCTL based ABI support for Infiniband. This allows userspace
-         to invoke the experimental IOCTL based ABI.
-         These commands are parsed via per-device parsing tree and
-         enables per-device features.
+         IOCTL based uAPI support for Infiniband is enabled by default for
+         new verbs only. This allows userspace to invoke the IOCTL based uAPI
+         for current legacy verbs too.
 
 config INFINIBAND_USER_MEM
        bool
index fbba831f879e18bde76f1a1a8af830916fec3b34..4445d8ee93144c0b42cf00eb4e18943e6b4e2034 100644 (file)
@@ -933,10 +933,8 @@ static const struct file_operations uverbs_fops = {
        .open    = ib_uverbs_open,
        .release = ib_uverbs_close,
        .llseek  = no_llseek,
-#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
        .unlocked_ioctl = ib_uverbs_ioctl,
        .compat_ioctl = ib_uverbs_ioctl,
-#endif
 };
 
 static const struct file_operations uverbs_mmap_fops = {
@@ -946,10 +944,8 @@ static const struct file_operations uverbs_mmap_fops = {
        .open    = ib_uverbs_open,
        .release = ib_uverbs_close,
        .llseek  = no_llseek,
-#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
        .unlocked_ioctl = ib_uverbs_ioctl,
        .compat_ioctl = ib_uverbs_ioctl,
-#endif
 };
 
 static struct ib_client uverbs_client = {
index b061b4e15d8b990d55d84acc35a3809e85e00595..b0dbae9dd0d759f3b38e522053632c03921f3b43 100644 (file)
@@ -202,7 +202,9 @@ static DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_CQ_DESTROY,
 DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_CQ,
                            &UVERBS_TYPE_ALLOC_IDR_SZ(sizeof(struct ib_ucq_object), 0,
                                                      uverbs_free_cq),
+#if IS_ENABLED(CONFIG_INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI)
                            &UVERBS_METHOD(UVERBS_METHOD_CQ_CREATE),
                            &UVERBS_METHOD(UVERBS_METHOD_CQ_DESTROY)
+#endif
                           );