Skip to content

Commit 8eb19e8

Browse files
matanb10dledford
authored andcommitted
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>
1 parent 5242711 commit 8eb19e8

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎drivers/infiniband/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ config INFINIBAND_USER_ACCESS
3434
libibverbs, libibcm and a hardware driver library from
3535
<http://www.openfabrics.org/git/>.
3636

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+
3746
config INFINIBAND_USER_MEM
3847
bool
3948
depends on INFINIBAND_USER_ACCESS != n

‎drivers/infiniband/core/uverbs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ int uverbs_dealloc_mw(struct ib_mw *mw);
219219
void ib_uverbs_detach_umcast(struct ib_qp *qp,
220220
struct ib_uqp_object *uobj);
221221

222+
long ib_uverbs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
223+
222224
struct ib_uverbs_flow_spec {
223225
union {
224226
union {

‎drivers/infiniband/core/uverbs_main.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,9 @@ static const struct file_operations uverbs_fops = {
939939
.open = ib_uverbs_open,
940940
.release = ib_uverbs_close,
941941
.llseek = no_llseek,
942+
#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
943+
.unlocked_ioctl = ib_uverbs_ioctl,
944+
#endif
942945
};
943946

944947
static const struct file_operations uverbs_mmap_fops = {
@@ -948,6 +951,9 @@ static const struct file_operations uverbs_mmap_fops = {
948951
.open = ib_uverbs_open,
949952
.release = ib_uverbs_close,
950953
.llseek = no_llseek,
954+
#if IS_ENABLED(CONFIG_INFINIBAND_EXP_USER_ACCESS)
955+
.unlocked_ioctl = ib_uverbs_ioctl,
956+
#endif
951957
};
952958

953959
static struct ib_client uverbs_client = {

0 commit comments

Comments
 (0)