blob: f4f87cff6dc6c5fc9f1a91e32c9e8d3a601f10c8 [file] [log] [blame]
Ben Cheng224b54f2013-10-15 18:26:18 -07001/*
2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
4 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
5 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
6 *
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.
34 */
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 */
45#define IB_USER_VERBS_ABI_VERSION 6
Christopher Ferrise0845012014-07-09 14:58:51 -070046#define IB_USER_VERBS_CMD_THRESHOLD 50
Ben Cheng224b54f2013-10-15 18:26:18 -070047
48enum {
49 IB_USER_VERBS_CMD_GET_CONTEXT,
50 IB_USER_VERBS_CMD_QUERY_DEVICE,
51 IB_USER_VERBS_CMD_QUERY_PORT,
52 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,
66 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
67 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,
80 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,
85 IB_USER_VERBS_CMD_POST_SRQ_RECV,
86 IB_USER_VERBS_CMD_OPEN_XRCD,
87 IB_USER_VERBS_CMD_CLOSE_XRCD,
88 IB_USER_VERBS_CMD_CREATE_XSRQ,
Christopher Ferrise0845012014-07-09 14:58:51 -070089 IB_USER_VERBS_CMD_OPEN_QP,
90};
91
92enum {
Christopher Ferris12e1f282016-02-04 12:35:07 -080093 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
94 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
95 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -080096 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
Christopher Ferrise0845012014-07-09 14:58:51 -070097 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
Christopher Ferris12e1f282016-02-04 12:35:07 -080098 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
Christopher Ferris6e3550f2016-12-12 14:51:18 -080099 IB_USER_VERBS_EX_CMD_CREATE_WQ,
100 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
101 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
102 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
103 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL
Ben Cheng224b54f2013-10-15 18:26:18 -0700104};
105
106/*
107 * Make sure that all structs defined in this file remain laid out so
108 * that they pack the same way on 32-bit and 64-bit architectures (to
109 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
110 * Specifically:
111 * - Do not use pointer types -- pass pointers in __u64 instead.
112 * - Make sure that any structure larger than 4 bytes is padded to a
113 * multiple of 8 bytes. Otherwise the structure size will be
114 * different between 32-bit and 64-bit architectures.
115 */
116
117struct ib_uverbs_async_event_desc {
118 __u64 element;
119 __u32 event_type; /* enum ib_event_type */
120 __u32 reserved;
121};
122
123struct ib_uverbs_comp_event_desc {
124 __u64 cq_handle;
125};
126
127/*
128 * All commands from userspace should start with a __u32 command field
129 * followed by __u16 in_words and out_words fields (which give the
130 * length of the command block and response buffer if any in 32-bit
131 * words). The kernel driver will read these fields first and read
132 * the rest of the command struct based on these value.
133 */
134
Christopher Ferrise0845012014-07-09 14:58:51 -0700135#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
136#define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u
137#define IB_USER_VERBS_CMD_FLAGS_SHIFT 24
138
139#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80
140
Ben Cheng224b54f2013-10-15 18:26:18 -0700141struct ib_uverbs_cmd_hdr {
142 __u32 command;
143 __u16 in_words;
144 __u16 out_words;
145};
146
Christopher Ferrise0845012014-07-09 14:58:51 -0700147struct ib_uverbs_ex_cmd_hdr {
148 __u64 response;
149 __u16 provider_in_words;
150 __u16 provider_out_words;
151 __u32 cmd_hdr_reserved;
152};
153
Ben Cheng224b54f2013-10-15 18:26:18 -0700154struct ib_uverbs_get_context {
155 __u64 response;
156 __u64 driver_data[0];
157};
158
159struct ib_uverbs_get_context_resp {
160 __u32 async_fd;
161 __u32 num_comp_vectors;
162};
163
164struct ib_uverbs_query_device {
165 __u64 response;
166 __u64 driver_data[0];
167};
168
169struct ib_uverbs_query_device_resp {
170 __u64 fw_ver;
171 __be64 node_guid;
172 __be64 sys_image_guid;
173 __u64 max_mr_size;
174 __u64 page_size_cap;
175 __u32 vendor_id;
176 __u32 vendor_part_id;
177 __u32 hw_ver;
178 __u32 max_qp;
179 __u32 max_qp_wr;
180 __u32 device_cap_flags;
181 __u32 max_sge;
182 __u32 max_sge_rd;
183 __u32 max_cq;
184 __u32 max_cqe;
185 __u32 max_mr;
186 __u32 max_pd;
187 __u32 max_qp_rd_atom;
188 __u32 max_ee_rd_atom;
189 __u32 max_res_rd_atom;
190 __u32 max_qp_init_rd_atom;
191 __u32 max_ee_init_rd_atom;
192 __u32 atomic_cap;
193 __u32 max_ee;
194 __u32 max_rdd;
195 __u32 max_mw;
196 __u32 max_raw_ipv6_qp;
197 __u32 max_raw_ethy_qp;
198 __u32 max_mcast_grp;
199 __u32 max_mcast_qp_attach;
200 __u32 max_total_mcast_qp_attach;
201 __u32 max_ah;
202 __u32 max_fmr;
203 __u32 max_map_per_fmr;
204 __u32 max_srq;
205 __u32 max_srq_wr;
206 __u32 max_srq_sge;
207 __u16 max_pkeys;
208 __u8 local_ca_ack_delay;
209 __u8 phys_port_cnt;
210 __u8 reserved[4];
211};
212
Christopher Ferris12e1f282016-02-04 12:35:07 -0800213struct ib_uverbs_ex_query_device {
214 __u32 comp_mask;
215 __u32 reserved;
216};
217
218struct ib_uverbs_odp_caps {
219 __u64 general_caps;
220 struct {
221 __u32 rc_odp_caps;
222 __u32 uc_odp_caps;
223 __u32 ud_odp_caps;
224 } per_transport_caps;
225 __u32 reserved;
226};
227
Christopher Ferris33185402017-01-13 13:28:52 -0800228struct ib_uverbs_rss_caps {
229 /* Corresponding bit will be set if qp type from
230 * 'enum ib_qp_type' is supported, e.g.
231 * supported_qpts |= 1 << IB_QPT_UD
232 */
233 __u32 supported_qpts;
234 __u32 max_rwq_indirection_tables;
235 __u32 max_rwq_indirection_table_size;
236 __u32 reserved;
237};
238
Christopher Ferris12e1f282016-02-04 12:35:07 -0800239struct ib_uverbs_ex_query_device_resp {
240 struct ib_uverbs_query_device_resp base;
241 __u32 comp_mask;
242 __u32 response_length;
243 struct ib_uverbs_odp_caps odp_caps;
244 __u64 timestamp_mask;
245 __u64 hca_core_clock; /* in KHZ */
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700246 __u64 device_cap_flags_ex;
Christopher Ferris33185402017-01-13 13:28:52 -0800247 struct ib_uverbs_rss_caps rss_caps;
248 __u32 max_wq_type_rq;
249 __u32 reserved;
Christopher Ferris12e1f282016-02-04 12:35:07 -0800250};
251
Ben Cheng224b54f2013-10-15 18:26:18 -0700252struct ib_uverbs_query_port {
253 __u64 response;
254 __u8 port_num;
255 __u8 reserved[7];
256 __u64 driver_data[0];
257};
258
259struct ib_uverbs_query_port_resp {
260 __u32 port_cap_flags;
261 __u32 max_msg_sz;
262 __u32 bad_pkey_cntr;
263 __u32 qkey_viol_cntr;
264 __u32 gid_tbl_len;
265 __u16 pkey_tbl_len;
266 __u16 lid;
267 __u16 sm_lid;
268 __u8 state;
269 __u8 max_mtu;
270 __u8 active_mtu;
271 __u8 lmc;
272 __u8 max_vl_num;
273 __u8 sm_sl;
274 __u8 subnet_timeout;
275 __u8 init_type_reply;
276 __u8 active_width;
277 __u8 active_speed;
278 __u8 phys_state;
279 __u8 link_layer;
280 __u8 reserved[2];
281};
282
283struct ib_uverbs_alloc_pd {
284 __u64 response;
285 __u64 driver_data[0];
286};
287
288struct ib_uverbs_alloc_pd_resp {
289 __u32 pd_handle;
290};
291
292struct ib_uverbs_dealloc_pd {
293 __u32 pd_handle;
294};
295
296struct ib_uverbs_open_xrcd {
297 __u64 response;
298 __u32 fd;
299 __u32 oflags;
300 __u64 driver_data[0];
301};
302
303struct ib_uverbs_open_xrcd_resp {
304 __u32 xrcd_handle;
305};
306
307struct ib_uverbs_close_xrcd {
308 __u32 xrcd_handle;
309};
310
311struct ib_uverbs_reg_mr {
312 __u64 response;
313 __u64 start;
314 __u64 length;
315 __u64 hca_va;
316 __u32 pd_handle;
317 __u32 access_flags;
318 __u64 driver_data[0];
319};
320
321struct ib_uverbs_reg_mr_resp {
322 __u32 mr_handle;
323 __u32 lkey;
324 __u32 rkey;
325};
326
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800327struct ib_uverbs_rereg_mr {
328 __u64 response;
329 __u32 mr_handle;
330 __u32 flags;
331 __u64 start;
332 __u64 length;
333 __u64 hca_va;
334 __u32 pd_handle;
335 __u32 access_flags;
336};
337
338struct ib_uverbs_rereg_mr_resp {
339 __u32 lkey;
340 __u32 rkey;
341};
342
Ben Cheng224b54f2013-10-15 18:26:18 -0700343struct ib_uverbs_dereg_mr {
344 __u32 mr_handle;
345};
346
347struct ib_uverbs_alloc_mw {
348 __u64 response;
349 __u32 pd_handle;
350 __u8 mw_type;
351 __u8 reserved[3];
352};
353
354struct ib_uverbs_alloc_mw_resp {
355 __u32 mw_handle;
356 __u32 rkey;
357};
358
359struct ib_uverbs_dealloc_mw {
360 __u32 mw_handle;
361};
362
363struct ib_uverbs_create_comp_channel {
364 __u64 response;
365};
366
367struct ib_uverbs_create_comp_channel_resp {
368 __u32 fd;
369};
370
371struct ib_uverbs_create_cq {
372 __u64 response;
373 __u64 user_handle;
374 __u32 cqe;
375 __u32 comp_vector;
376 __s32 comp_channel;
377 __u32 reserved;
378 __u64 driver_data[0];
379};
380
Christopher Ferris12e1f282016-02-04 12:35:07 -0800381struct ib_uverbs_ex_create_cq {
382 __u64 user_handle;
383 __u32 cqe;
384 __u32 comp_vector;
385 __s32 comp_channel;
386 __u32 comp_mask;
387 __u32 flags;
388 __u32 reserved;
389};
390
Ben Cheng224b54f2013-10-15 18:26:18 -0700391struct ib_uverbs_create_cq_resp {
392 __u32 cq_handle;
393 __u32 cqe;
394};
395
Christopher Ferris12e1f282016-02-04 12:35:07 -0800396struct ib_uverbs_ex_create_cq_resp {
397 struct ib_uverbs_create_cq_resp base;
398 __u32 comp_mask;
399 __u32 response_length;
400};
401
Ben Cheng224b54f2013-10-15 18:26:18 -0700402struct ib_uverbs_resize_cq {
403 __u64 response;
404 __u32 cq_handle;
405 __u32 cqe;
406 __u64 driver_data[0];
407};
408
409struct ib_uverbs_resize_cq_resp {
410 __u32 cqe;
411 __u32 reserved;
412 __u64 driver_data[0];
413};
414
415struct ib_uverbs_poll_cq {
416 __u64 response;
417 __u32 cq_handle;
418 __u32 ne;
419};
420
421struct ib_uverbs_wc {
422 __u64 wr_id;
423 __u32 status;
424 __u32 opcode;
425 __u32 vendor_err;
426 __u32 byte_len;
427 union {
428 __u32 imm_data;
429 __u32 invalidate_rkey;
430 } ex;
431 __u32 qp_num;
432 __u32 src_qp;
433 __u32 wc_flags;
434 __u16 pkey_index;
435 __u16 slid;
436 __u8 sl;
437 __u8 dlid_path_bits;
438 __u8 port_num;
439 __u8 reserved;
440};
441
442struct ib_uverbs_poll_cq_resp {
443 __u32 count;
444 __u32 reserved;
445 struct ib_uverbs_wc wc[0];
446};
447
448struct ib_uverbs_req_notify_cq {
449 __u32 cq_handle;
450 __u32 solicited_only;
451};
452
453struct ib_uverbs_destroy_cq {
454 __u64 response;
455 __u32 cq_handle;
456 __u32 reserved;
457};
458
459struct ib_uverbs_destroy_cq_resp {
460 __u32 comp_events_reported;
461 __u32 async_events_reported;
462};
463
464struct ib_uverbs_global_route {
465 __u8 dgid[16];
466 __u32 flow_label;
467 __u8 sgid_index;
468 __u8 hop_limit;
469 __u8 traffic_class;
470 __u8 reserved;
471};
472
473struct ib_uverbs_ah_attr {
474 struct ib_uverbs_global_route grh;
475 __u16 dlid;
476 __u8 sl;
477 __u8 src_path_bits;
478 __u8 static_rate;
479 __u8 is_global;
480 __u8 port_num;
481 __u8 reserved;
482};
483
484struct ib_uverbs_qp_attr {
485 __u32 qp_attr_mask;
486 __u32 qp_state;
487 __u32 cur_qp_state;
488 __u32 path_mtu;
489 __u32 path_mig_state;
490 __u32 qkey;
491 __u32 rq_psn;
492 __u32 sq_psn;
493 __u32 dest_qp_num;
494 __u32 qp_access_flags;
495
496 struct ib_uverbs_ah_attr ah_attr;
497 struct ib_uverbs_ah_attr alt_ah_attr;
498
499 /* ib_qp_cap */
500 __u32 max_send_wr;
501 __u32 max_recv_wr;
502 __u32 max_send_sge;
503 __u32 max_recv_sge;
504 __u32 max_inline_data;
505
506 __u16 pkey_index;
507 __u16 alt_pkey_index;
508 __u8 en_sqd_async_notify;
509 __u8 sq_draining;
510 __u8 max_rd_atomic;
511 __u8 max_dest_rd_atomic;
512 __u8 min_rnr_timer;
513 __u8 port_num;
514 __u8 timeout;
515 __u8 retry_cnt;
516 __u8 rnr_retry;
517 __u8 alt_port_num;
518 __u8 alt_timeout;
519 __u8 reserved[5];
520};
521
522struct ib_uverbs_create_qp {
523 __u64 response;
524 __u64 user_handle;
525 __u32 pd_handle;
526 __u32 send_cq_handle;
527 __u32 recv_cq_handle;
528 __u32 srq_handle;
529 __u32 max_send_wr;
530 __u32 max_recv_wr;
531 __u32 max_send_sge;
532 __u32 max_recv_sge;
533 __u32 max_inline_data;
534 __u8 sq_sig_all;
535 __u8 qp_type;
536 __u8 is_srq;
537 __u8 reserved;
538 __u64 driver_data[0];
539};
540
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800541enum ib_uverbs_create_qp_mask {
542 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
543};
544
545enum {
546 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
547};
548
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800549enum {
550 /*
551 * This value is equal to IB_QP_DEST_QPN.
552 */
553 IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
554};
555
556enum {
557 /*
558 * This value is equal to IB_QP_RATE_LIMIT.
559 */
560 IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
561};
562
Christopher Ferris12e1f282016-02-04 12:35:07 -0800563struct ib_uverbs_ex_create_qp {
564 __u64 user_handle;
565 __u32 pd_handle;
566 __u32 send_cq_handle;
567 __u32 recv_cq_handle;
568 __u32 srq_handle;
569 __u32 max_send_wr;
570 __u32 max_recv_wr;
571 __u32 max_send_sge;
572 __u32 max_recv_sge;
573 __u32 max_inline_data;
574 __u8 sq_sig_all;
575 __u8 qp_type;
576 __u8 is_srq;
577 __u8 reserved;
578 __u32 comp_mask;
579 __u32 create_flags;
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800580 __u32 rwq_ind_tbl_handle;
581 __u32 reserved1;
Christopher Ferris12e1f282016-02-04 12:35:07 -0800582};
583
Ben Cheng224b54f2013-10-15 18:26:18 -0700584struct ib_uverbs_open_qp {
585 __u64 response;
586 __u64 user_handle;
587 __u32 pd_handle;
588 __u32 qpn;
589 __u8 qp_type;
590 __u8 reserved[7];
591 __u64 driver_data[0];
592};
593
594/* also used for open response */
595struct ib_uverbs_create_qp_resp {
596 __u32 qp_handle;
597 __u32 qpn;
598 __u32 max_send_wr;
599 __u32 max_recv_wr;
600 __u32 max_send_sge;
601 __u32 max_recv_sge;
602 __u32 max_inline_data;
603 __u32 reserved;
604};
605
Christopher Ferris12e1f282016-02-04 12:35:07 -0800606struct ib_uverbs_ex_create_qp_resp {
607 struct ib_uverbs_create_qp_resp base;
608 __u32 comp_mask;
609 __u32 response_length;
610};
611
Ben Cheng224b54f2013-10-15 18:26:18 -0700612/*
613 * This struct needs to remain a multiple of 8 bytes to keep the
614 * alignment of the modify QP parameters.
615 */
616struct ib_uverbs_qp_dest {
617 __u8 dgid[16];
618 __u32 flow_label;
619 __u16 dlid;
620 __u16 reserved;
621 __u8 sgid_index;
622 __u8 hop_limit;
623 __u8 traffic_class;
624 __u8 sl;
625 __u8 src_path_bits;
626 __u8 static_rate;
627 __u8 is_global;
628 __u8 port_num;
629};
630
631struct ib_uverbs_query_qp {
632 __u64 response;
633 __u32 qp_handle;
634 __u32 attr_mask;
635 __u64 driver_data[0];
636};
637
638struct ib_uverbs_query_qp_resp {
639 struct ib_uverbs_qp_dest dest;
640 struct ib_uverbs_qp_dest alt_dest;
641 __u32 max_send_wr;
642 __u32 max_recv_wr;
643 __u32 max_send_sge;
644 __u32 max_recv_sge;
645 __u32 max_inline_data;
646 __u32 qkey;
647 __u32 rq_psn;
648 __u32 sq_psn;
649 __u32 dest_qp_num;
650 __u32 qp_access_flags;
651 __u16 pkey_index;
652 __u16 alt_pkey_index;
653 __u8 qp_state;
654 __u8 cur_qp_state;
655 __u8 path_mtu;
656 __u8 path_mig_state;
657 __u8 sq_draining;
658 __u8 max_rd_atomic;
659 __u8 max_dest_rd_atomic;
660 __u8 min_rnr_timer;
661 __u8 port_num;
662 __u8 timeout;
663 __u8 retry_cnt;
664 __u8 rnr_retry;
665 __u8 alt_port_num;
666 __u8 alt_timeout;
667 __u8 sq_sig_all;
668 __u8 reserved[5];
669 __u64 driver_data[0];
670};
671
672struct ib_uverbs_modify_qp {
673 struct ib_uverbs_qp_dest dest;
674 struct ib_uverbs_qp_dest alt_dest;
675 __u32 qp_handle;
676 __u32 attr_mask;
677 __u32 qkey;
678 __u32 rq_psn;
679 __u32 sq_psn;
680 __u32 dest_qp_num;
681 __u32 qp_access_flags;
682 __u16 pkey_index;
683 __u16 alt_pkey_index;
684 __u8 qp_state;
685 __u8 cur_qp_state;
686 __u8 path_mtu;
687 __u8 path_mig_state;
688 __u8 en_sqd_async_notify;
689 __u8 max_rd_atomic;
690 __u8 max_dest_rd_atomic;
691 __u8 min_rnr_timer;
692 __u8 port_num;
693 __u8 timeout;
694 __u8 retry_cnt;
695 __u8 rnr_retry;
696 __u8 alt_port_num;
697 __u8 alt_timeout;
698 __u8 reserved[2];
699 __u64 driver_data[0];
700};
701
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800702struct ib_uverbs_ex_modify_qp {
703 struct ib_uverbs_modify_qp base;
704 __u32 rate_limit;
705 __u32 reserved;
706};
707
Ben Cheng224b54f2013-10-15 18:26:18 -0700708struct ib_uverbs_modify_qp_resp {
709};
710
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800711struct ib_uverbs_ex_modify_qp_resp {
712 __u32 comp_mask;
713 __u32 response_length;
714};
715
Ben Cheng224b54f2013-10-15 18:26:18 -0700716struct ib_uverbs_destroy_qp {
717 __u64 response;
718 __u32 qp_handle;
719 __u32 reserved;
720};
721
722struct ib_uverbs_destroy_qp_resp {
723 __u32 events_reported;
724};
725
726/*
727 * The ib_uverbs_sge structure isn't used anywhere, since we assume
728 * the ib_sge structure is packed the same way on 32-bit and 64-bit
729 * architectures in both kernel and user space. It's just here to
730 * document the ABI.
731 */
732struct ib_uverbs_sge {
733 __u64 addr;
734 __u32 length;
735 __u32 lkey;
736};
737
738struct ib_uverbs_send_wr {
739 __u64 wr_id;
740 __u32 num_sge;
741 __u32 opcode;
742 __u32 send_flags;
743 union {
744 __u32 imm_data;
745 __u32 invalidate_rkey;
746 } ex;
747 union {
748 struct {
749 __u64 remote_addr;
750 __u32 rkey;
751 __u32 reserved;
752 } rdma;
753 struct {
754 __u64 remote_addr;
755 __u64 compare_add;
756 __u64 swap;
757 __u32 rkey;
758 __u32 reserved;
759 } atomic;
760 struct {
761 __u32 ah;
762 __u32 remote_qpn;
763 __u32 remote_qkey;
764 __u32 reserved;
765 } ud;
766 } wr;
767};
768
769struct ib_uverbs_post_send {
770 __u64 response;
771 __u32 qp_handle;
772 __u32 wr_count;
773 __u32 sge_count;
774 __u32 wqe_size;
775 struct ib_uverbs_send_wr send_wr[0];
776};
777
778struct ib_uverbs_post_send_resp {
779 __u32 bad_wr;
780};
781
782struct ib_uverbs_recv_wr {
783 __u64 wr_id;
784 __u32 num_sge;
785 __u32 reserved;
786};
787
788struct ib_uverbs_post_recv {
789 __u64 response;
790 __u32 qp_handle;
791 __u32 wr_count;
792 __u32 sge_count;
793 __u32 wqe_size;
794 struct ib_uverbs_recv_wr recv_wr[0];
795};
796
797struct ib_uverbs_post_recv_resp {
798 __u32 bad_wr;
799};
800
801struct ib_uverbs_post_srq_recv {
802 __u64 response;
803 __u32 srq_handle;
804 __u32 wr_count;
805 __u32 sge_count;
806 __u32 wqe_size;
807 struct ib_uverbs_recv_wr recv[0];
808};
809
810struct ib_uverbs_post_srq_recv_resp {
811 __u32 bad_wr;
812};
813
814struct ib_uverbs_create_ah {
815 __u64 response;
816 __u64 user_handle;
817 __u32 pd_handle;
818 __u32 reserved;
819 struct ib_uverbs_ah_attr attr;
820};
821
822struct ib_uverbs_create_ah_resp {
823 __u32 ah_handle;
824};
825
826struct ib_uverbs_destroy_ah {
827 __u32 ah_handle;
828};
829
830struct ib_uverbs_attach_mcast {
831 __u8 gid[16];
832 __u32 qp_handle;
833 __u16 mlid;
834 __u16 reserved;
835 __u64 driver_data[0];
836};
837
838struct ib_uverbs_detach_mcast {
839 __u8 gid[16];
840 __u32 qp_handle;
841 __u16 mlid;
842 __u16 reserved;
843 __u64 driver_data[0];
844};
845
Christopher Ferrise0845012014-07-09 14:58:51 -0700846struct ib_uverbs_flow_spec_hdr {
847 __u32 type;
848 __u16 size;
849 __u16 reserved;
850 /* followed by flow_spec */
851 __u64 flow_spec_data[0];
852};
853
854struct ib_uverbs_flow_eth_filter {
855 __u8 dst_mac[6];
856 __u8 src_mac[6];
857 __be16 ether_type;
858 __be16 vlan_tag;
859};
860
861struct ib_uverbs_flow_spec_eth {
862 union {
863 struct ib_uverbs_flow_spec_hdr hdr;
864 struct {
865 __u32 type;
866 __u16 size;
867 __u16 reserved;
868 };
869 };
870 struct ib_uverbs_flow_eth_filter val;
871 struct ib_uverbs_flow_eth_filter mask;
872};
873
874struct ib_uverbs_flow_ipv4_filter {
875 __be32 src_ip;
876 __be32 dst_ip;
Christopher Ferris33185402017-01-13 13:28:52 -0800877 __u8 proto;
878 __u8 tos;
879 __u8 ttl;
880 __u8 flags;
Christopher Ferrise0845012014-07-09 14:58:51 -0700881};
882
883struct ib_uverbs_flow_spec_ipv4 {
884 union {
885 struct ib_uverbs_flow_spec_hdr hdr;
886 struct {
887 __u32 type;
888 __u16 size;
889 __u16 reserved;
890 };
891 };
892 struct ib_uverbs_flow_ipv4_filter val;
893 struct ib_uverbs_flow_ipv4_filter mask;
894};
895
896struct ib_uverbs_flow_tcp_udp_filter {
897 __be16 dst_port;
898 __be16 src_port;
899};
900
901struct ib_uverbs_flow_spec_tcp_udp {
902 union {
903 struct ib_uverbs_flow_spec_hdr hdr;
904 struct {
905 __u32 type;
906 __u16 size;
907 __u16 reserved;
908 };
909 };
910 struct ib_uverbs_flow_tcp_udp_filter val;
911 struct ib_uverbs_flow_tcp_udp_filter mask;
912};
913
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800914struct ib_uverbs_flow_ipv6_filter {
Christopher Ferris33185402017-01-13 13:28:52 -0800915 __u8 src_ip[16];
916 __u8 dst_ip[16];
917 __be32 flow_label;
918 __u8 next_hdr;
919 __u8 traffic_class;
920 __u8 hop_limit;
921 __u8 reserved;
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800922};
923
924struct ib_uverbs_flow_spec_ipv6 {
925 union {
926 struct ib_uverbs_flow_spec_hdr hdr;
927 struct {
928 __u32 type;
929 __u16 size;
930 __u16 reserved;
931 };
932 };
933 struct ib_uverbs_flow_ipv6_filter val;
934 struct ib_uverbs_flow_ipv6_filter mask;
935};
936
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800937struct ib_uverbs_flow_tunnel_filter {
938 __be32 tunnel_id;
939};
940
941struct ib_uverbs_flow_spec_tunnel {
942 union {
943 struct ib_uverbs_flow_spec_hdr hdr;
944 struct {
945 __u32 type;
946 __u16 size;
947 __u16 reserved;
948 };
949 };
950 struct ib_uverbs_flow_tunnel_filter val;
951 struct ib_uverbs_flow_tunnel_filter mask;
952};
953
Christopher Ferrise0845012014-07-09 14:58:51 -0700954struct ib_uverbs_flow_attr {
955 __u32 type;
956 __u16 size;
957 __u16 priority;
958 __u8 num_of_specs;
959 __u8 reserved[2];
960 __u8 port;
961 __u32 flags;
962 /* Following are the optional layers according to user request
963 * struct ib_flow_spec_xxx
964 * struct ib_flow_spec_yyy
965 */
966 struct ib_uverbs_flow_spec_hdr flow_specs[0];
967};
968
969struct ib_uverbs_create_flow {
970 __u32 comp_mask;
971 __u32 qp_handle;
972 struct ib_uverbs_flow_attr flow_attr;
973};
974
975struct ib_uverbs_create_flow_resp {
976 __u32 comp_mask;
977 __u32 flow_handle;
978};
979
980struct ib_uverbs_destroy_flow {
981 __u32 comp_mask;
982 __u32 flow_handle;
983};
984
Ben Cheng224b54f2013-10-15 18:26:18 -0700985struct ib_uverbs_create_srq {
986 __u64 response;
987 __u64 user_handle;
988 __u32 pd_handle;
989 __u32 max_wr;
990 __u32 max_sge;
991 __u32 srq_limit;
992 __u64 driver_data[0];
993};
994
995struct ib_uverbs_create_xsrq {
996 __u64 response;
997 __u64 user_handle;
998 __u32 srq_type;
999 __u32 pd_handle;
1000 __u32 max_wr;
1001 __u32 max_sge;
1002 __u32 srq_limit;
1003 __u32 reserved;
1004 __u32 xrcd_handle;
1005 __u32 cq_handle;
1006 __u64 driver_data[0];
1007};
1008
1009struct ib_uverbs_create_srq_resp {
1010 __u32 srq_handle;
1011 __u32 max_wr;
1012 __u32 max_sge;
1013 __u32 srqn;
1014};
1015
1016struct ib_uverbs_modify_srq {
1017 __u32 srq_handle;
1018 __u32 attr_mask;
1019 __u32 max_wr;
1020 __u32 srq_limit;
1021 __u64 driver_data[0];
1022};
1023
1024struct ib_uverbs_query_srq {
1025 __u64 response;
1026 __u32 srq_handle;
1027 __u32 reserved;
1028 __u64 driver_data[0];
1029};
1030
1031struct ib_uverbs_query_srq_resp {
1032 __u32 max_wr;
1033 __u32 max_sge;
1034 __u32 srq_limit;
1035 __u32 reserved;
1036};
1037
1038struct ib_uverbs_destroy_srq {
1039 __u64 response;
1040 __u32 srq_handle;
1041 __u32 reserved;
1042};
1043
1044struct ib_uverbs_destroy_srq_resp {
1045 __u32 events_reported;
1046};
1047
Christopher Ferris6e3550f2016-12-12 14:51:18 -08001048struct ib_uverbs_ex_create_wq {
1049 __u32 comp_mask;
1050 __u32 wq_type;
1051 __u64 user_handle;
1052 __u32 pd_handle;
1053 __u32 cq_handle;
1054 __u32 max_wr;
1055 __u32 max_sge;
1056};
1057
1058struct ib_uverbs_ex_create_wq_resp {
1059 __u32 comp_mask;
1060 __u32 response_length;
1061 __u32 wq_handle;
1062 __u32 max_wr;
1063 __u32 max_sge;
1064 __u32 wqn;
1065};
1066
1067struct ib_uverbs_ex_destroy_wq {
1068 __u32 comp_mask;
1069 __u32 wq_handle;
1070};
1071
1072struct ib_uverbs_ex_destroy_wq_resp {
1073 __u32 comp_mask;
1074 __u32 response_length;
1075 __u32 events_reported;
1076 __u32 reserved;
1077};
1078
1079struct ib_uverbs_ex_modify_wq {
1080 __u32 attr_mask;
1081 __u32 wq_handle;
1082 __u32 wq_state;
1083 __u32 curr_wq_state;
1084};
1085
1086/* Prevent memory allocation rather than max expected size */
1087#define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1088struct ib_uverbs_ex_create_rwq_ind_table {
1089 __u32 comp_mask;
1090 __u32 log_ind_tbl_size;
1091 /* Following are the wq handles according to log_ind_tbl_size
1092 * wq_handle1
1093 * wq_handle2
1094 */
1095 __u32 wq_handles[0];
1096};
1097
1098struct ib_uverbs_ex_create_rwq_ind_table_resp {
1099 __u32 comp_mask;
1100 __u32 response_length;
1101 __u32 ind_tbl_handle;
1102 __u32 ind_tbl_num;
1103};
1104
1105struct ib_uverbs_ex_destroy_rwq_ind_table {
1106 __u32 comp_mask;
1107 __u32 ind_tbl_handle;
1108};
1109
Ben Cheng224b54f2013-10-15 18:26:18 -07001110#endif /* IB_USER_VERBS_H */