blob: 6aeb03315b0bd543b4fa11d5a46ab8d8a98430a8 [file] [log] [blame]
Jason Gunthorped50e14a2018-04-20 09:49:10 -06001/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
Roland Dreier8a96b3f2005-07-07 17:57:12 -07002/*
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
Roland Dreier33b9b3e2006-01-30 14:29:21 -08004 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
Roland Dreier91ecd4a2005-10-14 15:21:44 -07005 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
Dotan Barak8bdb0e82006-02-13 16:31:57 -08006 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
Roland Dreier8a96b3f2005-07-07 17:57:12 -07007 *
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * OpenIB.org BSD license below:
13 *
14 * Redistribution and use in source and binary forms, with or
15 * without modification, are permitted provided that the following
16 * conditions are met:
17 *
18 * - Redistributions of source code must retain the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer.
21 *
22 * - Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimer in the documentation and/or other materials
25 * provided with the distribution.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
31 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
32 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 * SOFTWARE.
Roland Dreier8a96b3f2005-07-07 17:57:12 -070035 */
36
37#ifndef IB_USER_VERBS_H
38#define IB_USER_VERBS_H
39
40#include <linux/types.h>
41
42/*
43 * Increment this value if any changes that break userspace ABI
44 * compatibility are made.
45 */
Dotan Barakea88fd12006-02-23 12:36:18 -080046#define IB_USER_VERBS_ABI_VERSION 6
Igor Ivanov400dbc92013-08-14 13:58:29 +030047#define IB_USER_VERBS_CMD_THRESHOLD 50
Roland Dreier8a96b3f2005-07-07 17:57:12 -070048
49enum {
Roland Dreier8a96b3f2005-07-07 17:57:12 -070050 IB_USER_VERBS_CMD_GET_CONTEXT,
51 IB_USER_VERBS_CMD_QUERY_DEVICE,
52 IB_USER_VERBS_CMD_QUERY_PORT,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070053 IB_USER_VERBS_CMD_ALLOC_PD,
54 IB_USER_VERBS_CMD_DEALLOC_PD,
55 IB_USER_VERBS_CMD_CREATE_AH,
56 IB_USER_VERBS_CMD_MODIFY_AH,
57 IB_USER_VERBS_CMD_QUERY_AH,
58 IB_USER_VERBS_CMD_DESTROY_AH,
59 IB_USER_VERBS_CMD_REG_MR,
60 IB_USER_VERBS_CMD_REG_SMR,
61 IB_USER_VERBS_CMD_REREG_MR,
62 IB_USER_VERBS_CMD_QUERY_MR,
63 IB_USER_VERBS_CMD_DEREG_MR,
64 IB_USER_VERBS_CMD_ALLOC_MW,
65 IB_USER_VERBS_CMD_BIND_MW,
66 IB_USER_VERBS_CMD_DEALLOC_MW,
Roland Dreier6b73597e2005-09-26 13:53:25 -070067 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070068 IB_USER_VERBS_CMD_CREATE_CQ,
69 IB_USER_VERBS_CMD_RESIZE_CQ,
70 IB_USER_VERBS_CMD_DESTROY_CQ,
71 IB_USER_VERBS_CMD_POLL_CQ,
72 IB_USER_VERBS_CMD_PEEK_CQ,
73 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
74 IB_USER_VERBS_CMD_CREATE_QP,
75 IB_USER_VERBS_CMD_QUERY_QP,
76 IB_USER_VERBS_CMD_MODIFY_QP,
77 IB_USER_VERBS_CMD_DESTROY_QP,
78 IB_USER_VERBS_CMD_POST_SEND,
79 IB_USER_VERBS_CMD_POST_RECV,
80 IB_USER_VERBS_CMD_ATTACH_MCAST,
Roland Dreierf520ba52005-08-18 12:24:13 -070081 IB_USER_VERBS_CMD_DETACH_MCAST,
82 IB_USER_VERBS_CMD_CREATE_SRQ,
83 IB_USER_VERBS_CMD_MODIFY_SRQ,
84 IB_USER_VERBS_CMD_QUERY_SRQ,
85 IB_USER_VERBS_CMD_DESTROY_SRQ,
Sean Hefty53d0bd12011-05-24 08:33:46 -070086 IB_USER_VERBS_CMD_POST_SRQ_RECV,
87 IB_USER_VERBS_CMD_OPEN_XRCD,
Sean Hefty8541f8d2011-05-25 17:08:38 -070088 IB_USER_VERBS_CMD_CLOSE_XRCD,
Sean Hefty42849b22011-08-11 13:57:43 -070089 IB_USER_VERBS_CMD_CREATE_XSRQ,
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +030090 IB_USER_VERBS_CMD_OPEN_QP,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070091};
92
Yann Droneaudf21519b2013-11-06 23:21:49 +010093enum {
Eli Cohen02d1aa72015-02-08 13:28:50 +020094 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
Matan Barak565197d2015-06-11 16:35:23 +030095 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
Eran Ben Elisha6d8a7492015-10-21 17:00:42 +030096 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
Bodong Wang189aba92016-12-01 13:43:15 +020097 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
Yann Droneaudf21519b2013-11-06 23:21:49 +010098 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
Eli Cohen5a77abf2014-12-11 17:04:15 +020099 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
Yishai Hadasf213c052016-05-23 15:20:49 +0300100 IB_USER_VERBS_EX_CMD_CREATE_WQ,
101 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
102 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
Yishai Hadasde019a92016-05-23 15:20:52 +0300103 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
Yonatan Cohen869ddcf2017-11-13 10:51:13 +0200104 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
Yann Droneaudf21519b2013-11-06 23:21:49 +0100106};
Yann Droneaudf21519b2013-11-06 23:21:49 +0100107
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700108/*
109 * Make sure that all structs defined in this file remain laid out so
110 * that they pack the same way on 32-bit and 64-bit architectures (to
111 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700112 * Specifically:
113 * - Do not use pointer types -- pass pointers in __u64 instead.
114 * - Make sure that any structure larger than 4 bytes is padded to a
115 * multiple of 8 bytes. Otherwise the structure size will be
116 * different between 32-bit and 64-bit architectures.
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700117 */
118
119struct ib_uverbs_async_event_desc {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600120 __aligned_u64 element;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700121 __u32 event_type; /* enum ib_event_type */
122 __u32 reserved;
123};
124
125struct ib_uverbs_comp_event_desc {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600126 __aligned_u64 cq_handle;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700127};
128
Yonatan Cohen18bd9072017-11-13 10:51:16 +0200129struct ib_uverbs_cq_moderation_caps {
130 __u16 max_cq_moderation_count;
131 __u16 max_cq_moderation_period;
132 __u32 reserved;
133};
134
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700135/*
136 * All commands from userspace should start with a __u32 command field
137 * followed by __u16 in_words and out_words fields (which give the
138 * length of the command block and response buffer if any in 32-bit
139 * words). The kernel driver will read these fields first and read
140 * the rest of the command struct based on these value.
141 */
142
Yann Droneaudf21519b2013-11-06 23:21:49 +0100143#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
Leon Romanovsky372e15c2018-02-21 18:12:43 +0200144#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
Yann Droneaudf21519b2013-11-06 23:21:49 +0100145
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700146struct ib_uverbs_cmd_hdr {
147 __u32 command;
148 __u16 in_words;
149 __u16 out_words;
150};
151
Yann Droneaudf21519b2013-11-06 23:21:49 +0100152struct ib_uverbs_ex_cmd_hdr {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600153 __aligned_u64 response;
Igor Ivanov400dbc92013-08-14 13:58:29 +0300154 __u16 provider_in_words;
155 __u16 provider_out_words;
156 __u32 cmd_hdr_reserved;
157};
158
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700159struct ib_uverbs_get_context {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600160 __aligned_u64 response;
161 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700162};
163
164struct ib_uverbs_get_context_resp {
165 __u32 async_fd;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700166 __u32 num_comp_vectors;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700167};
168
169struct ib_uverbs_query_device {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600170 __aligned_u64 response;
171 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700172};
173
174struct ib_uverbs_query_device_resp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600175 __aligned_u64 fw_ver;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700176 __be64 node_guid;
177 __be64 sys_image_guid;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600178 __aligned_u64 max_mr_size;
179 __aligned_u64 page_size_cap;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700180 __u32 vendor_id;
181 __u32 vendor_part_id;
182 __u32 hw_ver;
183 __u32 max_qp;
184 __u32 max_qp_wr;
185 __u32 device_cap_flags;
186 __u32 max_sge;
187 __u32 max_sge_rd;
188 __u32 max_cq;
189 __u32 max_cqe;
190 __u32 max_mr;
191 __u32 max_pd;
192 __u32 max_qp_rd_atom;
193 __u32 max_ee_rd_atom;
194 __u32 max_res_rd_atom;
195 __u32 max_qp_init_rd_atom;
196 __u32 max_ee_init_rd_atom;
197 __u32 atomic_cap;
198 __u32 max_ee;
199 __u32 max_rdd;
200 __u32 max_mw;
201 __u32 max_raw_ipv6_qp;
202 __u32 max_raw_ethy_qp;
203 __u32 max_mcast_grp;
204 __u32 max_mcast_qp_attach;
205 __u32 max_total_mcast_qp_attach;
206 __u32 max_ah;
207 __u32 max_fmr;
208 __u32 max_map_per_fmr;
209 __u32 max_srq;
210 __u32 max_srq_wr;
211 __u32 max_srq_sge;
212 __u16 max_pkeys;
213 __u8 local_ca_ack_delay;
214 __u8 phys_port_cnt;
215 __u8 reserved[4];
216};
217
Eli Cohen02d1aa72015-02-08 13:28:50 +0200218struct ib_uverbs_ex_query_device {
219 __u32 comp_mask;
220 __u32 reserved;
221};
222
Haggai Eranf4056bf2015-02-08 13:28:51 +0200223struct ib_uverbs_odp_caps {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600224 __aligned_u64 general_caps;
Haggai Eranf4056bf2015-02-08 13:28:51 +0200225 struct {
226 __u32 rc_odp_caps;
227 __u32 uc_odp_caps;
228 __u32 ud_odp_caps;
229 } per_transport_caps;
230 __u32 reserved;
231};
232
Yishai Hadas47adf2f2016-08-28 11:28:44 +0300233struct ib_uverbs_rss_caps {
234 /* Corresponding bit will be set if qp type from
235 * 'enum ib_qp_type' is supported, e.g.
236 * supported_qpts |= 1 << IB_QPT_UD
237 */
238 __u32 supported_qpts;
239 __u32 max_rwq_indirection_tables;
240 __u32 max_rwq_indirection_table_size;
241 __u32 reserved;
242};
243
Artemy Kovalyov8d505052017-08-17 15:52:08 +0300244struct ib_uverbs_tm_caps {
245 /* Max size of rendezvous request message */
246 __u32 max_rndv_hdr_size;
247 /* Max number of entries in tag matching list */
248 __u32 max_num_tags;
249 /* TM flags */
250 __u32 flags;
251 /* Max number of outstanding list operations */
252 __u32 max_ops;
253 /* Max number of SGE in tag matching entry */
254 __u32 max_sge;
255 __u32 reserved;
256};
257
Eli Cohen02d1aa72015-02-08 13:28:50 +0200258struct ib_uverbs_ex_query_device_resp {
259 struct ib_uverbs_query_device_resp base;
260 __u32 comp_mask;
261 __u32 response_length;
Haggai Eranf4056bf2015-02-08 13:28:51 +0200262 struct ib_uverbs_odp_caps odp_caps;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600263 __aligned_u64 timestamp_mask;
264 __aligned_u64 hca_core_clock; /* in KHZ */
265 __aligned_u64 device_cap_flags_ex;
Yishai Hadas47adf2f2016-08-28 11:28:44 +0300266 struct ib_uverbs_rss_caps rss_caps;
267 __u32 max_wq_type_rq;
Noa Osherovich5f23d422017-01-18 15:39:58 +0200268 __u32 raw_packet_caps;
Leon Romanovsky78b1beb2017-09-24 21:46:29 +0300269 struct ib_uverbs_tm_caps tm_caps;
Yonatan Cohen18bd9072017-11-13 10:51:16 +0200270 struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
Ariel Levkovichd41c1202018-04-05 18:53:22 +0300271 __aligned_u64 max_dm_size;
Eli Cohen02d1aa72015-02-08 13:28:50 +0200272};
273
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700274struct ib_uverbs_query_port {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600275 __aligned_u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700276 __u8 port_num;
277 __u8 reserved[7];
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600278 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700279};
280
281struct ib_uverbs_query_port_resp {
282 __u32 port_cap_flags;
283 __u32 max_msg_sz;
284 __u32 bad_pkey_cntr;
285 __u32 qkey_viol_cntr;
286 __u32 gid_tbl_len;
287 __u16 pkey_tbl_len;
288 __u16 lid;
289 __u16 sm_lid;
290 __u8 state;
291 __u8 max_mtu;
292 __u8 active_mtu;
293 __u8 lmc;
294 __u8 max_vl_num;
295 __u8 sm_sl;
296 __u8 subnet_timeout;
297 __u8 init_type_reply;
298 __u8 active_width;
299 __u8 active_speed;
300 __u8 phys_state;
Eli Cohen2420b602010-10-18 14:45:20 -0700301 __u8 link_layer;
302 __u8 reserved[2];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700303};
304
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700305struct ib_uverbs_alloc_pd {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600306 __aligned_u64 response;
307 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700308};
309
310struct ib_uverbs_alloc_pd_resp {
311 __u32 pd_handle;
312};
313
314struct ib_uverbs_dealloc_pd {
315 __u32 pd_handle;
316};
317
Sean Hefty53d0bd12011-05-24 08:33:46 -0700318struct ib_uverbs_open_xrcd {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600319 __aligned_u64 response;
Sean Hefty53d0bd12011-05-24 08:33:46 -0700320 __u32 fd;
321 __u32 oflags;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600322 __aligned_u64 driver_data[0];
Sean Hefty53d0bd12011-05-24 08:33:46 -0700323};
324
325struct ib_uverbs_open_xrcd_resp {
326 __u32 xrcd_handle;
327};
328
329struct ib_uverbs_close_xrcd {
330 __u32 xrcd_handle;
331};
332
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700333struct ib_uverbs_reg_mr {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600334 __aligned_u64 response;
335 __aligned_u64 start;
336 __aligned_u64 length;
337 __aligned_u64 hca_va;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700338 __u32 pd_handle;
339 __u32 access_flags;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600340 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700341};
342
343struct ib_uverbs_reg_mr_resp {
344 __u32 mr_handle;
345 __u32 lkey;
346 __u32 rkey;
347};
348
Matan Barak7e6edb92014-07-31 11:01:28 +0300349struct ib_uverbs_rereg_mr {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600350 __aligned_u64 response;
Matan Barak7e6edb92014-07-31 11:01:28 +0300351 __u32 mr_handle;
352 __u32 flags;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600353 __aligned_u64 start;
354 __aligned_u64 length;
355 __aligned_u64 hca_va;
Matan Barak7e6edb92014-07-31 11:01:28 +0300356 __u32 pd_handle;
357 __u32 access_flags;
358};
359
360struct ib_uverbs_rereg_mr_resp {
361 __u32 lkey;
362 __u32 rkey;
363};
364
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700365struct ib_uverbs_dereg_mr {
366 __u32 mr_handle;
367};
368
Shani Michaeli6b52a122013-02-06 16:19:13 +0000369struct ib_uverbs_alloc_mw {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600370 __aligned_u64 response;
Shani Michaeli6b52a122013-02-06 16:19:13 +0000371 __u32 pd_handle;
372 __u8 mw_type;
373 __u8 reserved[3];
374};
375
376struct ib_uverbs_alloc_mw_resp {
377 __u32 mw_handle;
378 __u32 rkey;
379};
380
381struct ib_uverbs_dealloc_mw {
382 __u32 mw_handle;
383};
384
Roland Dreier6b73597e2005-09-26 13:53:25 -0700385struct ib_uverbs_create_comp_channel {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600386 __aligned_u64 response;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700387};
388
389struct ib_uverbs_create_comp_channel_resp {
390 __u32 fd;
391};
392
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700393struct ib_uverbs_create_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600394 __aligned_u64 response;
395 __aligned_u64 user_handle;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700396 __u32 cqe;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700397 __u32 comp_vector;
398 __s32 comp_channel;
399 __u32 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600400 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700401};
402
Jason Gunthorpebeb801a2018-01-26 15:16:46 -0700403enum ib_uverbs_ex_create_cq_flags {
404 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
405 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
406};
407
Matan Barak565197d2015-06-11 16:35:23 +0300408struct ib_uverbs_ex_create_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600409 __aligned_u64 user_handle;
Matan Barak565197d2015-06-11 16:35:23 +0300410 __u32 cqe;
411 __u32 comp_vector;
412 __s32 comp_channel;
413 __u32 comp_mask;
Jason Gunthorpebeb801a2018-01-26 15:16:46 -0700414 __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
Matan Barak565197d2015-06-11 16:35:23 +0300415 __u32 reserved;
416};
417
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700418struct ib_uverbs_create_cq_resp {
419 __u32 cq_handle;
420 __u32 cqe;
421};
422
Matan Barak565197d2015-06-11 16:35:23 +0300423struct ib_uverbs_ex_create_cq_resp {
424 struct ib_uverbs_create_cq_resp base;
425 __u32 comp_mask;
426 __u32 response_length;
427};
428
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800429struct ib_uverbs_resize_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600430 __aligned_u64 response;
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800431 __u32 cq_handle;
432 __u32 cqe;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600433 __aligned_u64 driver_data[0];
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800434};
435
436struct ib_uverbs_resize_cq_resp {
437 __u32 cqe;
Ralph Campbell64f817b2006-09-22 15:22:24 -0700438 __u32 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600439 __aligned_u64 driver_data[0];
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800440};
441
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700442struct ib_uverbs_poll_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600443 __aligned_u64 response;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700444 __u32 cq_handle;
445 __u32 ne;
446};
447
448struct ib_uverbs_wc {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600449 __aligned_u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700450 __u32 status;
451 __u32 opcode;
452 __u32 vendor_err;
453 __u32 byte_len;
Steve Wise00f7ec32008-07-14 23:48:45 -0700454 union {
Jason Gunthorpec966ea12018-01-11 14:43:05 -0700455 __be32 imm_data;
Steve Wise00f7ec32008-07-14 23:48:45 -0700456 __u32 invalidate_rkey;
457 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700458 __u32 qp_num;
459 __u32 src_qp;
460 __u32 wc_flags;
461 __u16 pkey_index;
462 __u16 slid;
463 __u8 sl;
464 __u8 dlid_path_bits;
465 __u8 port_num;
466 __u8 reserved;
467};
468
469struct ib_uverbs_poll_cq_resp {
470 __u32 count;
471 __u32 reserved;
472 struct ib_uverbs_wc wc[0];
473};
474
475struct ib_uverbs_req_notify_cq {
476 __u32 cq_handle;
477 __u32 solicited_only;
478};
479
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700480struct ib_uverbs_destroy_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600481 __aligned_u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700482 __u32 cq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700483 __u32 reserved;
484};
485
486struct ib_uverbs_destroy_cq_resp {
487 __u32 comp_events_reported;
488 __u32 async_events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700489};
490
Sean Hefty6a9af2e2006-06-17 20:37:27 -0700491struct ib_uverbs_global_route {
492 __u8 dgid[16];
493 __u32 flow_label;
494 __u8 sgid_index;
495 __u8 hop_limit;
496 __u8 traffic_class;
497 __u8 reserved;
498};
499
500struct ib_uverbs_ah_attr {
501 struct ib_uverbs_global_route grh;
502 __u16 dlid;
503 __u8 sl;
504 __u8 src_path_bits;
505 __u8 static_rate;
506 __u8 is_global;
507 __u8 port_num;
508 __u8 reserved;
509};
510
511struct ib_uverbs_qp_attr {
512 __u32 qp_attr_mask;
513 __u32 qp_state;
514 __u32 cur_qp_state;
515 __u32 path_mtu;
516 __u32 path_mig_state;
517 __u32 qkey;
518 __u32 rq_psn;
519 __u32 sq_psn;
520 __u32 dest_qp_num;
521 __u32 qp_access_flags;
522
523 struct ib_uverbs_ah_attr ah_attr;
524 struct ib_uverbs_ah_attr alt_ah_attr;
525
526 /* ib_qp_cap */
527 __u32 max_send_wr;
528 __u32 max_recv_wr;
529 __u32 max_send_sge;
530 __u32 max_recv_sge;
531 __u32 max_inline_data;
532
533 __u16 pkey_index;
534 __u16 alt_pkey_index;
535 __u8 en_sqd_async_notify;
536 __u8 sq_draining;
537 __u8 max_rd_atomic;
538 __u8 max_dest_rd_atomic;
539 __u8 min_rnr_timer;
540 __u8 port_num;
541 __u8 timeout;
542 __u8 retry_cnt;
543 __u8 rnr_retry;
544 __u8 alt_port_num;
545 __u8 alt_timeout;
546 __u8 reserved[5];
547};
548
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700549struct ib_uverbs_create_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600550 __aligned_u64 response;
551 __aligned_u64 user_handle;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700552 __u32 pd_handle;
553 __u32 send_cq_handle;
554 __u32 recv_cq_handle;
555 __u32 srq_handle;
556 __u32 max_send_wr;
557 __u32 max_recv_wr;
558 __u32 max_send_sge;
559 __u32 max_recv_sge;
560 __u32 max_inline_data;
561 __u8 sq_sig_all;
562 __u8 qp_type;
563 __u8 is_srq;
564 __u8 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600565 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700566};
567
Yishai Hadasc70285f2016-05-23 15:20:55 +0300568enum ib_uverbs_create_qp_mask {
569 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
570};
571
572enum {
573 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
574};
575
Bodong Wang189aba92016-12-01 13:43:15 +0200576enum {
Leon Romanovsky646ebd42017-02-08 17:04:09 +0200577 /*
578 * This value is equal to IB_QP_DEST_QPN.
579 */
580 IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
Bodong Wang189aba92016-12-01 13:43:15 +0200581};
582
583enum {
Leon Romanovsky646ebd42017-02-08 17:04:09 +0200584 /*
585 * This value is equal to IB_QP_RATE_LIMIT.
586 */
587 IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
Bodong Wang189aba92016-12-01 13:43:15 +0200588};
589
Eran Ben Elisha6d8a7492015-10-21 17:00:42 +0300590struct ib_uverbs_ex_create_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600591 __aligned_u64 user_handle;
Eran Ben Elisha6d8a7492015-10-21 17:00:42 +0300592 __u32 pd_handle;
593 __u32 send_cq_handle;
594 __u32 recv_cq_handle;
595 __u32 srq_handle;
596 __u32 max_send_wr;
597 __u32 max_recv_wr;
598 __u32 max_send_sge;
599 __u32 max_recv_sge;
600 __u32 max_inline_data;
601 __u8 sq_sig_all;
602 __u8 qp_type;
603 __u8 is_srq;
604 __u8 reserved;
605 __u32 comp_mask;
606 __u32 create_flags;
Yishai Hadasc70285f2016-05-23 15:20:55 +0300607 __u32 rwq_ind_tbl_handle;
Yishai Hadas2dee0e52017-06-08 16:15:07 +0300608 __u32 source_qpn;
Eran Ben Elisha6d8a7492015-10-21 17:00:42 +0300609};
610
Sean Hefty42849b22011-08-11 13:57:43 -0700611struct ib_uverbs_open_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600612 __aligned_u64 response;
613 __aligned_u64 user_handle;
Sean Hefty42849b22011-08-11 13:57:43 -0700614 __u32 pd_handle;
615 __u32 qpn;
616 __u8 qp_type;
617 __u8 reserved[7];
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600618 __aligned_u64 driver_data[0];
Sean Hefty42849b22011-08-11 13:57:43 -0700619};
620
621/* also used for open response */
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700622struct ib_uverbs_create_qp_resp {
623 __u32 qp_handle;
624 __u32 qpn;
Jack Morgenstein77369ed2005-11-09 11:26:07 -0800625 __u32 max_send_wr;
626 __u32 max_recv_wr;
627 __u32 max_send_sge;
628 __u32 max_recv_sge;
629 __u32 max_inline_data;
Roland Dreier4d9781c2006-02-16 09:26:19 -0800630 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700631};
632
Eran Ben Elisha6d8a7492015-10-21 17:00:42 +0300633struct ib_uverbs_ex_create_qp_resp {
634 struct ib_uverbs_create_qp_resp base;
635 __u32 comp_mask;
636 __u32 response_length;
637};
638
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700639/*
640 * This struct needs to remain a multiple of 8 bytes to keep the
641 * alignment of the modify QP parameters.
642 */
643struct ib_uverbs_qp_dest {
644 __u8 dgid[16];
645 __u32 flow_label;
646 __u16 dlid;
647 __u16 reserved;
648 __u8 sgid_index;
649 __u8 hop_limit;
650 __u8 traffic_class;
651 __u8 sl;
652 __u8 src_path_bits;
653 __u8 static_rate;
654 __u8 is_global;
655 __u8 port_num;
656};
657
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800658struct ib_uverbs_query_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600659 __aligned_u64 response;
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800660 __u32 qp_handle;
661 __u32 attr_mask;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600662 __aligned_u64 driver_data[0];
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800663};
664
665struct ib_uverbs_query_qp_resp {
666 struct ib_uverbs_qp_dest dest;
667 struct ib_uverbs_qp_dest alt_dest;
668 __u32 max_send_wr;
669 __u32 max_recv_wr;
670 __u32 max_send_sge;
671 __u32 max_recv_sge;
672 __u32 max_inline_data;
673 __u32 qkey;
674 __u32 rq_psn;
675 __u32 sq_psn;
676 __u32 dest_qp_num;
677 __u32 qp_access_flags;
678 __u16 pkey_index;
679 __u16 alt_pkey_index;
680 __u8 qp_state;
681 __u8 cur_qp_state;
682 __u8 path_mtu;
683 __u8 path_mig_state;
Jack Morgenstein0b26c882006-10-25 12:54:20 +0200684 __u8 sq_draining;
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800685 __u8 max_rd_atomic;
686 __u8 max_dest_rd_atomic;
687 __u8 min_rnr_timer;
688 __u8 port_num;
689 __u8 timeout;
690 __u8 retry_cnt;
691 __u8 rnr_retry;
692 __u8 alt_port_num;
693 __u8 alt_timeout;
694 __u8 sq_sig_all;
695 __u8 reserved[5];
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600696 __aligned_u64 driver_data[0];
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800697};
698
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700699struct ib_uverbs_modify_qp {
700 struct ib_uverbs_qp_dest dest;
701 struct ib_uverbs_qp_dest alt_dest;
702 __u32 qp_handle;
703 __u32 attr_mask;
704 __u32 qkey;
705 __u32 rq_psn;
706 __u32 sq_psn;
707 __u32 dest_qp_num;
708 __u32 qp_access_flags;
709 __u16 pkey_index;
710 __u16 alt_pkey_index;
711 __u8 qp_state;
712 __u8 cur_qp_state;
713 __u8 path_mtu;
714 __u8 path_mig_state;
715 __u8 en_sqd_async_notify;
716 __u8 max_rd_atomic;
717 __u8 max_dest_rd_atomic;
718 __u8 min_rnr_timer;
719 __u8 port_num;
720 __u8 timeout;
721 __u8 retry_cnt;
722 __u8 rnr_retry;
723 __u8 alt_port_num;
724 __u8 alt_timeout;
725 __u8 reserved[2];
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600726 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700727};
728
Bodong Wang189aba92016-12-01 13:43:15 +0200729struct ib_uverbs_ex_modify_qp {
730 struct ib_uverbs_modify_qp base;
731 __u32 rate_limit;
732 __u32 reserved;
733};
734
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700735struct ib_uverbs_modify_qp_resp {
736};
737
Bodong Wang189aba92016-12-01 13:43:15 +0200738struct ib_uverbs_ex_modify_qp_resp {
739 __u32 comp_mask;
740 __u32 response_length;
741};
742
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700743struct ib_uverbs_destroy_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600744 __aligned_u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700745 __u32 qp_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700746 __u32 reserved;
747};
748
749struct ib_uverbs_destroy_qp_resp {
750 __u32 events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700751};
752
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700753/*
754 * The ib_uverbs_sge structure isn't used anywhere, since we assume
755 * the ib_sge structure is packed the same way on 32-bit and 64-bit
756 * architectures in both kernel and user space. It's just here to
757 * document the ABI.
758 */
759struct ib_uverbs_sge {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600760 __aligned_u64 addr;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700761 __u32 length;
762 __u32 lkey;
763};
764
765struct ib_uverbs_send_wr {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600766 __aligned_u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700767 __u32 num_sge;
768 __u32 opcode;
769 __u32 send_flags;
Roland Dreier0f39cf32008-04-16 21:09:32 -0700770 union {
Jason Gunthorpec966ea12018-01-11 14:43:05 -0700771 __be32 imm_data;
Roland Dreier0f39cf32008-04-16 21:09:32 -0700772 __u32 invalidate_rkey;
773 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700774 union {
775 struct {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600776 __aligned_u64 remote_addr;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700777 __u32 rkey;
778 __u32 reserved;
779 } rdma;
780 struct {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600781 __aligned_u64 remote_addr;
782 __aligned_u64 compare_add;
783 __aligned_u64 swap;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700784 __u32 rkey;
785 __u32 reserved;
786 } atomic;
787 struct {
788 __u32 ah;
789 __u32 remote_qpn;
790 __u32 remote_qkey;
791 __u32 reserved;
792 } ud;
793 } wr;
794};
795
796struct ib_uverbs_post_send {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600797 __aligned_u64 response;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700798 __u32 qp_handle;
799 __u32 wr_count;
800 __u32 sge_count;
801 __u32 wqe_size;
802 struct ib_uverbs_send_wr send_wr[0];
803};
804
805struct ib_uverbs_post_send_resp {
806 __u32 bad_wr;
807};
808
809struct ib_uverbs_recv_wr {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600810 __aligned_u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700811 __u32 num_sge;
812 __u32 reserved;
813};
814
815struct ib_uverbs_post_recv {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600816 __aligned_u64 response;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700817 __u32 qp_handle;
818 __u32 wr_count;
819 __u32 sge_count;
820 __u32 wqe_size;
821 struct ib_uverbs_recv_wr recv_wr[0];
822};
823
824struct ib_uverbs_post_recv_resp {
825 __u32 bad_wr;
826};
827
828struct ib_uverbs_post_srq_recv {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600829 __aligned_u64 response;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700830 __u32 srq_handle;
831 __u32 wr_count;
832 __u32 sge_count;
833 __u32 wqe_size;
834 struct ib_uverbs_recv_wr recv[0];
835};
836
837struct ib_uverbs_post_srq_recv_resp {
838 __u32 bad_wr;
839};
840
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700841struct ib_uverbs_create_ah {
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600842 __aligned_u64 response;
843 __aligned_u64 user_handle;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700844 __u32 pd_handle;
845 __u32 reserved;
846 struct ib_uverbs_ah_attr attr;
847};
848
849struct ib_uverbs_create_ah_resp {
850 __u32 ah_handle;
851};
852
853struct ib_uverbs_destroy_ah {
854 __u32 ah_handle;
855};
856
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700857struct ib_uverbs_attach_mcast {
858 __u8 gid[16];
859 __u32 qp_handle;
860 __u16 mlid;
861 __u16 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600862 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700863};
864
865struct ib_uverbs_detach_mcast {
866 __u8 gid[16];
867 __u32 qp_handle;
868 __u16 mlid;
869 __u16 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600870 __aligned_u64 driver_data[0];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700871};
872
Yann Droneaud58913ef2013-11-06 23:21:47 +0100873struct ib_uverbs_flow_spec_hdr {
874 __u32 type;
875 __u16 size;
876 __u16 reserved;
877 /* followed by flow_spec */
Jason Gunthorpe26b99062018-03-20 14:19:51 -0600878 __aligned_u64 flow_spec_data[0];
Yann Droneaud58913ef2013-11-06 23:21:47 +0100879};
880
Yann Droneaudb68c9562013-11-06 23:21:46 +0100881struct ib_uverbs_flow_eth_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300882 __u8 dst_mac[6];
883 __u8 src_mac[6];
884 __be16 ether_type;
885 __be16 vlan_tag;
886};
887
Yann Droneaudb68c9562013-11-06 23:21:46 +0100888struct ib_uverbs_flow_spec_eth {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100889 union {
890 struct ib_uverbs_flow_spec_hdr hdr;
891 struct {
892 __u32 type;
893 __u16 size;
894 __u16 reserved;
895 };
896 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100897 struct ib_uverbs_flow_eth_filter val;
898 struct ib_uverbs_flow_eth_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300899};
900
Yann Droneaudb68c9562013-11-06 23:21:46 +0100901struct ib_uverbs_flow_ipv4_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300902 __be32 src_ip;
903 __be32 dst_ip;
Maor Gottlieb989a3a82016-08-30 16:58:33 +0300904 __u8 proto;
905 __u8 tos;
906 __u8 ttl;
907 __u8 flags;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300908};
909
Yann Droneaudb68c9562013-11-06 23:21:46 +0100910struct ib_uverbs_flow_spec_ipv4 {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100911 union {
912 struct ib_uverbs_flow_spec_hdr hdr;
913 struct {
914 __u32 type;
915 __u16 size;
916 __u16 reserved;
917 };
918 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100919 struct ib_uverbs_flow_ipv4_filter val;
920 struct ib_uverbs_flow_ipv4_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300921};
922
Yann Droneaudb68c9562013-11-06 23:21:46 +0100923struct ib_uverbs_flow_tcp_udp_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300924 __be16 dst_port;
925 __be16 src_port;
926};
927
Yann Droneaudb68c9562013-11-06 23:21:46 +0100928struct ib_uverbs_flow_spec_tcp_udp {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100929 union {
930 struct ib_uverbs_flow_spec_hdr hdr;
931 struct {
932 __u32 type;
933 __u16 size;
934 __u16 reserved;
935 };
936 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100937 struct ib_uverbs_flow_tcp_udp_filter val;
938 struct ib_uverbs_flow_tcp_udp_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300939};
940
Maor Gottlieb4c2aae72016-06-17 15:14:50 +0300941struct ib_uverbs_flow_ipv6_filter {
Maor Gottlieba72c6a22016-08-30 16:58:34 +0300942 __u8 src_ip[16];
943 __u8 dst_ip[16];
944 __be32 flow_label;
945 __u8 next_hdr;
946 __u8 traffic_class;
947 __u8 hop_limit;
948 __u8 reserved;
Maor Gottlieb4c2aae72016-06-17 15:14:50 +0300949};
950
951struct ib_uverbs_flow_spec_ipv6 {
952 union {
953 struct ib_uverbs_flow_spec_hdr hdr;
954 struct {
955 __u32 type;
956 __u16 size;
957 __u16 reserved;
958 };
959 };
960 struct ib_uverbs_flow_ipv6_filter val;
961 struct ib_uverbs_flow_ipv6_filter mask;
962};
963
Moses Reuben94e03f12017-01-18 14:59:49 +0200964struct ib_uverbs_flow_spec_action_tag {
965 union {
966 struct ib_uverbs_flow_spec_hdr hdr;
967 struct {
968 __u32 type;
969 __u16 size;
970 __u16 reserved;
971 };
972 };
973 __u32 tag_id;
974 __u32 reserved1;
975};
976
Slava Shwartsman483a3962017-04-03 13:13:51 +0300977struct ib_uverbs_flow_spec_action_drop {
978 union {
979 struct ib_uverbs_flow_spec_hdr hdr;
980 struct {
981 __u32 type;
982 __u16 size;
983 __u16 reserved;
984 };
985 };
986};
987
Matan Barak9b828442018-03-28 09:27:46 +0300988struct ib_uverbs_flow_spec_action_handle {
989 union {
990 struct ib_uverbs_flow_spec_hdr hdr;
991 struct {
992 __u32 type;
993 __u16 size;
994 __u16 reserved;
995 };
996 };
997 __u32 handle;
998 __u32 reserved1;
999};
1000
Moses Reubena0cb4c72016-11-14 19:04:49 +02001001struct ib_uverbs_flow_tunnel_filter {
1002 __be32 tunnel_id;
1003};
1004
1005struct ib_uverbs_flow_spec_tunnel {
1006 union {
1007 struct ib_uverbs_flow_spec_hdr hdr;
1008 struct {
1009 __u32 type;
1010 __u16 size;
1011 __u16 reserved;
1012 };
1013 };
1014 struct ib_uverbs_flow_tunnel_filter val;
1015 struct ib_uverbs_flow_tunnel_filter mask;
1016};
1017
Matan Barak56ab0b32018-03-28 09:27:49 +03001018struct ib_uverbs_flow_spec_esp_filter {
1019 __u32 spi;
1020 __u32 seq;
1021};
1022
1023struct ib_uverbs_flow_spec_esp {
1024 union {
1025 struct ib_uverbs_flow_spec_hdr hdr;
1026 struct {
1027 __u32 type;
1028 __u16 size;
1029 __u16 reserved;
1030 };
1031 };
1032 struct ib_uverbs_flow_spec_esp_filter val;
1033 struct ib_uverbs_flow_spec_esp_filter mask;
1034};
1035
Yann Droneaudd82693d2013-11-06 23:21:45 +01001036struct ib_uverbs_flow_attr {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +03001037 __u32 type;
1038 __u16 size;
1039 __u16 priority;
1040 __u8 num_of_specs;
1041 __u8 reserved[2];
1042 __u8 port;
1043 __u32 flags;
1044 /* Following are the optional layers according to user request
1045 * struct ib_flow_spec_xxx
1046 * struct ib_flow_spec_yyy
1047 */
Yann Droneaud58913ef2013-11-06 23:21:47 +01001048 struct ib_uverbs_flow_spec_hdr flow_specs[0];
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +03001049};
1050
1051struct ib_uverbs_create_flow {
1052 __u32 comp_mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +03001053 __u32 qp_handle;
Yann Droneaudd82693d2013-11-06 23:21:45 +01001054 struct ib_uverbs_flow_attr flow_attr;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +03001055};
1056
1057struct ib_uverbs_create_flow_resp {
1058 __u32 comp_mask;
1059 __u32 flow_handle;
1060};
1061
1062struct ib_uverbs_destroy_flow {
1063 __u32 comp_mask;
1064 __u32 flow_handle;
1065};
1066
Roland Dreierf520ba52005-08-18 12:24:13 -07001067struct ib_uverbs_create_srq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001068 __aligned_u64 response;
1069 __aligned_u64 user_handle;
Roland Dreierf520ba52005-08-18 12:24:13 -07001070 __u32 pd_handle;
1071 __u32 max_wr;
1072 __u32 max_sge;
1073 __u32 srq_limit;
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001074 __aligned_u64 driver_data[0];
Roland Dreierf520ba52005-08-18 12:24:13 -07001075};
1076
Sean Hefty8541f8d2011-05-25 17:08:38 -07001077struct ib_uverbs_create_xsrq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001078 __aligned_u64 response;
1079 __aligned_u64 user_handle;
Sean Hefty8541f8d2011-05-25 17:08:38 -07001080 __u32 srq_type;
1081 __u32 pd_handle;
1082 __u32 max_wr;
1083 __u32 max_sge;
1084 __u32 srq_limit;
Artemy Kovalyov9382d4e2017-08-17 15:52:06 +03001085 __u32 max_num_tags;
Sean Hefty8541f8d2011-05-25 17:08:38 -07001086 __u32 xrcd_handle;
1087 __u32 cq_handle;
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001088 __aligned_u64 driver_data[0];
Sean Hefty8541f8d2011-05-25 17:08:38 -07001089};
1090
Roland Dreierf520ba52005-08-18 12:24:13 -07001091struct ib_uverbs_create_srq_resp {
1092 __u32 srq_handle;
Dotan Barakea88fd12006-02-23 12:36:18 -08001093 __u32 max_wr;
1094 __u32 max_sge;
Sean Hefty8541f8d2011-05-25 17:08:38 -07001095 __u32 srqn;
Roland Dreierf520ba52005-08-18 12:24:13 -07001096};
1097
1098struct ib_uverbs_modify_srq {
1099 __u32 srq_handle;
1100 __u32 attr_mask;
1101 __u32 max_wr;
Roland Dreierf520ba52005-08-18 12:24:13 -07001102 __u32 srq_limit;
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001103 __aligned_u64 driver_data[0];
Roland Dreierf520ba52005-08-18 12:24:13 -07001104};
1105
Dotan Barak8bdb0e82006-02-13 16:31:57 -08001106struct ib_uverbs_query_srq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001107 __aligned_u64 response;
Dotan Barak8bdb0e82006-02-13 16:31:57 -08001108 __u32 srq_handle;
1109 __u32 reserved;
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001110 __aligned_u64 driver_data[0];
Dotan Barak8bdb0e82006-02-13 16:31:57 -08001111};
1112
1113struct ib_uverbs_query_srq_resp {
1114 __u32 max_wr;
1115 __u32 max_sge;
1116 __u32 srq_limit;
1117 __u32 reserved;
1118};
1119
Roland Dreierf520ba52005-08-18 12:24:13 -07001120struct ib_uverbs_destroy_srq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001121 __aligned_u64 response;
Roland Dreierf520ba52005-08-18 12:24:13 -07001122 __u32 srq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -07001123 __u32 reserved;
1124};
1125
1126struct ib_uverbs_destroy_srq_resp {
1127 __u32 events_reported;
Roland Dreierf520ba52005-08-18 12:24:13 -07001128};
1129
Yishai Hadasf213c052016-05-23 15:20:49 +03001130struct ib_uverbs_ex_create_wq {
1131 __u32 comp_mask;
1132 __u32 wq_type;
Jason Gunthorpe26b99062018-03-20 14:19:51 -06001133 __aligned_u64 user_handle;
Yishai Hadasf213c052016-05-23 15:20:49 +03001134 __u32 pd_handle;
1135 __u32 cq_handle;
1136 __u32 max_wr;
1137 __u32 max_sge;
Noa Osherovichaf1cb952017-01-18 15:39:59 +02001138 __u32 create_flags; /* Use enum ib_wq_flags */
1139 __u32 reserved;
Yishai Hadasf213c052016-05-23 15:20:49 +03001140};
1141
1142struct ib_uverbs_ex_create_wq_resp {
1143 __u32 comp_mask;
1144 __u32 response_length;
1145 __u32 wq_handle;
1146 __u32 max_wr;
1147 __u32 max_sge;
1148 __u32 wqn;
1149};
1150
1151struct ib_uverbs_ex_destroy_wq {
1152 __u32 comp_mask;
1153 __u32 wq_handle;
1154};
1155
1156struct ib_uverbs_ex_destroy_wq_resp {
1157 __u32 comp_mask;
1158 __u32 response_length;
1159 __u32 events_reported;
1160 __u32 reserved;
1161};
1162
1163struct ib_uverbs_ex_modify_wq {
1164 __u32 attr_mask;
1165 __u32 wq_handle;
1166 __u32 wq_state;
1167 __u32 curr_wq_state;
Noa Osherovichaf1cb952017-01-18 15:39:59 +02001168 __u32 flags; /* Use enum ib_wq_flags */
1169 __u32 flags_mask; /* Use enum ib_wq_flags */
Yishai Hadasf213c052016-05-23 15:20:49 +03001170};
1171
Yishai Hadasde019a92016-05-23 15:20:52 +03001172/* Prevent memory allocation rather than max expected size */
1173#define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1174struct ib_uverbs_ex_create_rwq_ind_table {
1175 __u32 comp_mask;
1176 __u32 log_ind_tbl_size;
1177 /* Following are the wq handles according to log_ind_tbl_size
1178 * wq_handle1
1179 * wq_handle2
1180 */
1181 __u32 wq_handles[0];
1182};
1183
1184struct ib_uverbs_ex_create_rwq_ind_table_resp {
1185 __u32 comp_mask;
1186 __u32 response_length;
1187 __u32 ind_tbl_handle;
1188 __u32 ind_tbl_num;
1189};
1190
1191struct ib_uverbs_ex_destroy_rwq_ind_table {
1192 __u32 comp_mask;
1193 __u32 ind_tbl_handle;
1194};
1195
Yonatan Cohen869ddcf2017-11-13 10:51:13 +02001196struct ib_uverbs_cq_moderation {
1197 __u16 cq_count;
1198 __u16 cq_period;
1199};
1200
1201struct ib_uverbs_ex_modify_cq {
1202 __u32 cq_handle;
1203 __u32 attr_mask;
1204 struct ib_uverbs_cq_moderation attr;
1205 __u32 reserved;
1206};
1207
Nicolas Dichtelea6819e2017-03-27 14:20:14 +02001208#define IB_DEVICE_NAME_MAX 64
1209
Roland Dreier8a96b3f2005-07-07 17:57:12 -07001210#endif /* IB_USER_VERBS_H */