blob: 4275b961bf60f65ec9d93a2dbe680e66d184b6a2 [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 Cohen5a77abf2014-12-11 17:04:15 +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
Sagi Grimberg860f10a2014-12-11 17:04:16 +0200205enum {
206 IB_USER_VERBS_EX_QUERY_DEVICE_ODP = 1ULL << 0,
207};
208
Eli Cohen5a77abf2014-12-11 17:04:15 +0200209struct ib_uverbs_ex_query_device {
210 __u32 comp_mask;
211 __u32 reserved;
212};
213
Sagi Grimberg860f10a2014-12-11 17:04:16 +0200214struct ib_uverbs_odp_caps {
215 __u64 general_caps;
216 struct {
217 __u32 rc_odp_caps;
218 __u32 uc_odp_caps;
219 __u32 ud_odp_caps;
220 } per_transport_caps;
221 __u32 reserved;
222};
223
Eli Cohen5a77abf2014-12-11 17:04:15 +0200224struct ib_uverbs_ex_query_device_resp {
225 struct ib_uverbs_query_device_resp base;
226 __u32 comp_mask;
227 __u32 reserved;
Sagi Grimberg860f10a2014-12-11 17:04:16 +0200228 struct ib_uverbs_odp_caps odp_caps;
Eli Cohen5a77abf2014-12-11 17:04:15 +0200229};
230
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700231struct ib_uverbs_query_port {
232 __u64 response;
233 __u8 port_num;
234 __u8 reserved[7];
235 __u64 driver_data[0];
236};
237
238struct ib_uverbs_query_port_resp {
239 __u32 port_cap_flags;
240 __u32 max_msg_sz;
241 __u32 bad_pkey_cntr;
242 __u32 qkey_viol_cntr;
243 __u32 gid_tbl_len;
244 __u16 pkey_tbl_len;
245 __u16 lid;
246 __u16 sm_lid;
247 __u8 state;
248 __u8 max_mtu;
249 __u8 active_mtu;
250 __u8 lmc;
251 __u8 max_vl_num;
252 __u8 sm_sl;
253 __u8 subnet_timeout;
254 __u8 init_type_reply;
255 __u8 active_width;
256 __u8 active_speed;
257 __u8 phys_state;
Eli Cohen2420b602010-10-18 14:45:20 -0700258 __u8 link_layer;
259 __u8 reserved[2];
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700260};
261
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700262struct ib_uverbs_alloc_pd {
263 __u64 response;
264 __u64 driver_data[0];
265};
266
267struct ib_uverbs_alloc_pd_resp {
268 __u32 pd_handle;
269};
270
271struct ib_uverbs_dealloc_pd {
272 __u32 pd_handle;
273};
274
Sean Hefty53d0bd12011-05-24 08:33:46 -0700275struct ib_uverbs_open_xrcd {
276 __u64 response;
277 __u32 fd;
278 __u32 oflags;
279 __u64 driver_data[0];
280};
281
282struct ib_uverbs_open_xrcd_resp {
283 __u32 xrcd_handle;
284};
285
286struct ib_uverbs_close_xrcd {
287 __u32 xrcd_handle;
288};
289
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700290struct ib_uverbs_reg_mr {
291 __u64 response;
292 __u64 start;
293 __u64 length;
294 __u64 hca_va;
295 __u32 pd_handle;
296 __u32 access_flags;
297 __u64 driver_data[0];
298};
299
300struct ib_uverbs_reg_mr_resp {
301 __u32 mr_handle;
302 __u32 lkey;
303 __u32 rkey;
304};
305
Matan Barak7e6edb92014-07-31 11:01:28 +0300306struct ib_uverbs_rereg_mr {
307 __u64 response;
308 __u32 mr_handle;
309 __u32 flags;
310 __u64 start;
311 __u64 length;
312 __u64 hca_va;
313 __u32 pd_handle;
314 __u32 access_flags;
315};
316
317struct ib_uverbs_rereg_mr_resp {
318 __u32 lkey;
319 __u32 rkey;
320};
321
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700322struct ib_uverbs_dereg_mr {
323 __u32 mr_handle;
324};
325
Shani Michaeli6b52a122013-02-06 16:19:13 +0000326struct ib_uverbs_alloc_mw {
327 __u64 response;
328 __u32 pd_handle;
329 __u8 mw_type;
330 __u8 reserved[3];
331};
332
333struct ib_uverbs_alloc_mw_resp {
334 __u32 mw_handle;
335 __u32 rkey;
336};
337
338struct ib_uverbs_dealloc_mw {
339 __u32 mw_handle;
340};
341
Roland Dreier6b73597e2005-09-26 13:53:25 -0700342struct ib_uverbs_create_comp_channel {
343 __u64 response;
344};
345
346struct ib_uverbs_create_comp_channel_resp {
347 __u32 fd;
348};
349
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700350struct ib_uverbs_create_cq {
351 __u64 response;
352 __u64 user_handle;
353 __u32 cqe;
Roland Dreier6b73597e2005-09-26 13:53:25 -0700354 __u32 comp_vector;
355 __s32 comp_channel;
356 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700357 __u64 driver_data[0];
358};
359
360struct ib_uverbs_create_cq_resp {
361 __u32 cq_handle;
362 __u32 cqe;
363};
364
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800365struct ib_uverbs_resize_cq {
366 __u64 response;
367 __u32 cq_handle;
368 __u32 cqe;
369 __u64 driver_data[0];
370};
371
372struct ib_uverbs_resize_cq_resp {
373 __u32 cqe;
Ralph Campbell64f817b2006-09-22 15:22:24 -0700374 __u32 reserved;
375 __u64 driver_data[0];
Roland Dreier33b9b3e2006-01-30 14:29:21 -0800376};
377
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700378struct ib_uverbs_poll_cq {
379 __u64 response;
380 __u32 cq_handle;
381 __u32 ne;
382};
383
384struct ib_uverbs_wc {
385 __u64 wr_id;
386 __u32 status;
387 __u32 opcode;
388 __u32 vendor_err;
389 __u32 byte_len;
Steve Wise00f7ec32008-07-14 23:48:45 -0700390 union {
391 __u32 imm_data;
392 __u32 invalidate_rkey;
393 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700394 __u32 qp_num;
395 __u32 src_qp;
396 __u32 wc_flags;
397 __u16 pkey_index;
398 __u16 slid;
399 __u8 sl;
400 __u8 dlid_path_bits;
401 __u8 port_num;
402 __u8 reserved;
403};
404
405struct ib_uverbs_poll_cq_resp {
406 __u32 count;
407 __u32 reserved;
408 struct ib_uverbs_wc wc[0];
409};
410
411struct ib_uverbs_req_notify_cq {
412 __u32 cq_handle;
413 __u32 solicited_only;
414};
415
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700416struct ib_uverbs_destroy_cq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700417 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700418 __u32 cq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700419 __u32 reserved;
420};
421
422struct ib_uverbs_destroy_cq_resp {
423 __u32 comp_events_reported;
424 __u32 async_events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700425};
426
Sean Hefty6a9af2e2006-06-17 20:37:27 -0700427struct ib_uverbs_global_route {
428 __u8 dgid[16];
429 __u32 flow_label;
430 __u8 sgid_index;
431 __u8 hop_limit;
432 __u8 traffic_class;
433 __u8 reserved;
434};
435
436struct ib_uverbs_ah_attr {
437 struct ib_uverbs_global_route grh;
438 __u16 dlid;
439 __u8 sl;
440 __u8 src_path_bits;
441 __u8 static_rate;
442 __u8 is_global;
443 __u8 port_num;
444 __u8 reserved;
445};
446
447struct ib_uverbs_qp_attr {
448 __u32 qp_attr_mask;
449 __u32 qp_state;
450 __u32 cur_qp_state;
451 __u32 path_mtu;
452 __u32 path_mig_state;
453 __u32 qkey;
454 __u32 rq_psn;
455 __u32 sq_psn;
456 __u32 dest_qp_num;
457 __u32 qp_access_flags;
458
459 struct ib_uverbs_ah_attr ah_attr;
460 struct ib_uverbs_ah_attr alt_ah_attr;
461
462 /* ib_qp_cap */
463 __u32 max_send_wr;
464 __u32 max_recv_wr;
465 __u32 max_send_sge;
466 __u32 max_recv_sge;
467 __u32 max_inline_data;
468
469 __u16 pkey_index;
470 __u16 alt_pkey_index;
471 __u8 en_sqd_async_notify;
472 __u8 sq_draining;
473 __u8 max_rd_atomic;
474 __u8 max_dest_rd_atomic;
475 __u8 min_rnr_timer;
476 __u8 port_num;
477 __u8 timeout;
478 __u8 retry_cnt;
479 __u8 rnr_retry;
480 __u8 alt_port_num;
481 __u8 alt_timeout;
482 __u8 reserved[5];
483};
484
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700485struct ib_uverbs_create_qp {
486 __u64 response;
487 __u64 user_handle;
488 __u32 pd_handle;
489 __u32 send_cq_handle;
490 __u32 recv_cq_handle;
491 __u32 srq_handle;
492 __u32 max_send_wr;
493 __u32 max_recv_wr;
494 __u32 max_send_sge;
495 __u32 max_recv_sge;
496 __u32 max_inline_data;
497 __u8 sq_sig_all;
498 __u8 qp_type;
499 __u8 is_srq;
500 __u8 reserved;
501 __u64 driver_data[0];
502};
503
Sean Hefty42849b22011-08-11 13:57:43 -0700504struct ib_uverbs_open_qp {
505 __u64 response;
506 __u64 user_handle;
507 __u32 pd_handle;
508 __u32 qpn;
509 __u8 qp_type;
510 __u8 reserved[7];
511 __u64 driver_data[0];
512};
513
514/* also used for open response */
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700515struct ib_uverbs_create_qp_resp {
516 __u32 qp_handle;
517 __u32 qpn;
Jack Morgenstein77369ed2005-11-09 11:26:07 -0800518 __u32 max_send_wr;
519 __u32 max_recv_wr;
520 __u32 max_send_sge;
521 __u32 max_recv_sge;
522 __u32 max_inline_data;
Roland Dreier4d9781c2006-02-16 09:26:19 -0800523 __u32 reserved;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700524};
525
526/*
527 * This struct needs to remain a multiple of 8 bytes to keep the
528 * alignment of the modify QP parameters.
529 */
530struct ib_uverbs_qp_dest {
531 __u8 dgid[16];
532 __u32 flow_label;
533 __u16 dlid;
534 __u16 reserved;
535 __u8 sgid_index;
536 __u8 hop_limit;
537 __u8 traffic_class;
538 __u8 sl;
539 __u8 src_path_bits;
540 __u8 static_rate;
541 __u8 is_global;
542 __u8 port_num;
543};
544
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800545struct ib_uverbs_query_qp {
546 __u64 response;
547 __u32 qp_handle;
548 __u32 attr_mask;
549 __u64 driver_data[0];
550};
551
552struct ib_uverbs_query_qp_resp {
553 struct ib_uverbs_qp_dest dest;
554 struct ib_uverbs_qp_dest alt_dest;
555 __u32 max_send_wr;
556 __u32 max_recv_wr;
557 __u32 max_send_sge;
558 __u32 max_recv_sge;
559 __u32 max_inline_data;
560 __u32 qkey;
561 __u32 rq_psn;
562 __u32 sq_psn;
563 __u32 dest_qp_num;
564 __u32 qp_access_flags;
565 __u16 pkey_index;
566 __u16 alt_pkey_index;
567 __u8 qp_state;
568 __u8 cur_qp_state;
569 __u8 path_mtu;
570 __u8 path_mig_state;
Jack Morgenstein0b26c882006-10-25 12:54:20 +0200571 __u8 sq_draining;
Dotan Barak7ccc9a22006-02-13 16:31:25 -0800572 __u8 max_rd_atomic;
573 __u8 max_dest_rd_atomic;
574 __u8 min_rnr_timer;
575 __u8 port_num;
576 __u8 timeout;
577 __u8 retry_cnt;
578 __u8 rnr_retry;
579 __u8 alt_port_num;
580 __u8 alt_timeout;
581 __u8 sq_sig_all;
582 __u8 reserved[5];
583 __u64 driver_data[0];
584};
585
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700586struct ib_uverbs_modify_qp {
587 struct ib_uverbs_qp_dest dest;
588 struct ib_uverbs_qp_dest alt_dest;
589 __u32 qp_handle;
590 __u32 attr_mask;
591 __u32 qkey;
592 __u32 rq_psn;
593 __u32 sq_psn;
594 __u32 dest_qp_num;
595 __u32 qp_access_flags;
596 __u16 pkey_index;
597 __u16 alt_pkey_index;
598 __u8 qp_state;
599 __u8 cur_qp_state;
600 __u8 path_mtu;
601 __u8 path_mig_state;
602 __u8 en_sqd_async_notify;
603 __u8 max_rd_atomic;
604 __u8 max_dest_rd_atomic;
605 __u8 min_rnr_timer;
606 __u8 port_num;
607 __u8 timeout;
608 __u8 retry_cnt;
609 __u8 rnr_retry;
610 __u8 alt_port_num;
611 __u8 alt_timeout;
612 __u8 reserved[2];
613 __u64 driver_data[0];
614};
615
616struct ib_uverbs_modify_qp_resp {
617};
618
619struct ib_uverbs_destroy_qp {
Roland Dreier63aaf642005-09-09 15:55:08 -0700620 __u64 response;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700621 __u32 qp_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700622 __u32 reserved;
623};
624
625struct ib_uverbs_destroy_qp_resp {
626 __u32 events_reported;
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700627};
628
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700629/*
630 * The ib_uverbs_sge structure isn't used anywhere, since we assume
631 * the ib_sge structure is packed the same way on 32-bit and 64-bit
632 * architectures in both kernel and user space. It's just here to
633 * document the ABI.
634 */
635struct ib_uverbs_sge {
636 __u64 addr;
637 __u32 length;
638 __u32 lkey;
639};
640
641struct ib_uverbs_send_wr {
Roland Dreiera74cd4a2006-02-13 16:30:49 -0800642 __u64 wr_id;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700643 __u32 num_sge;
644 __u32 opcode;
645 __u32 send_flags;
Roland Dreier0f39cf32008-04-16 21:09:32 -0700646 union {
647 __u32 imm_data;
648 __u32 invalidate_rkey;
649 } ex;
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700650 union {
651 struct {
652 __u64 remote_addr;
653 __u32 rkey;
654 __u32 reserved;
655 } rdma;
656 struct {
657 __u64 remote_addr;
658 __u64 compare_add;
659 __u64 swap;
660 __u32 rkey;
661 __u32 reserved;
662 } atomic;
663 struct {
664 __u32 ah;
665 __u32 remote_qpn;
666 __u32 remote_qkey;
667 __u32 reserved;
668 } ud;
669 } wr;
670};
671
672struct ib_uverbs_post_send {
673 __u64 response;
674 __u32 qp_handle;
675 __u32 wr_count;
676 __u32 sge_count;
677 __u32 wqe_size;
678 struct ib_uverbs_send_wr send_wr[0];
679};
680
681struct ib_uverbs_post_send_resp {
682 __u32 bad_wr;
683};
684
685struct ib_uverbs_recv_wr {
686 __u64 wr_id;
687 __u32 num_sge;
688 __u32 reserved;
689};
690
691struct ib_uverbs_post_recv {
692 __u64 response;
693 __u32 qp_handle;
694 __u32 wr_count;
695 __u32 sge_count;
696 __u32 wqe_size;
697 struct ib_uverbs_recv_wr recv_wr[0];
698};
699
700struct ib_uverbs_post_recv_resp {
701 __u32 bad_wr;
702};
703
704struct ib_uverbs_post_srq_recv {
705 __u64 response;
706 __u32 srq_handle;
707 __u32 wr_count;
708 __u32 sge_count;
709 __u32 wqe_size;
710 struct ib_uverbs_recv_wr recv[0];
711};
712
713struct ib_uverbs_post_srq_recv_resp {
714 __u32 bad_wr;
715};
716
Roland Dreier91ecd4a2005-10-14 15:21:44 -0700717struct ib_uverbs_create_ah {
718 __u64 response;
719 __u64 user_handle;
720 __u32 pd_handle;
721 __u32 reserved;
722 struct ib_uverbs_ah_attr attr;
723};
724
725struct ib_uverbs_create_ah_resp {
726 __u32 ah_handle;
727};
728
729struct ib_uverbs_destroy_ah {
730 __u32 ah_handle;
731};
732
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700733struct ib_uverbs_attach_mcast {
734 __u8 gid[16];
735 __u32 qp_handle;
736 __u16 mlid;
737 __u16 reserved;
738 __u64 driver_data[0];
739};
740
741struct ib_uverbs_detach_mcast {
742 __u8 gid[16];
743 __u32 qp_handle;
744 __u16 mlid;
745 __u16 reserved;
746 __u64 driver_data[0];
747};
748
Yann Droneaud58913ef2013-11-06 23:21:47 +0100749struct ib_uverbs_flow_spec_hdr {
750 __u32 type;
751 __u16 size;
752 __u16 reserved;
753 /* followed by flow_spec */
754 __u64 flow_spec_data[0];
755};
756
Yann Droneaudb68c9562013-11-06 23:21:46 +0100757struct ib_uverbs_flow_eth_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300758 __u8 dst_mac[6];
759 __u8 src_mac[6];
760 __be16 ether_type;
761 __be16 vlan_tag;
762};
763
Yann Droneaudb68c9562013-11-06 23:21:46 +0100764struct ib_uverbs_flow_spec_eth {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100765 union {
766 struct ib_uverbs_flow_spec_hdr hdr;
767 struct {
768 __u32 type;
769 __u16 size;
770 __u16 reserved;
771 };
772 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100773 struct ib_uverbs_flow_eth_filter val;
774 struct ib_uverbs_flow_eth_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300775};
776
Yann Droneaudb68c9562013-11-06 23:21:46 +0100777struct ib_uverbs_flow_ipv4_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300778 __be32 src_ip;
779 __be32 dst_ip;
780};
781
Yann Droneaudb68c9562013-11-06 23:21:46 +0100782struct ib_uverbs_flow_spec_ipv4 {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100783 union {
784 struct ib_uverbs_flow_spec_hdr hdr;
785 struct {
786 __u32 type;
787 __u16 size;
788 __u16 reserved;
789 };
790 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100791 struct ib_uverbs_flow_ipv4_filter val;
792 struct ib_uverbs_flow_ipv4_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300793};
794
Yann Droneaudb68c9562013-11-06 23:21:46 +0100795struct ib_uverbs_flow_tcp_udp_filter {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300796 __be16 dst_port;
797 __be16 src_port;
798};
799
Yann Droneaudb68c9562013-11-06 23:21:46 +0100800struct ib_uverbs_flow_spec_tcp_udp {
Yann Droneaud58913ef2013-11-06 23:21:47 +0100801 union {
802 struct ib_uverbs_flow_spec_hdr hdr;
803 struct {
804 __u32 type;
805 __u16 size;
806 __u16 reserved;
807 };
808 };
Yann Droneaudb68c9562013-11-06 23:21:46 +0100809 struct ib_uverbs_flow_tcp_udp_filter val;
810 struct ib_uverbs_flow_tcp_udp_filter mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300811};
812
Yann Droneaudd82693d2013-11-06 23:21:45 +0100813struct ib_uverbs_flow_attr {
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300814 __u32 type;
815 __u16 size;
816 __u16 priority;
817 __u8 num_of_specs;
818 __u8 reserved[2];
819 __u8 port;
820 __u32 flags;
821 /* Following are the optional layers according to user request
822 * struct ib_flow_spec_xxx
823 * struct ib_flow_spec_yyy
824 */
Yann Droneaud58913ef2013-11-06 23:21:47 +0100825 struct ib_uverbs_flow_spec_hdr flow_specs[0];
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300826};
827
828struct ib_uverbs_create_flow {
829 __u32 comp_mask;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300830 __u32 qp_handle;
Yann Droneaudd82693d2013-11-06 23:21:45 +0100831 struct ib_uverbs_flow_attr flow_attr;
Hadar Hen Zion436f2ad2013-08-14 13:58:30 +0300832};
833
834struct ib_uverbs_create_flow_resp {
835 __u32 comp_mask;
836 __u32 flow_handle;
837};
838
839struct ib_uverbs_destroy_flow {
840 __u32 comp_mask;
841 __u32 flow_handle;
842};
843
Roland Dreierf520ba52005-08-18 12:24:13 -0700844struct ib_uverbs_create_srq {
845 __u64 response;
846 __u64 user_handle;
847 __u32 pd_handle;
848 __u32 max_wr;
849 __u32 max_sge;
850 __u32 srq_limit;
851 __u64 driver_data[0];
852};
853
Sean Hefty8541f8d2011-05-25 17:08:38 -0700854struct ib_uverbs_create_xsrq {
855 __u64 response;
856 __u64 user_handle;
857 __u32 srq_type;
858 __u32 pd_handle;
859 __u32 max_wr;
860 __u32 max_sge;
861 __u32 srq_limit;
862 __u32 reserved;
863 __u32 xrcd_handle;
864 __u32 cq_handle;
865 __u64 driver_data[0];
866};
867
Roland Dreierf520ba52005-08-18 12:24:13 -0700868struct ib_uverbs_create_srq_resp {
869 __u32 srq_handle;
Dotan Barakea88fd12006-02-23 12:36:18 -0800870 __u32 max_wr;
871 __u32 max_sge;
Sean Hefty8541f8d2011-05-25 17:08:38 -0700872 __u32 srqn;
Roland Dreierf520ba52005-08-18 12:24:13 -0700873};
874
875struct ib_uverbs_modify_srq {
876 __u32 srq_handle;
877 __u32 attr_mask;
878 __u32 max_wr;
Roland Dreierf520ba52005-08-18 12:24:13 -0700879 __u32 srq_limit;
Roland Dreierf520ba52005-08-18 12:24:13 -0700880 __u64 driver_data[0];
881};
882
Dotan Barak8bdb0e82006-02-13 16:31:57 -0800883struct ib_uverbs_query_srq {
884 __u64 response;
885 __u32 srq_handle;
886 __u32 reserved;
887 __u64 driver_data[0];
888};
889
890struct ib_uverbs_query_srq_resp {
891 __u32 max_wr;
892 __u32 max_sge;
893 __u32 srq_limit;
894 __u32 reserved;
895};
896
Roland Dreierf520ba52005-08-18 12:24:13 -0700897struct ib_uverbs_destroy_srq {
Roland Dreier63aaf642005-09-09 15:55:08 -0700898 __u64 response;
Roland Dreierf520ba52005-08-18 12:24:13 -0700899 __u32 srq_handle;
Roland Dreier63aaf642005-09-09 15:55:08 -0700900 __u32 reserved;
901};
902
903struct ib_uverbs_destroy_srq_resp {
904 __u32 events_reported;
Roland Dreierf520ba52005-08-18 12:24:13 -0700905};
906
Roland Dreier8a96b3f2005-07-07 17:57:12 -0700907#endif /* IB_USER_VERBS_H */