]> git.baikalelectronics.ru Git - kernel.git/commitdiff
IB/core: Expose ioctl interface through experimental Kconfig
authorMatan Barak <matanb@mellanox.com>
Thu, 3 Aug 2017 13:07:07 +0000 (16:07 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 31 Aug 2017 12:35:14 +0000 (08:35 -0400)
Add CONFIG_INFINIBAND_EXP_USER_ACCESS that enables the ioctl
interface. This interface is experimental and is subject to change.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/Kconfig
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_main.c

index 234fe01904e7356a274a2bcf84c2c8e43f999cdb..3726205c8704d846e0b2bbd927efd20ecae3c51f 100644 (file)
@@ -34,6 +34,15 @@ config INFINIBAND_USER_ACCESS
          libibverbs, libibcm and a hardware driver library from
          <http://www.openfabrics.org/git/>.
 
+config INFINIBAND_EXP_USER_ACCESS
+       bool "Allow experimental support for Infiniband ABI"
+       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.
+
 config INFINIBAND_USER_MEM
        bool
        depends on INFINIBAND_USER_ACCESS != n
index 0f6f768f687eebf56888f3df51de2e8e54f1af85..37c8903e7fd0c02442ac78f3a8b108a65dac2745 100644 (file)
@@ -219,6 +219,8 @@ int uverbs_dealloc_mw(struct ib_mw *mw);
 void ib_uverbs_detach_umcast(struct ib_qp *qp,
                             struct ib_uqp_object *uobj);
 
+long ib_uverbs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
+
 struct ib_uverbs_flow_spec {
        union {
                union {
index 872fec910c161942f0ec6a4c7bb6ad17d9393f2f..dc2aed6fb21b029944374430e91e6cf87ff959d8 100644 (file)
@@ -939,6 +939,9 @@ 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,
+#endif
 };
 
 static const struct file_operations uverbs_mmap_fops = {
@@ -948,6 +951,9 @@ 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,
+#endif
 };
 
 static struct ib_client uverbs_client = {