blob: 0b233c56b0e402ef75f691b5dcf6c6f1cc87a01b [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,
90 IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
91 IB_USER_VERBS_CMD_DESTROY_FLOW
Roland Dreier8a96b3f2005-07-07 17:57:12 -070092};
93
94/*
95 * Make sure that all structs defined in this file remain laid out so
96 * that they pack the same way on 32-bit and 64-bit architectures (to
97 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
Roland Dreier91ecd4a2005-10-14 15:21:44 -070098 * Specifically:
99 * - Do not use pointer types -- pass pointers in __u64 instead.
100 * - Make sure that any structure larger than 4 bytes is padded to a
101 * multiple of 8 bytes. Otherwise the structure size will be
102 * different between 32-bit and 64-bit architectures.
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700103 */
104
105struct ib_uverbs_async_event_desc {
106 __u64 element;
107 __u32 event_type; /* enum ib_event_type */
108 __u32 reserved;
109};
110
111struct ib_uverbs_comp_event_desc {
112 __u64 cq_handle;
113};
114
115/*
116 * All commands from userspace should start with a __u32 command field
117 * followed by __u16 in_words and out_words fields (which give the
118 * length of the command block and response buffer if any in 32-bit
119 * words). The kernel driver will read these fields first and read
120 * the rest of the command struct based on these value.
121 */
122
123struct ib_uverbs_cmd_hdr {
124 __u32 command;
125 __u16 in_words;
126 __u16 out_words;
127};
128
Igor Ivanov400dbc92013-08-14 13:58:29 +0300129struct ib_uverbs_cmd_hdr_ex {
130 __u32 command;
131 __u16 in_words;
132 __u16 out_words;
133 __u16 provider_in_words;
134 __u16 provider_out_words;
135 __u32 cmd_hdr_reserved;
136};
137
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700138struct ib_uverbs_get_context {
139 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700140 __u64 driver_data[0];
141};
142
143struct ib_uverbs_get_context_resp {
144 __u32 async_fd;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700145 __u32 num_comp_vectors;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700146};
147
148struct ib_uverbs_query_device {
149 __u64 response;
150 __u64 driver_data[0];
151};
152
153struct ib_uverbs_query_device_resp {
154 __u64 fw_ver;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700155 __be64 node_guid;
156 __be64 sys_image_guid;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700157 __u64 max_mr_size;
158 __u64 page_size_cap;
159 __u32 vendor_id;
160 __u32 vendor_part_id;
161 __u32 hw_ver;
162 __u32 max_qp;
163 __u32 max_qp_wr;
164 __u32 device_cap_flags;
165 __u32 max_sge;
166 __u32 max_sge_rd;
167 __u32 max_cq;
168 __u32 max_cqe;
169 __u32 max_mr;
170 __u32 max_pd;
171 __u32 max_qp_rd_atom;
172 __u32 max_ee_rd_atom;
173 __u32 max_res_rd_atom;
174 __u32 max_qp_init_rd_atom;
175 __u32 max_ee_init_rd_atom;
176 __u32 atomic_cap;
177 __u32 max_ee;
178 __u32 max_rdd;
179 __u32 max_mw;
180 __u32 max_raw_ipv6_qp;
181 __u32 max_raw_ethy_qp;
182 __u32 max_mcast_grp;
183 __u32 max_mcast_qp_attach;
184 __u32 max_total_mcast_qp_attach;
185 __u32 max_ah;
186 __u32 max_fmr;
187 __u32 max_map_per_fmr;
188 __u32 max_srq;
189 __u32 max_srq_wr;
190 __u32 max_srq_sge;
191 __u16 max_pkeys;
192 __u8 local_ca_ack_delay;
193 __u8 phys_port_cnt;
194 __u8 reserved[4];
195};
196
197struct ib_uverbs_query_port {
198 __u64 response;
199 __u8 port_num;
200 __u8 reserved[7];
201 __u64 driver_data[0];
202};
203
204struct ib_uverbs_query_port_resp {
205 __u32 port_cap_flags;
206 __u32 max_msg_sz;
207 __u32 bad_pkey_cntr;
208 __u32 qkey_viol_cntr;
209 __u32 gid_tbl_len;
210 __u16 pkey_tbl_len;
211 __u16 lid;
212 __u16 sm_lid;
213 __u8 state;
214 __u8 max_mtu;
215 __u8 active_mtu;
216 __u8 lmc;
217 __u8 max_vl_num;
218 __u8 sm_sl;
219 __u8 subnet_timeout;
220 __u8 init_type_reply;
221 __u8 active_width;
222 __u8 active_speed;
223 __u8 phys_state;
Eli Cohen2420b602010-10-18 14:45:20 -0700224 __u8 link_layer;
225 __u8 reserved[2];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700226};
227
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700228struct ib_uverbs_alloc_pd {
229 __u64 response;
230 __u64 driver_data[0];
231};
232
233struct ib_uverbs_alloc_pd_resp {
234 __u32 pd_handle;
235};
236
237struct ib_uverbs_dealloc_pd {
238 __u32 pd_handle;
239};
240
Sean Hefty53d0bd12011-05-24 08:33:46 -0700241struct ib_uverbs_open_xrcd {
242 __u64 response;
243 __u32 fd;
244 __u32 oflags;
245 __u64 driver_data[0];
246};
247
248struct ib_uverbs_open_xrcd_resp {
249 __u32 xrcd_handle;
250};
251
252struct ib_uverbs_close_xrcd {
253 __u32 xrcd_handle;
254};
255
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700256struct ib_uverbs_reg_mr {
257 __u64 response;
258 __u64 start;
259 __u64 length;
260 __u64 hca_va;
261 __u32 pd_handle;
262 __u32 access_flags;
263 __u64 driver_data[0];
264};
265
266struct ib_uverbs_reg_mr_resp {
267 __u32 mr_handle;
268 __u32 lkey;
269 __u32 rkey;
270};
271
272struct ib_uverbs_dereg_mr {
273 __u32 mr_handle;
274};
275
Shani Michaeli6b52a122013-02-06 16:19:13 +0000276struct ib_uverbs_alloc_mw {
277 __u64 response;
278 __u32 pd_handle;
279 __u8 mw_type;
280 __u8 reserved[3];
281};
282
283struct ib_uverbs_alloc_mw_resp {
284 __u32 mw_handle;
285 __u32 rkey;
286};
287
288struct ib_uverbs_dealloc_mw {
289 __u32 mw_handle;
290};
291
Roland Dreier6b73597e2005-09-26 13:53:25 -0700292struct ib_uverbs_create_comp_channel {
293 __u64 response;
294};
295
296struct ib_uverbs_create_comp_channel_resp {
297 __u32 fd;
298};
299
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700300struct ib_uverbs_create_cq {
301 __u64 response;
302 __u64 user_handle;
303 __u32 cqe;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700304 __u32 comp_vector;
305 __s32 comp_channel;
306 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700307 __u64 driver_data[0];
308};
309
310struct ib_uverbs_create_cq_resp {
311 __u32 cq_handle;
312 __u32 cqe;
313};
314
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800315struct ib_uverbs_resize_cq {
316 __u64 response;
317 __u32 cq_handle;
318 __u32 cqe;
319 __u64 driver_data[0];
320};
321
322struct ib_uverbs_resize_cq_resp {
323 __u32 cqe;
Ralph Campbell64f817b2006-09-22 15:22:24 -0700324 __u32 reserved;
325 __u64 driver_data[0];
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800326};
327
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700328struct ib_uverbs_poll_cq {
329 __u64 response;
330 __u32 cq_handle;
331 __u32 ne;
332};
333
334struct ib_uverbs_wc {
335 __u64 wr_id;
336 __u32 status;
337 __u32 opcode;
338 __u32 vendor_err;
339 __u32 byte_len;
Steve Wise00f7ec32008-07-14 23:48:45 -0700340 union {
341 __u32 imm_data;
342 __u32 invalidate_rkey;
343 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700344 __u32 qp_num;
345 __u32 src_qp;
346 __u32 wc_flags;
347 __u16 pkey_index;
348 __u16 slid;
349 __u8 sl;
350 __u8 dlid_path_bits;
351 __u8 port_num;
352 __u8 reserved;
353};
354
355struct ib_uverbs_poll_cq_resp {
356 __u32 count;
357 __u32 reserved;
358 struct ib_uverbs_wc wc[0];
359};
360
361struct ib_uverbs_req_notify_cq {
362 __u32 cq_handle;
363 __u32 solicited_only;
364};
365
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700366struct ib_uverbs_destroy_cq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700367 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700368 __u32 cq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700369 __u32 reserved;
370};
371
372struct ib_uverbs_destroy_cq_resp {
373 __u32 comp_events_reported;
374 __u32 async_events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700375};
376
Sean Hefty6a9af2e2006-06-17 20:37:27 -0700377struct ib_uverbs_global_route {
378 __u8 dgid[16];
379 __u32 flow_label;
380 __u8 sgid_index;
381 __u8 hop_limit;
382 __u8 traffic_class;
383 __u8 reserved;
384};
385
386struct ib_uverbs_ah_attr {
387 struct ib_uverbs_global_route grh;
388 __u16 dlid;
389 __u8 sl;
390 __u8 src_path_bits;
391 __u8 static_rate;
392 __u8 is_global;
393 __u8 port_num;
394 __u8 reserved;
395};
396
397struct ib_uverbs_qp_attr {
398 __u32 qp_attr_mask;
399 __u32 qp_state;
400 __u32 cur_qp_state;
401 __u32 path_mtu;
402 __u32 path_mig_state;
403 __u32 qkey;
404 __u32 rq_psn;
405 __u32 sq_psn;
406 __u32 dest_qp_num;
407 __u32 qp_access_flags;
408
409 struct ib_uverbs_ah_attr ah_attr;
410 struct ib_uverbs_ah_attr alt_ah_attr;
411
412 /* ib_qp_cap */
413 __u32 max_send_wr;
414 __u32 max_recv_wr;
415 __u32 max_send_sge;
416 __u32 max_recv_sge;
417 __u32 max_inline_data;
418
419 __u16 pkey_index;
420 __u16 alt_pkey_index;
421 __u8 en_sqd_async_notify;
422 __u8 sq_draining;
423 __u8 max_rd_atomic;
424 __u8 max_dest_rd_atomic;
425 __u8 min_rnr_timer;
426 __u8 port_num;
427 __u8 timeout;
428 __u8 retry_cnt;
429 __u8 rnr_retry;
430 __u8 alt_port_num;
431 __u8 alt_timeout;
432 __u8 reserved[5];
433};
434
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700435struct ib_uverbs_create_qp {
436 __u64 response;
437 __u64 user_handle;
438 __u32 pd_handle;
439 __u32 send_cq_handle;
440 __u32 recv_cq_handle;
441 __u32 srq_handle;
442 __u32 max_send_wr;
443 __u32 max_recv_wr;
444 __u32 max_send_sge;
445 __u32 max_recv_sge;
446 __u32 max_inline_data;
447 __u8 sq_sig_all;
448 __u8 qp_type;
449 __u8 is_srq;
450 __u8 reserved;
451 __u64 driver_data[0];
452};
453
Sean Hefty42849b22011-08-11 13:57:43 -0700454struct ib_uverbs_open_qp {
455 __u64 response;
456 __u64 user_handle;
457 __u32 pd_handle;
458 __u32 qpn;
459 __u8 qp_type;
460 __u8 reserved[7];
461 __u64 driver_data[0];
462};
463
464/* also used for open response */
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700465struct ib_uverbs_create_qp_resp {
466 __u32 qp_handle;
467 __u32 qpn;
Jack Morgenstein77369ed2005-11-09 11:26:07 -0800468 __u32 max_send_wr;
469 __u32 max_recv_wr;
470 __u32 max_send_sge;
471 __u32 max_recv_sge;
472 __u32 max_inline_data;
Roland Dreier4d9781c2006-02-16 09:26:19 -0800473 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700474};
475
476/*
477 * This struct needs to remain a multiple of 8 bytes to keep the
478 * alignment of the modify QP parameters.
479 */
480struct ib_uverbs_qp_dest {
481 __u8 dgid[16];
482 __u32 flow_label;
483 __u16 dlid;
484 __u16 reserved;
485 __u8 sgid_index;
486 __u8 hop_limit;
487 __u8 traffic_class;
488 __u8 sl;
489 __u8 src_path_bits;
490 __u8 static_rate;
491 __u8 is_global;
492 __u8 port_num;
493};
494
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800495struct ib_uverbs_query_qp {
496 __u64 response;
497 __u32 qp_handle;
498 __u32 attr_mask;
499 __u64 driver_data[0];
500};
501
502struct ib_uverbs_query_qp_resp {
503 struct ib_uverbs_qp_dest dest;
504 struct ib_uverbs_qp_dest alt_dest;
505 __u32 max_send_wr;
506 __u32 max_recv_wr;
507 __u32 max_send_sge;
508 __u32 max_recv_sge;
509 __u32 max_inline_data;
510 __u32 qkey;
511 __u32 rq_psn;
512 __u32 sq_psn;
513 __u32 dest_qp_num;
514 __u32 qp_access_flags;
515 __u16 pkey_index;
516 __u16 alt_pkey_index;
517 __u8 qp_state;
518 __u8 cur_qp_state;
519 __u8 path_mtu;
520 __u8 path_mig_state;
Jack Morgenstein0b26c882006-10-25 12:54:20 +0200521 __u8 sq_draining;
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800522 __u8 max_rd_atomic;
523 __u8 max_dest_rd_atomic;
524 __u8 min_rnr_timer;
525 __u8 port_num;
526 __u8 timeout;
527 __u8 retry_cnt;
528 __u8 rnr_retry;
529 __u8 alt_port_num;
530 __u8 alt_timeout;
531 __u8 sq_sig_all;
532 __u8 reserved[5];
533 __u64 driver_data[0];
534};
535
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700536struct ib_uverbs_modify_qp {
537 struct ib_uverbs_qp_dest dest;
538 struct ib_uverbs_qp_dest alt_dest;
539 __u32 qp_handle;
540 __u32 attr_mask;
541 __u32 qkey;
542 __u32 rq_psn;
543 __u32 sq_psn;
544 __u32 dest_qp_num;
545 __u32 qp_access_flags;
546 __u16 pkey_index;
547 __u16 alt_pkey_index;
548 __u8 qp_state;
549 __u8 cur_qp_state;
550 __u8 path_mtu;
551 __u8 path_mig_state;
552 __u8 en_sqd_async_notify;
553 __u8 max_rd_atomic;
554 __u8 max_dest_rd_atomic;
555 __u8 min_rnr_timer;
556 __u8 port_num;
557 __u8 timeout;
558 __u8 retry_cnt;
559 __u8 rnr_retry;
560 __u8 alt_port_num;
561 __u8 alt_timeout;
562 __u8 reserved[2];
563 __u64 driver_data[0];
564};
565
566struct ib_uverbs_modify_qp_resp {
567};
568
569struct ib_uverbs_destroy_qp {
Roland Dreier63aaf642005-09-09 15:55:08 -0700570 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700571 __u32 qp_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700572 __u32 reserved;
573};
574
575struct ib_uverbs_destroy_qp_resp {
576 __u32 events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700577};
578
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700579/*
580 * The ib_uverbs_sge structure isn't used anywhere, since we assume
581 * the ib_sge structure is packed the same way on 32-bit and 64-bit
582 * architectures in both kernel and user space. It's just here to
583 * document the ABI.
584 */
585struct ib_uverbs_sge {
586 __u64 addr;
587 __u32 length;
588 __u32 lkey;
589};
590
591struct ib_uverbs_send_wr {
Roland Dreiera74cd4a2006-02-13 16:30:49 -0800592 __u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700593 __u32 num_sge;
594 __u32 opcode;
595 __u32 send_flags;
Roland Dreier0f39cf32008-04-16 21:09:32 -0700596 union {
597 __u32 imm_data;
598 __u32 invalidate_rkey;
599 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700600 union {
601 struct {
602 __u64 remote_addr;
603 __u32 rkey;
604 __u32 reserved;
605 } rdma;
606 struct {
607 __u64 remote_addr;
608 __u64 compare_add;
609 __u64 swap;
610 __u32 rkey;
611 __u32 reserved;
612 } atomic;
613 struct {
614 __u32 ah;
615 __u32 remote_qpn;
616 __u32 remote_qkey;
617 __u32 reserved;
618 } ud;
619 } wr;
620};
621
622struct ib_uverbs_post_send {
623 __u64 response;
624 __u32 qp_handle;
625 __u32 wr_count;
626 __u32 sge_count;
627 __u32 wqe_size;
628 struct ib_uverbs_send_wr send_wr[0];
629};
630
631struct ib_uverbs_post_send_resp {
632 __u32 bad_wr;
633};
634
635struct ib_uverbs_recv_wr {
636 __u64 wr_id;
637 __u32 num_sge;
638 __u32 reserved;
639};
640
641struct ib_uverbs_post_recv {
642 __u64 response;
643 __u32 qp_handle;
644 __u32 wr_count;
645 __u32 sge_count;
646 __u32 wqe_size;
647 struct ib_uverbs_recv_wr recv_wr[0];
648};
649
650struct ib_uverbs_post_recv_resp {
651 __u32 bad_wr;
652};
653
654struct ib_uverbs_post_srq_recv {
655 __u64 response;
656 __u32 srq_handle;
657 __u32 wr_count;
658 __u32 sge_count;
659 __u32 wqe_size;
660 struct ib_uverbs_recv_wr recv[0];
661};
662
663struct ib_uverbs_post_srq_recv_resp {
664 __u32 bad_wr;
665};
666
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700667struct ib_uverbs_create_ah {
668 __u64 response;
669 __u64 user_handle;
670 __u32 pd_handle;
671 __u32 reserved;
672 struct ib_uverbs_ah_attr attr;
673};
674
675struct ib_uverbs_create_ah_resp {
676 __u32 ah_handle;
677};
678
679struct ib_uverbs_destroy_ah {
680 __u32 ah_handle;
681};
682
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700683struct ib_uverbs_attach_mcast {
684 __u8 gid[16];
685 __u32 qp_handle;
686 __u16 mlid;
687 __u16 reserved;
688 __u64 driver_data[0];
689};
690
691struct ib_uverbs_detach_mcast {
692 __u8 gid[16];
693 __u32 qp_handle;
694 __u16 mlid;
695 __u16 reserved;
696 __u64 driver_data[0];
697};
698
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300699struct ib_kern_eth_filter {
700 __u8 dst_mac[6];
701 __u8 src_mac[6];
702 __be16 ether_type;
703 __be16 vlan_tag;
704};
705
706struct ib_kern_spec_eth {
707 __u32 type;
708 __u16 size;
709 __u16 reserved;
710 struct ib_kern_eth_filter val;
711 struct ib_kern_eth_filter mask;
712};
713
714struct ib_kern_ipv4_filter {
715 __be32 src_ip;
716 __be32 dst_ip;
717};
718
719struct ib_kern_spec_ipv4 {
720 __u32 type;
721 __u16 size;
722 __u16 reserved;
723 struct ib_kern_ipv4_filter val;
724 struct ib_kern_ipv4_filter mask;
725};
726
727struct ib_kern_tcp_udp_filter {
728 __be16 dst_port;
729 __be16 src_port;
730};
731
732struct ib_kern_spec_tcp_udp {
733 __u32 type;
734 __u16 size;
735 __u16 reserved;
736 struct ib_kern_tcp_udp_filter val;
737 struct ib_kern_tcp_udp_filter mask;
738};
739
740struct ib_kern_spec {
741 union {
742 struct {
743 __u32 type;
744 __u16 size;
745 __u16 reserved;
746 };
747 struct ib_kern_spec_eth eth;
748 struct ib_kern_spec_ipv4 ipv4;
749 struct ib_kern_spec_tcp_udp tcp_udp;
750 };
751};
752
753struct ib_kern_flow_attr {
754 __u32 type;
755 __u16 size;
756 __u16 priority;
757 __u8 num_of_specs;
758 __u8 reserved[2];
759 __u8 port;
760 __u32 flags;
761 /* Following are the optional layers according to user request
762 * struct ib_flow_spec_xxx
763 * struct ib_flow_spec_yyy
764 */
765};
766
767struct ib_uverbs_create_flow {
768 __u32 comp_mask;
769 __u64 response;
770 __u32 qp_handle;
771 struct ib_kern_flow_attr flow_attr;
772};
773
774struct ib_uverbs_create_flow_resp {
775 __u32 comp_mask;
776 __u32 flow_handle;
777};
778
779struct ib_uverbs_destroy_flow {
780 __u32 comp_mask;
781 __u32 flow_handle;
782};
783
Roland Dreierf520ba52005-08-18 12:24:13 -0700784struct ib_uverbs_create_srq {
785 __u64 response;
786 __u64 user_handle;
787 __u32 pd_handle;
788 __u32 max_wr;
789 __u32 max_sge;
790 __u32 srq_limit;
791 __u64 driver_data[0];
792};
793
Sean Hefty8541f8d2011-05-25 17:08:38 -0700794struct ib_uverbs_create_xsrq {
795 __u64 response;
796 __u64 user_handle;
797 __u32 srq_type;
798 __u32 pd_handle;
799 __u32 max_wr;
800 __u32 max_sge;
801 __u32 srq_limit;
802 __u32 reserved;
803 __u32 xrcd_handle;
804 __u32 cq_handle;
805 __u64 driver_data[0];
806};
807
Roland Dreierf520ba52005-08-18 12:24:13 -0700808struct ib_uverbs_create_srq_resp {
809 __u32 srq_handle;
Dotan Barakea88fd12006-02-23 12:36:18 -0800810 __u32 max_wr;
811 __u32 max_sge;
Sean Hefty8541f8d2011-05-25 17:08:38 -0700812 __u32 srqn;
Roland Dreierf520ba52005-08-18 12:24:13 -0700813};
814
815struct ib_uverbs_modify_srq {
816 __u32 srq_handle;
817 __u32 attr_mask;
818 __u32 max_wr;
Roland Dreierf520ba52005-08-18 12:24:13 -0700819 __u32 srq_limit;
Roland Dreierf520ba52005-08-18 12:24:13 -0700820 __u64 driver_data[0];
821};
822
Dotan Barak8bdb0e82006-02-13 16:31:57 -0800823struct ib_uverbs_query_srq {
824 __u64 response;
825 __u32 srq_handle;
826 __u32 reserved;
827 __u64 driver_data[0];
828};
829
830struct ib_uverbs_query_srq_resp {
831 __u32 max_wr;
832 __u32 max_sge;
833 __u32 srq_limit;
834 __u32 reserved;
835};
836
Roland Dreierf520ba52005-08-18 12:24:13 -0700837struct ib_uverbs_destroy_srq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700838 __u64 response;
Roland Dreierf520ba52005-08-18 12:24:13 -0700839 __u32 srq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700840 __u32 reserved;
841};
842
843struct ib_uverbs_destroy_srq_resp {
844 __u32 events_reported;
Roland Dreierf520ba52005-08-18 12:24:13 -0700845};
846
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700847#endif /* IB_USER_VERBS_H */