diff options
author | Matan Barak <matanb@mellanox.com> | 2017-08-03 09:07:07 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-31 08:35:14 -0400 |
commit | 8eb19e8e7c8658226d8b7e75728e6dfa2ef32717 (patch) | |
tree | e6415833591c157b335a60d3dc20e04312459d8a | |
parent | 524271129401ed896dc76e49acdbafc506cb41ac (diff) |
IB/core: Expose ioctl interface through experimental Kconfig
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>
-rw-r--r-- | drivers/infiniband/Kconfig | 9 | ||||
-rw-r--r-- | drivers/infiniband/core/uverbs.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index 234fe01904e7..3726205c8704 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
@@ -34,6 +34,15 @@ config INFINIBAND_USER_ACCESS | |||
34 | libibverbs, libibcm and a hardware driver library from | 34 | libibverbs, libibcm and a hardware driver library from |
35 | <http://www.openfabrics.org/git/>. | 35 | <http://www.openfabrics.org/git/>. |
36 | 36 | ||
37 | config INFINIBAND_EXP_USER_ACCESS | ||
38 | bool "Allow experimental support for Infiniband ABI" | ||
39 | depends on INFINIBAND_USER_ACCESS | ||
40 | ---help--- | ||
41 | IOCTL based ABI support for Infiniband. This allows userspace | ||
42 | to invoke the experimental IOCTL based ABI. | ||
43 | These commands are parsed via per-device parsing tree and | ||
44 | enables per-device features. | ||
45 | |||
37 | config INFINIBAND_USER_MEM | 46 | config INFINIBAND_USER_MEM |
38 | bool | 47 | bool |
39 | depends on INFINIBAND_USER_ACCESS != n | 48 | depends on INFINIBAND_USER_ACCESS != n |
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index 0f6f768f687e..37c8903e7fd0 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h | |||
@@ -219,6 +219,8 @@ int uverbs_dealloc_mw(struct ib_mw *mw); | |||
219 | void ib_uverbs_detach_umcast(struct ib_qp *qp, | 219 | void ib_uverbs_detach_umcast(struct ib_qp *qp, |
220 | struct ib_uqp_object *uobj); | 220 | struct ib_uqp_object *uobj); |
221 | 221 | ||
222 | long ib_uverbs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); | ||
223 | |||
222 | struct ib_uverbs_flow_spec { | 224 | struct ib_uverbs_flow_spec { |
223 | union { | 225 | union { |
224 | union { | 226 | union { |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 872fec910c16..dc2aed6fb21b 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -939,6 +939,9 @@ static const struct file_operations uverbs_fops = { | |||
939 | .open = ib_uverbs_open, | 939 | .open = ib_uverbs_open, |
940 | .release = ib_uverbs_close, | 940 | .release = ib_uverbs_close, |
941 | .llseek = no_llseek, | 941 | .llseek = no_llseek, |
942 | #if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS) | ||
943 | .unlocked_ioctl = ib_uverbs_ioctl, | ||
944 | #endif | ||
942 | }; | 945 | }; |
943 | 946 | ||
944 | static const struct file_operations uverbs_mmap_fops = { | 947 | static const struct file_operations uverbs_mmap_fops = { |
@@ -948,6 +951,9 @@ static const struct file_operations uverbs_mmap_fops = { | |||
948 | .open = ib_uverbs_open, | 951 | .open = ib_uverbs_open, |
949 | .release = ib_uverbs_close, | 952 | .release = ib_uverbs_close, |
950 | .llseek = no_llseek, | 953 | .llseek = no_llseek, |
954 | #if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS) | ||
955 | .unlocked_ioctl = ib_uverbs_ioctl, | ||
956 | #endif | ||
951 | }; | 957 | }; |
952 | 958 | ||
953 | static struct ib_client uverbs_client = { | 959 | static struct ib_client uverbs_client = { |