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