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

IB/core: Re-enable create_flow/destroy_flow uverbs

This commit reverts commit 7afbddfae993 ("IB/core: Temporarily disable
create_flow/destroy_flow uverbs"). Since the uverbs extensions
functionality was experimental for v3.12, this patch re-enables the
support for them and flow-steering for v3.13.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

authored by

Matan Barak and committed by
Roland Dreier
69ad5da4 f21519b2

-32
-11
drivers/infiniband/Kconfig
··· 31 31 libibverbs, libibcm and a hardware driver library from 32 32 <http://www.openfabrics.org/git/>. 33 33 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 - 45 34 config INFINIBAND_USER_MEM 46 35 bool 47 36 depends on INFINIBAND_USER_ACCESS != n
-4
drivers/infiniband/core/uverbs.h
··· 242 242 IB_UVERBS_DECLARE_CMD(open_xrcd); 243 243 IB_UVERBS_DECLARE_CMD(close_xrcd); 244 244 245 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 246 - 247 245 #define IB_UVERBS_DECLARE_EX_CMD(name) \ 248 246 int ib_uverbs_ex_##name(struct ib_uverbs_file *file, \ 249 247 struct ib_udata *ucore, \ ··· 249 251 250 252 IB_UVERBS_DECLARE_EX_CMD(create_flow); 251 253 IB_UVERBS_DECLARE_EX_CMD(destroy_flow); 252 - 253 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 254 254 255 255 #endif /* UVERBS_H */
-4
drivers/infiniband/core/uverbs_cmd.c
··· 54 54 static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" }; 55 55 static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" }; 56 56 static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" }; 57 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 58 57 static struct uverbs_lock_class rule_lock_class = { .name = "RULE-uobj" }; 59 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 60 58 61 59 /* 62 60 * The ib_uobject locking scheme is as follows: ··· 2591 2593 return ret ? ret : in_len; 2592 2594 } 2593 2595 2594 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 2595 2596 static int kern_spec_to_ib_spec(struct ib_uverbs_flow_spec *kern_spec, 2596 2597 union ib_flow_spec *ib_spec) 2597 2598 { ··· 2818 2821 2819 2822 return ret; 2820 2823 } 2821 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 2822 2824 2823 2825 static int __uverbs_create_xsrq(struct ib_uverbs_file *file, 2824 2826 struct ib_uverbs_create_xsrq *cmd,
-5
drivers/infiniband/core/uverbs_main.c
··· 117 117 [IB_USER_VERBS_CMD_OPEN_QP] = ib_uverbs_open_qp, 118 118 }; 119 119 120 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 121 120 static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file, 122 121 struct ib_udata *ucore, 123 122 struct ib_udata *uhw) = { 124 123 [IB_USER_VERBS_EX_CMD_CREATE_FLOW] = ib_uverbs_ex_create_flow, 125 124 [IB_USER_VERBS_EX_CMD_DESTROY_FLOW] = ib_uverbs_ex_destroy_flow 126 125 }; 127 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 128 126 129 127 static void ib_uverbs_add_one(struct ib_device *device); 130 128 static void ib_uverbs_remove_one(struct ib_device *device); ··· 631 633 hdr.in_words * 4, 632 634 hdr.out_words * 4); 633 635 634 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 635 - 636 636 } else if (flags == IB_USER_VERBS_CMD_FLAG_EXTENDED) { 637 637 __u32 command; 638 638 ··· 697 701 698 702 return written_count; 699 703 } 700 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 701 704 702 705 return -ENOSYS; 703 706 }
-2
drivers/infiniband/hw/mlx4/main.c
··· 1691 1691 ibdev->ib_dev.create_flow = mlx4_ib_create_flow; 1692 1692 ibdev->ib_dev.destroy_flow = mlx4_ib_destroy_flow; 1693 1693 1694 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 1695 1694 ibdev->ib_dev.uverbs_ex_cmd_mask |= 1696 1695 (1ull << IB_USER_VERBS_EX_CMD_CREATE_FLOW) | 1697 1696 (1ull << IB_USER_VERBS_EX_CMD_DESTROY_FLOW); 1698 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 1699 1697 } 1700 1698 1701 1699 mlx4_ib_alloc_eqs(dev, ibdev);
-6
include/uapi/rdma/ib_user_verbs.h
··· 89 89 IB_USER_VERBS_CMD_OPEN_QP, 90 90 }; 91 91 92 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 93 92 enum { 94 93 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, 95 94 IB_USER_VERBS_EX_CMD_DESTROY_FLOW 96 95 }; 97 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 98 96 99 97 /* 100 98 * Make sure that all structs defined in this file remain laid out so ··· 135 137 __u16 out_words; 136 138 }; 137 139 138 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 139 140 struct ib_uverbs_ex_cmd_hdr { 140 141 __u64 response; 141 142 __u16 provider_in_words; 142 143 __u16 provider_out_words; 143 144 __u32 cmd_hdr_reserved; 144 145 }; 145 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 146 146 147 147 struct ib_uverbs_get_context { 148 148 __u64 response; ··· 703 707 __u64 driver_data[0]; 704 708 }; 705 709 706 - #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING 707 710 struct ib_uverbs_flow_spec_hdr { 708 711 __u32 type; 709 712 __u16 size; ··· 797 802 __u32 comp_mask; 798 803 __u32 flow_handle; 799 804 }; 800 - #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ 801 805 802 806 struct ib_uverbs_create_srq { 803 807 __u64 response;