Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matan Barak and committed by
Doug Ledford
8eb19e8e 52427112

+17
+9
drivers/infiniband/Kconfig
··· 34 34 libibverbs, libibcm and a hardware driver library from 35 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 46 config INFINIBAND_USER_MEM 38 47 bool 39 48 depends on INFINIBAND_USER_ACCESS != n
+2
drivers/infiniband/core/uverbs.h
··· 219 219 void ib_uverbs_detach_umcast(struct ib_qp *qp, 220 220 struct ib_uqp_object *uobj); 221 221 222 + long ib_uverbs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 223 + 222 224 struct ib_uverbs_flow_spec { 223 225 union { 224 226 union {
+6
drivers/infiniband/core/uverbs_main.c
··· 939 939 .open = ib_uverbs_open, 940 940 .release = ib_uverbs_close, 941 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 947 static const struct file_operations uverbs_mmap_fops = { ··· 951 948 .open = ib_uverbs_open, 952 949 .release = ib_uverbs_close, 953 950 .llseek = no_llseek, 951 + #if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS) 952 + .unlocked_ioctl = ib_uverbs_ioctl, 953 + #endif 954 954 }; 955 955 956 956 static struct ib_client uverbs_client = {