History

Merge tag 'for-linus-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma updates from Doug Ledford: "This is a big pull request. Of note is that I'm sending you the new ioctl API for the rdma subsystem. We put it up on linux-api@, but didn't get much response. The API is complex, but it solves two different problems in one go: 1) The bi-directional nature of the RDMA file write calls, which created the security hole we had to handle (and for which the fix is now causing problems for systems in production, we were a bit over zealous in the fix and the ability to open a device, then fork, then create new queue pairs on the device and use them is broken). 2) The bloat caused by different vendors implementing extensions to the base verbs API. Each vendor's hardware is slightly different, and the hardware might be suitable for one extension but not another. By the time we add generic extensions for all the different ways that the different hardware can offload things, the API becomes bloated. Things like our completion structs have started to exceed a cache line in size because of all the elements needed to support this. That in turn shows up heavily in the performance graphs with a noticable drop in performance on 100Gigabit links as our completion structs go from occupying one cache line to 1+. This API makes things like the completion structs modular in a very similar way to netlink so that your structs can only include the items needed for the offloads/features you are actually using on a given queue pair. In that way we support everything, but only use what we need, and our structs stay smaller. The ioctl API is better explained by the posting on linux-api@ than I can explain it here, so I'll just leave it at that. The rest of the pull request is typical stuff. Updates for 4.14 kernel merge window - Lots of hfi1 driver updates (mixed with a few qib and core updates as well) - rxe updates - various mlx updates - Set default roce type to RoCEv2 - Several larger fixes for bnxt_re that were too big for -rc - Several larger fixes for qedr that, likewise, were too big for -rc - Misc core changes - Make the hns_roce driver compilable on arches other than aarch64 so we can more easily debug build issues related to it - Add rdma-netlink infrastructure updates - Add automatic IRQ affinity infrastructure - Add 32bit lid support - Lots of misc fixes across the subsystem from random people - Autoloading of RDMA netlink modules - PCI pool cleanups from Romain Perier - mlx5 driver feature additions and fixes - Hardware tag matchine feature - Fix sleeping in atomic when resolving roce ah - Add experimental ioctl interface as posted to linux-api@" * tag 'for-linus-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (328 commits) IB/core: Expose ioctl interface through experimental Kconfig IB/core: Assign root to all drivers IB/core: Add completion queue (cq) object actions IB/core: Add legacy driver's user-data IB/core: Export ioctl enum types to user-space IB/core: Explicitly destroy an object while keeping uobject IB/core: Add macros for declaring methods and attributes IB/core: Add uverbs merge trees functionality IB/core: Add DEVICE object and root tree structure IB/core: Declare an object instead of declaring only type attributes IB/core: Add new ioctl interface RDMA/vmw_pvrdma: Fix a signedness RDMA/vmw_pvrdma: Report network header type in WC IB/core: Add might_sleep() annotation to ib_init_ah_from_wc() IB/cm: Fix sleeping in atomic when RoCE is used IB/core: Add support to finalize objects in one transaction IB/core: Add a generic way to execute an operation on a uobject Documentation: Hardware tag matching IB/mlx5: Support IB_SRQT_TM net/mlx5: Add XRQ support ...

Linus Torvalds committed 9 years ago

Commit aa9d4642 parents 906dde0 8eb19e8275 files · +14866 −5221Browse files

Showing the changes to include/uapi (8 of 275 files). Show all

Unified · Split

8 files
  1. include/uapi/rdma/ib_user_ioctl_verbs.h +84 −0
  2. include/uapi/rdma/ib_user_verbs.h +17 −2
  3. include/uapi/rdma/mlx4-abi.h +51 −1
  4. include/uapi/rdma/mlx5-abi.h +23 −0
  5. include/uapi/rdma/qedr-abi.h +3 −0
  6. include/uapi/rdma/rdma_netlink.h +83 −1
  7. include/uapi/rdma/rdma_user_ioctl.h +33 −0
  8. include/uapi/rdma/vmw_pvrdma-abi.h +4 −2
include/uapi/rdma/ib_user_ioctl_verbs.h+84−0
@@ -0,0 +1,84 @@
1/*
2 * Copyright (c) 2017, Mellanox Technologies inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef IB_USER_IOCTL_VERBS_H
34#define IB_USER_IOCTL_VERBS_H
35
36#include <rdma/rdma_user_ioctl.h>
37
38#define UVERBS_UDATA_DRIVER_DATA_NS 1
39#define UVERBS_UDATA_DRIVER_DATA_FLAG (1UL << UVERBS_ID_NS_SHIFT)
40
41enum uverbs_default_objects {
42 UVERBS_OBJECT_DEVICE, /* No instances of DEVICE are allowed */
43 UVERBS_OBJECT_PD,
44 UVERBS_OBJECT_COMP_CHANNEL,
45 UVERBS_OBJECT_CQ,
46 UVERBS_OBJECT_QP,
47 UVERBS_OBJECT_SRQ,
48 UVERBS_OBJECT_AH,
49 UVERBS_OBJECT_MR,
50 UVERBS_OBJECT_MW,
51 UVERBS_OBJECT_FLOW,
52 UVERBS_OBJECT_XRCD,
53 UVERBS_OBJECT_RWQ_IND_TBL,
54 UVERBS_OBJECT_WQ,
55 UVERBS_OBJECT_LAST,
56};
57
58enum {
59 UVERBS_UHW_IN = UVERBS_UDATA_DRIVER_DATA_FLAG,
60 UVERBS_UHW_OUT,
61};
62
63enum uverbs_create_cq_cmd_attr_ids {
64 CREATE_CQ_HANDLE,
65 CREATE_CQ_CQE,
66 CREATE_CQ_USER_HANDLE,
67 CREATE_CQ_COMP_CHANNEL,
68 CREATE_CQ_COMP_VECTOR,
69 CREATE_CQ_FLAGS,
70 CREATE_CQ_RESP_CQE,
71};
72
73enum uverbs_destroy_cq_cmd_attr_ids {
74 DESTROY_CQ_HANDLE,
75 DESTROY_CQ_RESP,
76};
77
78enum uverbs_actions_cq_ops {
79 UVERBS_CQ_CREATE,
80 UVERBS_CQ_DESTROY,
81};
82
83#endif
84
include/uapi/rdma/ib_user_verbs.h+17−2
@@ -236,6 +236,20 @@ struct ib_uverbs_rss_caps { · 235 unmodified lines
236 __u32 reserved;236 __u32 reserved;
237};237};
238 238
239struct ib_uverbs_tm_caps {
240 /* Max size of rendezvous request message */
241 __u32 max_rndv_hdr_size;
242 /* Max number of entries in tag matching list */
243 __u32 max_num_tags;
244 /* TM flags */
245 __u32 flags;
246 /* Max number of outstanding list operations */
247 __u32 max_ops;
248 /* Max number of SGE in tag matching entry */
249 __u32 max_sge;
250 __u32 reserved;
251};
252
239struct ib_uverbs_ex_query_device_resp {253struct ib_uverbs_ex_query_device_resp {
240 struct ib_uverbs_query_device_resp base;254 struct ib_uverbs_query_device_resp base;
241 __u32 comp_mask;255 __u32 comp_mask;
@@ -247,6 +261,7 @@ struct ib_uverbs_ex_query_device_resp { · 5 unmodified lines
247 struct ib_uverbs_rss_caps rss_caps;261 struct ib_uverbs_rss_caps rss_caps;
248 __u32 max_wq_type_rq;262 __u32 max_wq_type_rq;
249 __u32 raw_packet_caps;263 __u32 raw_packet_caps;
264 struct ib_uverbs_tm_caps xrq_caps;
250};265};
251 266
252struct ib_uverbs_query_port {267struct ib_uverbs_query_port {
@@ -578,7 +593,7 @@ struct ib_uverbs_ex_create_qp { · 325 unmodified lines
578 __u32 comp_mask;593 __u32 comp_mask;
579 __u32 create_flags;594 __u32 create_flags;
580 __u32 rwq_ind_tbl_handle;595 __u32 rwq_ind_tbl_handle;
581 __u32 reserved1;596 __u32 source_qpn;
582};597};
583 598
584struct ib_uverbs_open_qp {599struct ib_uverbs_open_qp {
@@ -1024,7 +1039,7 @@ struct ib_uverbs_create_xsrq { · 439 unmodified lines
1024 __u32 max_wr;1039 __u32 max_wr;
1025 __u32 max_sge;1040 __u32 max_sge;
1026 __u32 srq_limit;1041 __u32 srq_limit;
1027 __u32 reserved;1042 __u32 max_num_tags;
1028 __u32 xrcd_handle;1043 __u32 xrcd_handle;
1029 __u32 cq_handle;1044 __u32 cq_handle;
1030 __u64 driver_data[0];1045 __u64 driver_data[0];
include/uapi/rdma/mlx4-abi.h+51−1
@@ -95,13 +95,63 @@ struct mlx4_ib_create_srq_resp { · 94 unmodified lines
95 __u32 reserved;95 __u32 reserved;
96};96};
97 97
98struct mlx4_ib_create_qp_rss {
99 __u64 rx_hash_fields_mask;
100 __u8 rx_hash_function;
101 __u8 reserved[7];
102 __u8 rx_hash_key[40];
103 __u32 comp_mask;
104 __u32 reserved1;
105};
106
98struct mlx4_ib_create_qp {107struct mlx4_ib_create_qp {
99 __u64 buf_addr;108 __u64 buf_addr;
100 __u64 db_addr;109 __u64 db_addr;
101 __u8 log_sq_bb_count;110 __u8 log_sq_bb_count;
102 __u8 log_sq_stride;111 __u8 log_sq_stride;
103 __u8 sq_no_prefetch;112 __u8 sq_no_prefetch;
104 __u8 reserved[5];113 __u8 reserved;
114 __u32 inl_recv_sz;
115};
116
117struct mlx4_ib_create_wq {
118 __u64 buf_addr;
119 __u64 db_addr;
120 __u8 log_range_size;
121 __u8 reserved[3];
122 __u32 comp_mask;
123};
124
125struct mlx4_ib_modify_wq {
126 __u32 comp_mask;
127 __u32 reserved;
128};
129
130struct mlx4_ib_create_rwq_ind_tbl_resp {
131 __u32 response_length;
132 __u32 reserved;
133};
134
135/* RX Hash function flags */
136enum mlx4_ib_rx_hash_function_flags {
137 MLX4_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
138};
139
140/*
141 * RX Hash flags, these flags allows to set which incoming packet's field should
142 * participates in RX Hash. Each flag represent certain packet's field,
143 * when the flag is set the field that is represented by the flag will
144 * participate in RX Hash calculation.
145 */
146enum mlx4_ib_rx_hash_fields {
147 MLX4_IB_RX_HASH_SRC_IPV4 = 1 << 0,
148 MLX4_IB_RX_HASH_DST_IPV4 = 1 << 1,
149 MLX4_IB_RX_HASH_SRC_IPV6 = 1 << 2,
150 MLX4_IB_RX_HASH_DST_IPV6 = 1 << 3,
151 MLX4_IB_RX_HASH_SRC_PORT_TCP = 1 << 4,
152 MLX4_IB_RX_HASH_DST_PORT_TCP = 1 << 5,
153 MLX4_IB_RX_HASH_SRC_PORT_UDP = 1 << 6,
154 MLX4_IB_RX_HASH_DST_PORT_UDP = 1 << 7
105};155};
106 156
107#endif /* MLX4_ABI_USER_H */157#endif /* MLX4_ABI_USER_H */
include/uapi/rdma/mlx5-abi.h+23−0
@@ -168,6 +168,28 @@ struct mlx5_packet_pacing_caps { · 167 unmodified lines
168 __u32 reserved;168 __u32 reserved;
169};169};
170 170
171enum mlx5_ib_mpw_caps {
172 MPW_RESERVED = 1 << 0,
173 MLX5_IB_ALLOW_MPW = 1 << 1,
174 MLX5_IB_SUPPORT_EMPW = 1 << 2,
175};
176
177enum mlx5_ib_sw_parsing_offloads {
178 MLX5_IB_SW_PARSING = 1 << 0,
179 MLX5_IB_SW_PARSING_CSUM = 1 << 1,
180 MLX5_IB_SW_PARSING_LSO = 1 << 2,
181};
182
183struct mlx5_ib_sw_parsing_caps {
184 __u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */
185
186 /* Corresponding bit will be set if qp type from
187 * 'enum ib_qp_type' is supported, e.g.
188 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
189 */
190 __u32 supported_qpts;
191};
192
171struct mlx5_ib_query_device_resp {193struct mlx5_ib_query_device_resp {
172 __u32 comp_mask;194 __u32 comp_mask;
173 __u32 response_length;195 __u32 response_length;
@@ -177,6 +199,7 @@ struct mlx5_ib_query_device_resp { · 3 unmodified lines
177 struct mlx5_packet_pacing_caps packet_pacing_caps;199 struct mlx5_packet_pacing_caps packet_pacing_caps;
178 __u32 mlx5_ib_support_multi_pkt_send_wqes;200 __u32 mlx5_ib_support_multi_pkt_send_wqes;
179 __u32 reserved;201 __u32 reserved;
202 struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
180};203};
181 204
182struct mlx5_ib_create_cq {205struct mlx5_ib_create_cq {
include/uapi/rdma/qedr-abi.h+3−0
@@ -49,6 +49,9 @@ struct qedr_alloc_ucontext_resp { · 48 unmodified lines
49 __u32 sges_per_recv_wr;49 __u32 sges_per_recv_wr;
50 __u32 sges_per_srq_wr;50 __u32 sges_per_srq_wr;
51 __u32 max_cqes;51 __u32 max_cqes;
52 __u8 dpm_enabled;
53 __u8 wids_enabled;
54 __u16 wid_count;
52};55};
53 56
54struct qedr_alloc_pd_ureq {57struct qedr_alloc_pd_ureq {
include/uapi/rdma/rdma_netlink.h+83−1
@@ -8,7 +8,7 @@ enum { · 7 unmodified lines
8 RDMA_NL_IWCM,8 RDMA_NL_IWCM,
9 RDMA_NL_RSVD,9 RDMA_NL_RSVD,
10 RDMA_NL_LS, /* RDMA Local Services */10 RDMA_NL_LS, /* RDMA Local Services */
11 RDMA_NL_I40IW,11 RDMA_NL_NLDEV, /* RDMA device interface */
12 RDMA_NL_NUM_CLIENTS12 RDMA_NL_NUM_CLIENTS
13};13};
14 14
@@ -222,4 +222,86 @@ struct rdma_nla_ls_gid { · 207 unmodified lines
222 __u8 gid[16];222 __u8 gid[16];
223};223};
224 224
225enum rdma_nldev_command {
226 RDMA_NLDEV_CMD_UNSPEC,
227
228 RDMA_NLDEV_CMD_GET, /* can dump */
229 RDMA_NLDEV_CMD_SET,
230 RDMA_NLDEV_CMD_NEW,
231 RDMA_NLDEV_CMD_DEL,
232
233 RDMA_NLDEV_CMD_PORT_GET, /* can dump */
234 RDMA_NLDEV_CMD_PORT_SET,
235 RDMA_NLDEV_CMD_PORT_NEW,
236 RDMA_NLDEV_CMD_PORT_DEL,
237
238 RDMA_NLDEV_NUM_OPS
239};
240
241enum rdma_nldev_attr {
242 /* don't change the order or add anything between, this is ABI! */
243 RDMA_NLDEV_ATTR_UNSPEC,
244
245 /* Identifier for ib_device */
246 RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
247
248 RDMA_NLDEV_ATTR_DEV_NAME, /* string */
249 /*
250 * Device index together with port index are identifiers
251 * for port/link properties.
252 *
253 * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
254 * of available ports in ib_device, while for port specific operations,
255 * it will be real port index as it appears in sysfs. Port index follows
256 * sysfs notation and starts from 1 for the first port.
257 */
258 RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
259
260 /*
261 * Device and port capabilities
262 */
263 RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */
264
265 /*
266 * FW version
267 */
268 RDMA_NLDEV_ATTR_FW_VERSION, /* string */
269
270 /*
271 * Node GUID (in host byte order) associated with the RDMA device.
272 */
273 RDMA_NLDEV_ATTR_NODE_GUID, /* u64 */
274
275 /*
276 * System image GUID (in host byte order) associated with
277 * this RDMA device and other devices which are part of a
278 * single system.
279 */
280 RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
281
282 /*
283 * Subnet prefix (in host byte order)
284 */
285 RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
286
287 /*
288 * Local Identifier (LID),
289 * According to IB specification, It is 16-bit address assigned
290 * by the Subnet Manager. Extended to be 32-bit for OmniPath users.
291 */
292 RDMA_NLDEV_ATTR_LID, /* u32 */
293 RDMA_NLDEV_ATTR_SM_LID, /* u32 */
294
295 /*
296 * LID mask control (LMC)
297 */
298 RDMA_NLDEV_ATTR_LMC, /* u8 */
299
300 RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
301 RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
302
303 RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
304
305 RDMA_NLDEV_ATTR_MAX
306};
225#endif /* _UAPI_RDMA_NETLINK_H */307#endif /* _UAPI_RDMA_NETLINK_H */
include/uapi/rdma/rdma_user_ioctl.h+33−0
@@ -43,6 +43,39 @@ · 42 unmodified lines
43/* Legacy name, for user space application which already use it */43/* Legacy name, for user space application which already use it */
44#define IB_IOCTL_MAGIC RDMA_IOCTL_MAGIC44#define IB_IOCTL_MAGIC RDMA_IOCTL_MAGIC
45 45
46#define RDMA_VERBS_IOCTL \
47 _IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)
48
49#define UVERBS_ID_NS_MASK 0xF000
50#define UVERBS_ID_NS_SHIFT 12
51
52enum {
53 /* User input */
54 UVERBS_ATTR_F_MANDATORY = 1U << 0,
55 /*
56 * Valid output bit should be ignored and considered set in
57 * mandatory fields. This bit is kernel output.
58 */
59 UVERBS_ATTR_F_VALID_OUTPUT = 1U << 1,
60};
61
62struct ib_uverbs_attr {
63 __u16 attr_id; /* command specific type attribute */
64 __u16 len; /* only for pointers */
65 __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */
66 __u16 reserved;
67 __u64 data; /* ptr to command, inline data or idr/fd */
68};
69
70struct ib_uverbs_ioctl_hdr {
71 __u16 length;
72 __u16 object_id;
73 __u16 method_id;
74 __u16 num_attrs;
75 __u64 reserved;
76 struct ib_uverbs_attr attrs[0];
77};
78
46/*79/*
47 * General blocks assignments80 * General blocks assignments
48 * It is closed on purpose do not expose it it user space81 * It is closed on purpose do not expose it it user space
include/uapi/rdma/vmw_pvrdma-abi.h+4−2
@@ -125,7 +125,8 @@ enum pvrdma_wc_flags { · 124 unmodified lines
125 PVRDMA_WC_IP_CSUM_OK = 1 << 3,125 PVRDMA_WC_IP_CSUM_OK = 1 << 3,
126 PVRDMA_WC_WITH_SMAC = 1 << 4,126 PVRDMA_WC_WITH_SMAC = 1 << 4,
127 PVRDMA_WC_WITH_VLAN = 1 << 5,127 PVRDMA_WC_WITH_VLAN = 1 << 5,
128 PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_VLAN,128 PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6,
129 PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE,
129};130};
130 131
131struct pvrdma_alloc_ucontext_resp {132struct pvrdma_alloc_ucontext_resp {
@@ -283,7 +284,8 @@ struct pvrdma_cqe { · 151 unmodified lines
283 __u8 dlid_path_bits;284 __u8 dlid_path_bits;
284 __u8 port_num;285 __u8 port_num;
285 __u8 smac[6];286 __u8 smac[6];
286 __u8 reserved2[7]; /* Pad to next power of 2 (64). */287 __u8 network_hdr_type;
288 __u8 reserved2[6]; /* Pad to next power of 2 (64). */
287};289};
288 290
289#endif /* __VMW_PVRDMA_ABI_H__ */291#endif /* __VMW_PVRDMA_ABI_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t