blob: f0f799afd8560c35c2b1838dd074e841c29036a9 [file] [log] [blame]
Roland Dreier8a96b3f2005-07-07 17:57:12 -07001/*
2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
Roland Dreier33b9b3e2006-01-30 14:29:21 -08003 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
Roland Dreier91ecd4a2005-10-14 15:21:44 -07004 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
Dotan Barak8bdb0e82006-02-13 16:31:57 -08005 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
Roland Dreier8a96b3f2005-07-07 17:57:12 -07006 *
7 * This software is available to you under a choice of one of two
8 * licenses. You may choose to be licensed under the terms of the GNU
9 * General Public License (GPL) Version 2, available from the file
10 * COPYING in the main directory of this source tree, or the
11 * OpenIB.org BSD license below:
12 *
13 * Redistribution and use in source and binary forms, with or
14 * without modification, are permitted provided that the following
15 * conditions are met:
16 *
17 * - Redistributions of source code must retain the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer.
20 *
21 * - Redistributions in binary form must reproduce the above
22 * copyright notice, this list of conditions and the following
23 * disclaimer in the documentation and/or other materials
24 * provided with the distribution.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * SOFTWARE.
Roland Dreier8a96b3f2005-07-07 17:57:12 -070034 */
35
36#ifndef IB_USER_VERBS_H
37#define IB_USER_VERBS_H
38
39#include <linux/types.h>
40
41/*
42 * Increment this value if any changes that break userspace ABI
43 * compatibility are made.
44 */
Dotan Barakea88fd12006-02-23 12:36:18 -080045#define IB_USER_VERBS_ABI_VERSION 6
Igor Ivanov400dbc92013-08-14 13:58:29 +030046#define IB_USER_VERBS_CMD_THRESHOLD 50
Roland Dreier8a96b3f2005-07-07 17:57:12 -070047
48enum {
Roland Dreier8a96b3f2005-07-07 17:57:12 -070049 IB_USER_VERBS_CMD_GET_CONTEXT,
50 IB_USER_VERBS_CMD_QUERY_DEVICE,
51 IB_USER_VERBS_CMD_QUERY_PORT,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070052 IB_USER_VERBS_CMD_ALLOC_PD,
53 IB_USER_VERBS_CMD_DEALLOC_PD,
54 IB_USER_VERBS_CMD_CREATE_AH,
55 IB_USER_VERBS_CMD_MODIFY_AH,
56 IB_USER_VERBS_CMD_QUERY_AH,
57 IB_USER_VERBS_CMD_DESTROY_AH,
58 IB_USER_VERBS_CMD_REG_MR,
59 IB_USER_VERBS_CMD_REG_SMR,
60 IB_USER_VERBS_CMD_REREG_MR,
61 IB_USER_VERBS_CMD_QUERY_MR,
62 IB_USER_VERBS_CMD_DEREG_MR,
63 IB_USER_VERBS_CMD_ALLOC_MW,
64 IB_USER_VERBS_CMD_BIND_MW,
65 IB_USER_VERBS_CMD_DEALLOC_MW,
Roland Dreier6b73597e2005-09-26 13:53:25 -070066 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070067 IB_USER_VERBS_CMD_CREATE_CQ,
68 IB_USER_VERBS_CMD_RESIZE_CQ,
69 IB_USER_VERBS_CMD_DESTROY_CQ,
70 IB_USER_VERBS_CMD_POLL_CQ,
71 IB_USER_VERBS_CMD_PEEK_CQ,
72 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
73 IB_USER_VERBS_CMD_CREATE_QP,
74 IB_USER_VERBS_CMD_QUERY_QP,
75 IB_USER_VERBS_CMD_MODIFY_QP,
76 IB_USER_VERBS_CMD_DESTROY_QP,
77 IB_USER_VERBS_CMD_POST_SEND,
78 IB_USER_VERBS_CMD_POST_RECV,
79 IB_USER_VERBS_CMD_ATTACH_MCAST,
Roland Dreierf520ba52005-08-18 12:24:13 -070080 IB_USER_VERBS_CMD_DETACH_MCAST,
81 IB_USER_VERBS_CMD_CREATE_SRQ,
82 IB_USER_VERBS_CMD_MODIFY_SRQ,
83 IB_USER_VERBS_CMD_QUERY_SRQ,
84 IB_USER_VERBS_CMD_DESTROY_SRQ,
Sean Hefty53d0bd12011-05-24 08:33:46 -070085 IB_USER_VERBS_CMD_POST_SRQ_RECV,
86 IB_USER_VERBS_CMD_OPEN_XRCD,
Sean Hefty8541f8d2011-05-25 17:08:38 -070087 IB_USER_VERBS_CMD_CLOSE_XRCD,
Sean Hefty42849b22011-08-11 13:57:43 -070088 IB_USER_VERBS_CMD_CREATE_XSRQ,
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +030089 IB_USER_VERBS_CMD_OPEN_QP,
Roland Dreier8a96b3f2005-07-07 17:57:12 -070090};
91
Yann Droneaudf21519b2013-11-06 23:21:49 +010092enum {
Eli Cohen02d1aa72015-02-08 13:28:50 +020093 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
Yann Droneaudf21519b2013-11-06 23:21:49 +010094 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
Eli Cohen5a77abf2014-12-11 17:04:15 +020095 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
Yann Droneaudf21519b2013-11-06 23:21:49 +010096};
Yann Droneaudf21519b2013-11-06 23:21:49 +010097
Roland Dreier8a96b3f2005-07-07 17:57:12 -070098/*
99 * Make sure that all structs defined in this file remain laid out so
100 * that they pack the same way on 32-bit and 64-bit architectures (to
101 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700102 * Specifically:
103 * - Do not use pointer types -- pass pointers in __u64 instead.
104 * - Make sure that any structure larger than 4 bytes is padded to a
105 * multiple of 8 bytes. Otherwise the structure size will be
106 * different between 32-bit and 64-bit architectures.
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700107 */
108
109struct ib_uverbs_async_event_desc {
110 __u64 element;
111 __u32 event_type; /* enum ib_event_type */
112 __u32 reserved;
113};
114
115struct ib_uverbs_comp_event_desc {
116 __u64 cq_handle;
117};
118
119/*
120 * All commands from userspace should start with a __u32 command field
121 * followed by __u16 in_words and out_words fields (which give the
122 * length of the command block and response buffer if any in 32-bit
123 * words). The kernel driver will read these fields first and read
124 * the rest of the command struct based on these value.
125 */
126
Yann Droneaudf21519b2013-11-06 23:21:49 +0100127#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
128#define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u
129#define IB_USER_VERBS_CMD_FLAGS_SHIFT 24
130
131#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80
132
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700133struct ib_uverbs_cmd_hdr {
134 __u32 command;
135 __u16 in_words;
136 __u16 out_words;
137};
138
Yann Droneaudf21519b2013-11-06 23:21:49 +0100139struct ib_uverbs_ex_cmd_hdr {
140 __u64 response;
Igor Ivanov400dbc92013-08-14 13:58:29 +0300141 __u16 provider_in_words;
142 __u16 provider_out_words;
143 __u32 cmd_hdr_reserved;
144};
145
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700146struct ib_uverbs_get_context {
147 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700148 __u64 driver_data[0];
149};
150
151struct ib_uverbs_get_context_resp {
152 __u32 async_fd;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700153 __u32 num_comp_vectors;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700154};
155
156struct ib_uverbs_query_device {
157 __u64 response;
158 __u64 driver_data[0];
159};
160
161struct ib_uverbs_query_device_resp {
162 __u64 fw_ver;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700163 __be64 node_guid;
164 __be64 sys_image_guid;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700165 __u64 max_mr_size;
166 __u64 page_size_cap;
167 __u32 vendor_id;
168 __u32 vendor_part_id;
169 __u32 hw_ver;
170 __u32 max_qp;
171 __u32 max_qp_wr;
172 __u32 device_cap_flags;
173 __u32 max_sge;
174 __u32 max_sge_rd;
175 __u32 max_cq;
176 __u32 max_cqe;
177 __u32 max_mr;
178 __u32 max_pd;
179 __u32 max_qp_rd_atom;
180 __u32 max_ee_rd_atom;
181 __u32 max_res_rd_atom;
182 __u32 max_qp_init_rd_atom;
183 __u32 max_ee_init_rd_atom;
184 __u32 atomic_cap;
185 __u32 max_ee;
186 __u32 max_rdd;
187 __u32 max_mw;
188 __u32 max_raw_ipv6_qp;
189 __u32 max_raw_ethy_qp;
190 __u32 max_mcast_grp;
191 __u32 max_mcast_qp_attach;
192 __u32 max_total_mcast_qp_attach;
193 __u32 max_ah;
194 __u32 max_fmr;
195 __u32 max_map_per_fmr;
196 __u32 max_srq;
197 __u32 max_srq_wr;
198 __u32 max_srq_sge;
199 __u16 max_pkeys;
200 __u8 local_ca_ack_delay;
201 __u8 phys_port_cnt;
202 __u8 reserved[4];
203};
204
Eli Cohen02d1aa72015-02-08 13:28:50 +0200205struct ib_uverbs_ex_query_device {
206 __u32 comp_mask;
207 __u32 reserved;
208};
209
210struct ib_uverbs_ex_query_device_resp {
211 struct ib_uverbs_query_device_resp base;
212 __u32 comp_mask;
213 __u32 response_length;
214};
215
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700216struct ib_uverbs_query_port {
217 __u64 response;
218 __u8 port_num;
219 __u8 reserved[7];
220 __u64 driver_data[0];
221};
222
223struct ib_uverbs_query_port_resp {
224 __u32 port_cap_flags;
225 __u32 max_msg_sz;
226 __u32 bad_pkey_cntr;
227 __u32 qkey_viol_cntr;
228 __u32 gid_tbl_len;
229 __u16 pkey_tbl_len;
230 __u16 lid;
231 __u16 sm_lid;
232 __u8 state;
233 __u8 max_mtu;
234 __u8 active_mtu;
235 __u8 lmc;
236 __u8 max_vl_num;
237 __u8 sm_sl;
238 __u8 subnet_timeout;
239 __u8 init_type_reply;
240 __u8 active_width;
241 __u8 active_speed;
242 __u8 phys_state;
Eli Cohen2420b602010-10-18 14:45:20 -0700243 __u8 link_layer;
244 __u8 reserved[2];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700245};
246
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700247struct ib_uverbs_alloc_pd {
248 __u64 response;
249 __u64 driver_data[0];
250};
251
252struct ib_uverbs_alloc_pd_resp {
253 __u32 pd_handle;
254};
255
256struct ib_uverbs_dealloc_pd {
257 __u32 pd_handle;
258};
259
Sean Hefty53d0bd12011-05-24 08:33:46 -0700260struct ib_uverbs_open_xrcd {
261 __u64 response;
262 __u32 fd;
263 __u32 oflags;
264 __u64 driver_data[0];
265};
266
267struct ib_uverbs_open_xrcd_resp {
268 __u32 xrcd_handle;
269};
270
271struct ib_uverbs_close_xrcd {
272 __u32 xrcd_handle;
273};
274
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700275struct ib_uverbs_reg_mr {
276 __u64 response;
277 __u64 start;
278 __u64 length;
279 __u64 hca_va;
280 __u32 pd_handle;
281 __u32 access_flags;
282 __u64 driver_data[0];
283};
284
285struct ib_uverbs_reg_mr_resp {
286 __u32 mr_handle;
287 __u32 lkey;
288 __u32 rkey;
289};
290
Matan Barak7e6edb92014-07-31 11:01:28 +0300291struct ib_uverbs_rereg_mr {
292 __u64 response;
293 __u32 mr_handle;
294 __u32 flags;
295 __u64 start;
296 __u64 length;
297 __u64 hca_va;
298 __u32 pd_handle;
299 __u32 access_flags;
300};
301
302struct ib_uverbs_rereg_mr_resp {
303 __u32 lkey;
304 __u32 rkey;
305};
306
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700307struct ib_uverbs_dereg_mr {
308 __u32 mr_handle;
309};
310
Shani Michaeli6b52a122013-02-06 16:19:13 +0000311struct ib_uverbs_alloc_mw {
312 __u64 response;
313 __u32 pd_handle;
314 __u8 mw_type;
315 __u8 reserved[3];
316};
317
318struct ib_uverbs_alloc_mw_resp {
319 __u32 mw_handle;
320 __u32 rkey;
321};
322
323struct ib_uverbs_dealloc_mw {
324 __u32 mw_handle;
325};
326
Roland Dreier6b73597e2005-09-26 13:53:25 -0700327struct ib_uverbs_create_comp_channel {
328 __u64 response;
329};
330
331struct ib_uverbs_create_comp_channel_resp {
332 __u32 fd;
333};
334
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700335struct ib_uverbs_create_cq {
336 __u64 response;
337 __u64 user_handle;
338 __u32 cqe;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700339 __u32 comp_vector;
340 __s32 comp_channel;
341 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700342 __u64 driver_data[0];
343};
344
345struct ib_uverbs_create_cq_resp {
346 __u32 cq_handle;
347 __u32 cqe;
348};
349
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800350struct ib_uverbs_resize_cq {
351 __u64 response;
352 __u32 cq_handle;
353 __u32 cqe;
354 __u64 driver_data[0];
355};
356
357struct ib_uverbs_resize_cq_resp {
358 __u32 cqe;
Ralph Campbell64f817b2006-09-22 15:22:24 -0700359 __u32 reserved;
360 __u64 driver_data[0];
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800361};
362
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700363struct ib_uverbs_poll_cq {
364 __u64 response;
365 __u32 cq_handle;
366 __u32 ne;
367};
368
369struct ib_uverbs_wc {
370 __u64 wr_id;
371 __u32 status;
372 __u32 opcode;
373 __u32 vendor_err;
374 __u32 byte_len;
Steve Wise00f7ec32008-07-14 23:48:45 -0700375 union {
376 __u32 imm_data;
377 __u32 invalidate_rkey;
378 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700379 __u32 qp_num;
380 __u32 src_qp;
381 __u32 wc_flags;
382 __u16 pkey_index;
383 __u16 slid;
384 __u8 sl;
385 __u8 dlid_path_bits;
386 __u8 port_num;
387 __u8 reserved;
388};
389
390struct ib_uverbs_poll_cq_resp {
391 __u32 count;
392 __u32 reserved;
393 struct ib_uverbs_wc wc[0];
394};
395
396struct ib_uverbs_req_notify_cq {
397 __u32 cq_handle;
398 __u32 solicited_only;
399};
400
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700401struct ib_uverbs_destroy_cq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700402 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700403 __u32 cq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700404 __u32 reserved;
405};
406
407struct ib_uverbs_destroy_cq_resp {
408 __u32 comp_events_reported;
409 __u32 async_events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700410};
411
Sean Hefty6a9af2e2006-06-17 20:37:27 -0700412struct ib_uverbs_global_route {
413 __u8 dgid[16];
414 __u32 flow_label;
415 __u8 sgid_index;
416 __u8 hop_limit;
417 __u8 traffic_class;
418 __u8 reserved;
419};
420
421struct ib_uverbs_ah_attr {
422 struct ib_uverbs_global_route grh;
423 __u16 dlid;
424 __u8 sl;
425 __u8 src_path_bits;
426 __u8 static_rate;
427 __u8 is_global;
428 __u8 port_num;
429 __u8 reserved;
430};
431
432struct ib_uverbs_qp_attr {
433 __u32 qp_attr_mask;
434 __u32 qp_state;
435 __u32 cur_qp_state;
436 __u32 path_mtu;
437 __u32 path_mig_state;
438 __u32 qkey;
439 __u32 rq_psn;
440 __u32 sq_psn;
441 __u32 dest_qp_num;
442 __u32 qp_access_flags;
443
444 struct ib_uverbs_ah_attr ah_attr;
445 struct ib_uverbs_ah_attr alt_ah_attr;
446
447 /* ib_qp_cap */
448 __u32 max_send_wr;
449 __u32 max_recv_wr;
450 __u32 max_send_sge;
451 __u32 max_recv_sge;
452 __u32 max_inline_data;
453
454 __u16 pkey_index;
455 __u16 alt_pkey_index;
456 __u8 en_sqd_async_notify;
457 __u8 sq_draining;
458 __u8 max_rd_atomic;
459 __u8 max_dest_rd_atomic;
460 __u8 min_rnr_timer;
461 __u8 port_num;
462 __u8 timeout;
463 __u8 retry_cnt;
464 __u8 rnr_retry;
465 __u8 alt_port_num;
466 __u8 alt_timeout;
467 __u8 reserved[5];
468};
469
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700470struct ib_uverbs_create_qp {
471 __u64 response;
472 __u64 user_handle;
473 __u32 pd_handle;
474 __u32 send_cq_handle;
475 __u32 recv_cq_handle;
476 __u32 srq_handle;
477 __u32 max_send_wr;
478 __u32 max_recv_wr;
479 __u32 max_send_sge;
480 __u32 max_recv_sge;
481 __u32 max_inline_data;
482 __u8 sq_sig_all;
483 __u8 qp_type;
484 __u8 is_srq;
485 __u8 reserved;
486 __u64 driver_data[0];
487};
488
Sean Hefty42849b22011-08-11 13:57:43 -0700489struct ib_uverbs_open_qp {
490 __u64 response;
491 __u64 user_handle;
492 __u32 pd_handle;
493 __u32 qpn;
494 __u8 qp_type;
495 __u8 reserved[7];
496 __u64 driver_data[0];
497};
498
499/* also used for open response */
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700500struct ib_uverbs_create_qp_resp {
501 __u32 qp_handle;
502 __u32 qpn;
Jack Morgenstein77369ed2005-11-09 11:26:07 -0800503 __u32 max_send_wr;
504 __u32 max_recv_wr;
505 __u32 max_send_sge;
506 __u32 max_recv_sge;
507 __u32 max_inline_data;
Roland Dreier4d9781c2006-02-16 09:26:19 -0800508 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700509};
510
511/*
512 * This struct needs to remain a multiple of 8 bytes to keep the
513 * alignment of the modify QP parameters.
514 */
515struct ib_uverbs_qp_dest {
516 __u8 dgid[16];
517 __u32 flow_label;
518 __u16 dlid;
519 __u16 reserved;
520 __u8 sgid_index;
521 __u8 hop_limit;
522 __u8 traffic_class;
523 __u8 sl;
524 __u8 src_path_bits;
525 __u8 static_rate;
526 __u8 is_global;
527 __u8 port_num;
528};
529
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800530struct ib_uverbs_query_qp {
531 __u64 response;
532 __u32 qp_handle;
533 __u32 attr_mask;
534 __u64 driver_data[0];
535};
536
537struct ib_uverbs_query_qp_resp {
538 struct ib_uverbs_qp_dest dest;
539 struct ib_uverbs_qp_dest alt_dest;
540 __u32 max_send_wr;
541 __u32 max_recv_wr;
542 __u32 max_send_sge;
543 __u32 max_recv_sge;
544 __u32 max_inline_data;
545 __u32 qkey;
546 __u32 rq_psn;
547 __u32 sq_psn;
548 __u32 dest_qp_num;
549 __u32 qp_access_flags;
550 __u16 pkey_index;
551 __u16 alt_pkey_index;
552 __u8 qp_state;
553 __u8 cur_qp_state;
554 __u8 path_mtu;
555 __u8 path_mig_state;
Jack Morgenstein0b26c882006-10-25 12:54:20 +0200556 __u8 sq_draining;
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800557 __u8 max_rd_atomic;
558 __u8 max_dest_rd_atomic;
559 __u8 min_rnr_timer;
560 __u8 port_num;
561 __u8 timeout;
562 __u8 retry_cnt;
563 __u8 rnr_retry;
564 __u8 alt_port_num;
565 __u8 alt_timeout;
566 __u8 sq_sig_all;
567 __u8 reserved[5];
568 __u64 driver_data[0];
569};
570
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700571struct ib_uverbs_modify_qp {
572 struct ib_uverbs_qp_dest dest;
573 struct ib_uverbs_qp_dest alt_dest;
574 __u32 qp_handle;
575 __u32 attr_mask;
576 __u32 qkey;
577 __u32 rq_psn;
578 __u32 sq_psn;
579 __u32 dest_qp_num;
580 __u32 qp_access_flags;
581 __u16 pkey_index;
582 __u16 alt_pkey_index;
583 __u8 qp_state;
584 __u8 cur_qp_state;
585 __u8 path_mtu;
586 __u8 path_mig_state;
587 __u8 en_sqd_async_notify;
588 __u8 max_rd_atomic;
589 __u8 max_dest_rd_atomic;
590 __u8 min_rnr_timer;
591 __u8 port_num;
592 __u8 timeout;
593 __u8 retry_cnt;
594 __u8 rnr_retry;
595 __u8 alt_port_num;
596 __u8 alt_timeout;
597 __u8 reserved[2];
598 __u64 driver_data[0];
599};
600
601struct ib_uverbs_modify_qp_resp {
602};
603
604struct ib_uverbs_destroy_qp {
Roland Dreier63aaf642005-09-09 15:55:08 -0700605 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700606 __u32 qp_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700607 __u32 reserved;
608};
609
610struct ib_uverbs_destroy_qp_resp {
611 __u32 events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700612};
613
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700614/*
615 * The ib_uverbs_sge structure isn't used anywhere, since we assume
616 * the ib_sge structure is packed the same way on 32-bit and 64-bit
617 * architectures in both kernel and user space. It's just here to
618 * document the ABI.
619 */
620struct ib_uverbs_sge {
621 __u64 addr;
622 __u32 length;
623 __u32 lkey;
624};
625
626struct ib_uverbs_send_wr {
Roland Dreiera74cd4a2006-02-13 16:30:49 -0800627 __u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700628 __u32 num_sge;
629 __u32 opcode;
630 __u32 send_flags;
Roland Dreier0f39cf32008-04-16 21:09:32 -0700631 union {
632 __u32 imm_data;
633 __u32 invalidate_rkey;
634 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700635 union {
636 struct {
637 __u64 remote_addr;
638 __u32 rkey;
639 __u32 reserved;
640 } rdma;
641 struct {
642 __u64 remote_addr;
643 __u64 compare_add;
644 __u64 swap;
645 __u32 rkey;
646 __u32 reserved;
647 } atomic;
648 struct {
649 __u32 ah;
650 __u32 remote_qpn;
651 __u32 remote_qkey;
652 __u32 reserved;
653 } ud;
654 } wr;
655};
656
657struct ib_uverbs_post_send {
658 __u64 response;
659 __u32 qp_handle;
660 __u32 wr_count;
661 __u32 sge_count;
662 __u32 wqe_size;
663 struct ib_uverbs_send_wr send_wr[0];
664};
665
666struct ib_uverbs_post_send_resp {
667 __u32 bad_wr;
668};
669
670struct ib_uverbs_recv_wr {
671 __u64 wr_id;
672 __u32 num_sge;
673 __u32 reserved;
674};
675
676struct ib_uverbs_post_recv {
677 __u64 response;
678 __u32 qp_handle;
679 __u32 wr_count;
680 __u32 sge_count;
681 __u32 wqe_size;
682 struct ib_uverbs_recv_wr recv_wr[0];
683};
684
685struct ib_uverbs_post_recv_resp {
686 __u32 bad_wr;
687};
688
689struct ib_uverbs_post_srq_recv {
690 __u64 response;
691 __u32 srq_handle;
692 __u32 wr_count;
693 __u32 sge_count;
694 __u32 wqe_size;
695 struct ib_uverbs_recv_wr recv[0];
696};
697
698struct ib_uverbs_post_srq_recv_resp {
699 __u32 bad_wr;
700};
701
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700702struct ib_uverbs_create_ah {
703 __u64 response;
704 __u64 user_handle;
705 __u32 pd_handle;
706 __u32 reserved;
707 struct ib_uverbs_ah_attr attr;
708};
709
710struct ib_uverbs_create_ah_resp {
711 __u32 ah_handle;
712};
713
714struct ib_uverbs_destroy_ah {
715 __u32 ah_handle;
716};
717
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700718struct ib_uverbs_attach_mcast {
719 __u8 gid[16];
720 __u32 qp_handle;
721 __u16 mlid;
722 __u16 reserved;
723 __u64 driver_data[0];
724};
725
726struct ib_uverbs_detach_mcast {
727 __u8 gid[16];
728 __u32 qp_handle;
729 __u16 mlid;
730 __u16 reserved;
731 __u64 driver_data[0];
732};
733
Yann Droneaud58913ef2013-11-06 23:21:47 +0100734struct ib_uverbs_flow_spec_hdr {
735 __u32 type;
736 __u16 size;
737 __u16 reserved;
738 /* followed by flow_spec */
739 __u64 flow_spec_data[0];
740};
741
Yann Droneaudb68c9562013-11-06 23:21:46 +0100742struct ib_uverbs_flow_eth_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300743 __u8 dst_mac[6];
744 __u8 src_mac[6];
745 __be16 ether_type;
746 __be16 vlan_tag;
747};
748
Yann Droneaudb68c9562013-11-06 23:21:46 +0100749struct ib_uverbs_flow_spec_eth {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100750 union {
751 struct ib_uverbs_flow_spec_hdr hdr;
752 struct {
753 __u32 type;
754 __u16 size;
755 __u16 reserved;
756 };
757 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100758 struct ib_uverbs_flow_eth_filter val;
759 struct ib_uverbs_flow_eth_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300760};
761
Yann Droneaudb68c9562013-11-06 23:21:46 +0100762struct ib_uverbs_flow_ipv4_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300763 __be32 src_ip;
764 __be32 dst_ip;
765};
766
Yann Droneaudb68c9562013-11-06 23:21:46 +0100767struct ib_uverbs_flow_spec_ipv4 {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100768 union {
769 struct ib_uverbs_flow_spec_hdr hdr;
770 struct {
771 __u32 type;
772 __u16 size;
773 __u16 reserved;
774 };
775 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100776 struct ib_uverbs_flow_ipv4_filter val;
777 struct ib_uverbs_flow_ipv4_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300778};
779
Yann Droneaudb68c9562013-11-06 23:21:46 +0100780struct ib_uverbs_flow_tcp_udp_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300781 __be16 dst_port;
782 __be16 src_port;
783};
784
Yann Droneaudb68c9562013-11-06 23:21:46 +0100785struct ib_uverbs_flow_spec_tcp_udp {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100786 union {
787 struct ib_uverbs_flow_spec_hdr hdr;
788 struct {
789 __u32 type;
790 __u16 size;
791 __u16 reserved;
792 };
793 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100794 struct ib_uverbs_flow_tcp_udp_filter val;
795 struct ib_uverbs_flow_tcp_udp_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300796};
797
Yann Droneaudd82693d2013-11-06 23:21:45 +0100798struct ib_uverbs_flow_attr {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300799 __u32 type;
800 __u16 size;
801 __u16 priority;
802 __u8 num_of_specs;
803 __u8 reserved[2];
804 __u8 port;
805 __u32 flags;
806 /* Following are the optional layers according to user request
807 * struct ib_flow_spec_xxx
808 * struct ib_flow_spec_yyy
809 */
Yann Droneaud58913ef2013-11-06 23:21:47 +0100810 struct ib_uverbs_flow_spec_hdr flow_specs[0];
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300811};
812
813struct ib_uverbs_create_flow {
814 __u32 comp_mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300815 __u32 qp_handle;
Yann Droneaudd82693d2013-11-06 23:21:45 +0100816 struct ib_uverbs_flow_attr flow_attr;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300817};
818
819struct ib_uverbs_create_flow_resp {
820 __u32 comp_mask;
821 __u32 flow_handle;
822};
823
824struct ib_uverbs_destroy_flow {
825 __u32 comp_mask;
826 __u32 flow_handle;
827};
828
Roland Dreierf520ba52005-08-18 12:24:13 -0700829struct ib_uverbs_create_srq {
830 __u64 response;
831 __u64 user_handle;
832 __u32 pd_handle;
833 __u32 max_wr;
834 __u32 max_sge;
835 __u32 srq_limit;
836 __u64 driver_data[0];
837};
838
Sean Hefty8541f8d2011-05-25 17:08:38 -0700839struct ib_uverbs_create_xsrq {
840 __u64 response;
841 __u64 user_handle;
842 __u32 srq_type;
843 __u32 pd_handle;
844 __u32 max_wr;
845 __u32 max_sge;
846 __u32 srq_limit;
847 __u32 reserved;
848 __u32 xrcd_handle;
849 __u32 cq_handle;
850 __u64 driver_data[0];
851};
852
Roland Dreierf520ba52005-08-18 12:24:13 -0700853struct ib_uverbs_create_srq_resp {
854 __u32 srq_handle;
Dotan Barakea88fd12006-02-23 12:36:18 -0800855 __u32 max_wr;
856 __u32 max_sge;
Sean Hefty8541f8d2011-05-25 17:08:38 -0700857 __u32 srqn;
Roland Dreierf520ba52005-08-18 12:24:13 -0700858};
859
860struct ib_uverbs_modify_srq {
861 __u32 srq_handle;
862 __u32 attr_mask;
863 __u32 max_wr;
Roland Dreierf520ba52005-08-18 12:24:13 -0700864 __u32 srq_limit;
Roland Dreierf520ba52005-08-18 12:24:13 -0700865 __u64 driver_data[0];
866};
867
Dotan Barak8bdb0e82006-02-13 16:31:57 -0800868struct ib_uverbs_query_srq {
869 __u64 response;
870 __u32 srq_handle;
871 __u32 reserved;
872 __u64 driver_data[0];
873};
874
875struct ib_uverbs_query_srq_resp {
876 __u32 max_wr;
877 __u32 max_sge;
878 __u32 srq_limit;
879 __u32 reserved;
880};
881
Roland Dreierf520ba52005-08-18 12:24:13 -0700882struct ib_uverbs_destroy_srq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700883 __u64 response;
Roland Dreierf520ba52005-08-18 12:24:13 -0700884 __u32 srq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700885 __u32 reserved;
886};
887
888struct ib_uverbs_destroy_srq_resp {
889 __u32 events_reported;
Roland Dreierf520ba52005-08-18 12:24:13 -0700890};
891
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700892#endif /* IB_USER_VERBS_H */