Skip to content

Commit 7afbddf

Browse files
ydroneaudrolandd
authored andcommitted
IB/core: Temporarily disable create_flow/destroy_flow uverbs
The create_flow/destroy_flow uverbs and the associated extensions to the user-kernel verbs ABI are under review and are too experimental to freeze at this point. So userspace is not exposed to experimental features and an uinstable ABI, temporarily disable this for v3.12 (with a Kconfig option behind staging to reenable it if desired). The feature will be enabled after proper cleanup for v3.13. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Link: http://marc.info/?i=cover.1381351016.git.ydroneaud@opteya.com Link: http://marc.info/?i=cover.1381177342.git.ydroneaud@opteya.com [ Add a Kconfig option to reenable these verbs. - Roland ] Signed-off-by: Roland Dreier <roland@purestorage.com>
1 parent 31d141e commit 7afbddf

6 files changed

Lines changed: 31 additions & 0 deletions

File tree

‎drivers/infiniband/Kconfig‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ config INFINIBAND_USER_ACCESS
3131
libibverbs, libibcm and a hardware driver library from
3232
<http://www.openfabrics.org/git/>.
3333

34+
config INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
35+
bool "Experimental and unstable ABI for userspace access to flow steering verbs"
36+
depends on INFINIBAND_USER_ACCESS
37+
depends on STAGING
38+
---help---
39+
The final ABI for userspace access to flow steering verbs
40+
has not been defined. To use the current ABI, *WHICH WILL
41+
CHANGE IN THE FUTURE*, say Y here.
42+
43+
If unsure, say N.
44+
3445
config INFINIBAND_USER_MEM
3546
bool
3647
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
@@ -217,7 +217,9 @@ IB_UVERBS_DECLARE_CMD(destroy_srq);
217217
IB_UVERBS_DECLARE_CMD(create_xsrq);
218218
IB_UVERBS_DECLARE_CMD(open_xrcd);
219219
IB_UVERBS_DECLARE_CMD(close_xrcd);
220+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
220221
IB_UVERBS_DECLARE_CMD(create_flow);
221222
IB_UVERBS_DECLARE_CMD(destroy_flow);
223+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
222224

223225
#endif /* UVERBS_H */

‎drivers/infiniband/core/uverbs_cmd.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ static struct uverbs_lock_class qp_lock_class = { .name = "QP-uobj" };
5454
static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" };
5555
static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" };
5656
static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" };
57+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
5758
static struct uverbs_lock_class rule_lock_class = { .name = "RULE-uobj" };
59+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
5860

5961
#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
6062
do { \
@@ -2599,6 +2601,7 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
25992601
return ret ? ret : in_len;
26002602
}
26012603

2604+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
26022605
static int kern_spec_to_ib_spec(struct ib_kern_spec *kern_spec,
26032606
union ib_flow_spec *ib_spec)
26042607
{
@@ -2824,6 +2827,7 @@ ssize_t ib_uverbs_destroy_flow(struct ib_uverbs_file *file,
28242827

28252828
return ret ? ret : in_len;
28262829
}
2830+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
28272831

28282832
static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
28292833
struct ib_uverbs_create_xsrq *cmd,

‎drivers/infiniband/core/uverbs_main.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file,
115115
[IB_USER_VERBS_CMD_CLOSE_XRCD] = ib_uverbs_close_xrcd,
116116
[IB_USER_VERBS_CMD_CREATE_XSRQ] = ib_uverbs_create_xsrq,
117117
[IB_USER_VERBS_CMD_OPEN_QP] = ib_uverbs_open_qp,
118+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
118119
[IB_USER_VERBS_CMD_CREATE_FLOW] = ib_uverbs_create_flow,
119120
[IB_USER_VERBS_CMD_DESTROY_FLOW] = ib_uverbs_destroy_flow
121+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
120122
};
121123

122124
static void ib_uverbs_add_one(struct ib_device *device);
@@ -605,6 +607,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
605607
if (!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command)))
606608
return -ENOSYS;
607609

610+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
608611
if (hdr.command >= IB_USER_VERBS_CMD_THRESHOLD) {
609612
struct ib_uverbs_cmd_hdr_ex hdr_ex;
610613

@@ -621,14 +624,17 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
621624
(hdr_ex.out_words +
622625
hdr_ex.provider_out_words) * 4);
623626
} else {
627+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
624628
if (hdr.in_words * 4 != count)
625629
return -EINVAL;
626630

627631
return uverbs_cmd_table[hdr.command](file,
628632
buf + sizeof(hdr),
629633
hdr.in_words * 4,
630634
hdr.out_words * 4);
635+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
631636
}
637+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
632638
}
633639

634640
static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma)

‎drivers/infiniband/hw/mlx4/main.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,9 +1691,11 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
16911691
ibdev->ib_dev.create_flow = mlx4_ib_create_flow;
16921692
ibdev->ib_dev.destroy_flow = mlx4_ib_destroy_flow;
16931693

1694+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
16941695
ibdev->ib_dev.uverbs_cmd_mask |=
16951696
(1ull << IB_USER_VERBS_CMD_CREATE_FLOW) |
16961697
(1ull << IB_USER_VERBS_CMD_DESTROY_FLOW);
1698+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
16971699
}
16981700

16991701
mlx4_ib_alloc_eqs(dev, ibdev);

‎include/uapi/rdma/ib_user_verbs.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ enum {
8787
IB_USER_VERBS_CMD_CLOSE_XRCD,
8888
IB_USER_VERBS_CMD_CREATE_XSRQ,
8989
IB_USER_VERBS_CMD_OPEN_QP,
90+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
9091
IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
9192
IB_USER_VERBS_CMD_DESTROY_FLOW
93+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
9294
};
9395

9496
/*
@@ -126,6 +128,7 @@ struct ib_uverbs_cmd_hdr {
126128
__u16 out_words;
127129
};
128130

131+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
129132
struct ib_uverbs_cmd_hdr_ex {
130133
__u32 command;
131134
__u16 in_words;
@@ -134,6 +137,7 @@ struct ib_uverbs_cmd_hdr_ex {
134137
__u16 provider_out_words;
135138
__u32 cmd_hdr_reserved;
136139
};
140+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
137141

138142
struct ib_uverbs_get_context {
139143
__u64 response;
@@ -696,6 +700,7 @@ struct ib_uverbs_detach_mcast {
696700
__u64 driver_data[0];
697701
};
698702

703+
#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
699704
struct ib_kern_eth_filter {
700705
__u8 dst_mac[6];
701706
__u8 src_mac[6];
@@ -780,6 +785,7 @@ struct ib_uverbs_destroy_flow {
780785
__u32 comp_mask;
781786
__u32 flow_handle;
782787
};
788+
#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
783789

784790
struct ib_uverbs_create_srq {
785791
__u64 response;

0 commit comments

Comments
 (0)