1 /*
2  * This file contains definitions used in OFED defined user/kernel
3  * interfaces. These are imported from the OFED header ib_user_verbs.h. Oracle
4  * elects to have and use the contents of ib_user_verbs.h under and governed
5  * by the OpenIB.org BSD license (see below for full license text). However,
6  * the following notice accompanied the original version of this file:
7  */
8 
9 /*
10  * Copyright (c) 2005 Topspin Communications.  All rights reserved.
11  * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
12  * Copyright (c) 2005 PathScale, Inc.  All rights reserved.
13  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
14  *
15  * This software is available to you under a choice of one of two
16  * licenses.  You may choose to be licensed under the terms of the GNU
17  * General Public License (GPL) Version 2, available from the file
18  * COPYING in the main directory of this source tree, or the
19  * OpenIB.org BSD license below:
20  *
21  *     Redistribution and use in source and binary forms, with or
22  *     without modification, are permitted provided that the following
23  *     conditions are met:
24  *
25  *      - Redistributions of source code must retain the above
26  *        copyright notice, this list of conditions and the following
27  *        disclaimer.
28  *
29  *      - Redistributions in binary form must reproduce the above
30  *        copyright notice, this list of conditions and the following
31  *        disclaimer in the documentation and/or other materials
32  *        provided with the distribution.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
38  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
39  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41  * SOFTWARE.
42  *
43  */
44 
45 #ifndef _SYS_IB_CLIENTS_OF_RDMA_IB_USER_VERBS_H
46 #define	_SYS_IB_CLIENTS_OF_RDMA_IB_USER_VERBS_H
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /*
53  * Increment this value if any changes that break userspace ABI
54  * compatibility are made.
55  */
56 #define	IB_USER_VERBS_ABI_VERSION	6
57 
58 enum {
59 	IB_USER_VERBS_CMD_GET_CONTEXT,
60 	IB_USER_VERBS_CMD_QUERY_DEVICE,
61 	IB_USER_VERBS_CMD_QUERY_PORT,
62 	IB_USER_VERBS_CMD_ALLOC_PD,
63 	IB_USER_VERBS_CMD_DEALLOC_PD,
64 	IB_USER_VERBS_CMD_CREATE_AH,
65 	IB_USER_VERBS_CMD_MODIFY_AH,
66 	IB_USER_VERBS_CMD_QUERY_AH,
67 	IB_USER_VERBS_CMD_DESTROY_AH,
68 	IB_USER_VERBS_CMD_REG_MR,
69 	IB_USER_VERBS_CMD_REG_SMR,
70 	IB_USER_VERBS_CMD_REREG_MR,
71 	IB_USER_VERBS_CMD_QUERY_MR,
72 	IB_USER_VERBS_CMD_DEREG_MR,
73 	IB_USER_VERBS_CMD_ALLOC_MW,
74 	IB_USER_VERBS_CMD_BIND_MW,
75 	IB_USER_VERBS_CMD_DEALLOC_MW,
76 	IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
77 	IB_USER_VERBS_CMD_CREATE_CQ,
78 	IB_USER_VERBS_CMD_RESIZE_CQ,
79 	IB_USER_VERBS_CMD_DESTROY_CQ,
80 	IB_USER_VERBS_CMD_POLL_CQ,
81 	IB_USER_VERBS_CMD_PEEK_CQ,
82 	IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
83 	IB_USER_VERBS_CMD_CREATE_QP,
84 	IB_USER_VERBS_CMD_QUERY_QP,
85 	IB_USER_VERBS_CMD_MODIFY_QP,
86 	IB_USER_VERBS_CMD_DESTROY_QP,
87 	IB_USER_VERBS_CMD_POST_SEND,
88 	IB_USER_VERBS_CMD_POST_RECV,
89 	IB_USER_VERBS_CMD_ATTACH_MCAST,
90 	IB_USER_VERBS_CMD_DETACH_MCAST,
91 	IB_USER_VERBS_CMD_CREATE_SRQ,
92 	IB_USER_VERBS_CMD_MODIFY_SRQ,
93 	IB_USER_VERBS_CMD_QUERY_SRQ,
94 	IB_USER_VERBS_CMD_DESTROY_SRQ,
95 	IB_USER_VERBS_CMD_POST_SRQ_RECV,
96 	IB_USER_VERBS_CMD_CREATE_XRC_SRQ,
97 	IB_USER_VERBS_CMD_OPEN_XRC_DOMAIN,
98 	IB_USER_VERBS_CMD_CLOSE_XRC_DOMAIN,
99 	IB_USER_VERBS_CMD_CREATE_XRC_RCV_QP,
100 	IB_USER_VERBS_CMD_MODIFY_XRC_RCV_QP,
101 	IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP,
102 	IB_USER_VERBS_CMD_REG_XRC_RCV_QP,
103 	IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP,
104 	IB_USER_VERBS_CMD_QUERY_GID,
105 	IB_USER_VERBS_CMD_QUERY_PKEY
106 };
107 
108 /*
109  * Make sure that all structs defined in this file remain laid out so
110  * that they pack the same way on 32-bit and 64-bit architectures (to
111  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
112  * Specifically:
113  *  - Do not use pointer types -- pass pointers in uint64_t instead.
114  *  - Make sure that any structure larger than 4 bytes is padded to a
115  *    multiple of 8 bytes.  Otherwise the structure size will be
116  *    different between 32-bit and 64-bit architectures.
117  */
118 
119 struct ib_uverbs_async_event_desc {
120 	uint64_t element;
121 	uint32_t event_type;	/* enum ib_event_type */
122 	uint32_t reserved;
123 };
124 
125 struct ib_uverbs_comp_event_desc {
126 	uint64_t cq_handle;
127 };
128 
129 /*
130  * All commands from userspace should start with a uint32_t command field
131  * followed by uint16_t in_words and out_words fields (which give the
132  * length of the command block and response buffer if any in 32-bit
133  * words).  The kernel driver will read these fields first and read
134  * the rest of the command struct based on these value.
135  */
136 
137 struct ib_uverbs_cmd_hdr {
138 	uint32_t command;
139 	uint16_t in_words;
140 	uint16_t out_words;
141 };
142 
143 struct ib_uverbs_get_context {
144 	ofv_resp_addr_t response;
145 	uint64_t driver_data[];
146 };
147 
148 struct ib_uverbs_get_context_resp {
149 	uint32_t async_fd;
150 	uint32_t num_comp_vectors;
151 };
152 
153 struct ib_uverbs_query_device {
154 	ofv_resp_addr_t response;
155 	uint64_t driver_data[];
156 };
157 
158 struct ib_uverbs_query_device_resp {
159 	uint64_t fw_ver;
160 	uint64_t node_guid;
161 	uint64_t sys_image_guid;
162 	uint64_t max_mr_size;
163 	uint64_t page_size_cap;
164 	uint32_t vendor_id;
165 	uint32_t vendor_part_id;
166 	uint32_t hw_ver;
167 	uint32_t max_qp;
168 	uint32_t max_qp_wr;
169 	uint32_t device_cap_flags;
170 	uint32_t max_sge;
171 	uint32_t max_sge_rd;
172 	uint32_t max_cq;
173 	uint32_t max_cqe;
174 	uint32_t max_mr;
175 	uint32_t max_pd;
176 	uint32_t max_qp_rd_atom;
177 	uint32_t max_ee_rd_atom;
178 	uint32_t max_res_rd_atom;
179 	uint32_t max_qp_init_rd_atom;
180 	uint32_t max_ee_init_rd_atom;
181 	uint32_t atomic_cap;
182 	uint32_t max_ee;
183 	uint32_t max_rdd;
184 	uint32_t max_mw;
185 	uint32_t max_raw_ipv6_qp;
186 	uint32_t max_raw_ethy_qp;
187 	uint32_t max_mcast_grp;
188 	uint32_t max_mcast_qp_attach;
189 	uint32_t max_total_mcast_qp_attach;
190 	uint32_t max_ah;
191 	uint32_t max_fmr;
192 	uint32_t max_map_per_fmr;
193 	uint32_t max_srq;
194 	uint32_t max_srq_wr;
195 	uint32_t max_srq_sge;
196 	uint16_t max_pkeys;
197 	uint8_t  local_ca_ack_delay;
198 	uint8_t  phys_port_cnt;
199 	uint8_t  reserved[4];
200 };
201 
202 struct ib_uverbs_query_port {
203 	ofv_resp_addr_t response;
204 	uint8_t  port_num;
205 	uint8_t  reserved[7];
206 	uint64_t driver_data[];
207 };
208 
209 struct ib_uverbs_query_port_resp {
210 	uint32_t port_cap_flags;
211 	uint32_t max_msg_sz;
212 	uint32_t bad_pkey_cntr;
213 	uint32_t qkey_viol_cntr;
214 	uint32_t gid_tbl_len;
215 	uint16_t pkey_tbl_len;
216 	uint16_t lid;
217 	uint16_t sm_lid;
218 	uint8_t  state;
219 	uint8_t  max_mtu;
220 	uint8_t  active_mtu;
221 	uint8_t  lmc;
222 	uint8_t  max_vl_num;
223 	uint8_t  sm_sl;
224 	uint8_t  subnet_timeout;
225 	uint8_t  init_type_reply;
226 	uint8_t  active_width;
227 	uint8_t  active_speed;
228 	uint8_t  phys_state;
229 	uint8_t  reserved[3];
230 };
231 
232 struct ib_uverbs_query_gid {
233 	ofv_resp_addr_t response;
234 	uint32_t  gid_index;
235 	uint8_t   port_num;
236 	uint8_t   reserved[3];
237 	uint64_t  driver_data;
238 };
239 
240 struct ib_uverbs_query_gid_resp {
241 	uint8_t   gid[16];
242 };
243 
244 struct ib_uverbs_query_pkey {
245 	ofv_resp_addr_t response;
246 	uint32_t  pkey_index;
247 	uint8_t   port_num;
248 	uint8_t   reserved[3];
249 	uint64_t  driver_data;
250 };
251 
252 struct ib_uverbs_query_pkey_resp {
253 	uint16_t  pkey;
254 	uint16_t  reserved;
255 };
256 
257 struct ib_uverbs_alloc_pd {
258 	ofv_resp_addr_t response;
259 	uint64_t driver_data[];
260 };
261 
262 /*
263  * PD responses may pass opaque data to userspace drivers, we choose a value
264  * larger than what any HCA requires.
265  */
266 #define	SOL_UVERBS_PD_DATA_OUT_SIZE	24
267 typedef uint64_t uverbs_pd_drv_out_data_t[SOL_UVERBS_PD_DATA_OUT_SIZE];
268 
269 struct ib_uverbs_alloc_pd_resp {
270 	uint32_t  pd_handle;
271 	uint32_t  reserved;
272 	uverbs_pd_drv_out_data_t drv_out;
273 };
274 
275 struct ib_uverbs_dealloc_pd {
276 	uint32_t pd_handle;
277 };
278 
279 struct ib_uverbs_reg_mr {
280 	ofv_resp_addr_t response;
281 	uint64_t start;
282 	uint64_t length;
283 	uint64_t hca_va;
284 	uint32_t pd_handle;
285 	uint32_t access_flags;
286 	uint64_t driver_data[];
287 };
288 
289 struct ib_uverbs_reg_mr_resp {
290 	uint32_t mr_handle;
291 	uint32_t lkey;
292 	uint32_t rkey;
293 };
294 
295 struct ib_uverbs_dereg_mr {
296 	uint32_t mr_handle;
297 };
298 
299 struct ib_uverbs_create_comp_channel {
300 	ofv_resp_addr_t response;
301 };
302 
303 struct ib_uverbs_create_comp_channel_resp {
304 	uint32_t fd;
305 };
306 
307 struct ib_uverbs_create_cq {
308 	ofv_resp_addr_t response;
309 	uint64_t user_handle;
310 	uint32_t cqe;
311 	uint32_t comp_vector;
312 	int32_t  comp_channel;
313 	uint32_t reserved;
314 	uint64_t driver_data[];
315 };
316 
317 /*
318  * CQ responses pass opaque data to userspace drivers, we choose a value
319  * larger than what any HCA requires.
320  */
321 #define	SOL_UVERBS_CQ_DATA_OUT_SIZE	24
322 typedef uint64_t uverbs_cq_drv_out_data_t[SOL_UVERBS_CQ_DATA_OUT_SIZE];
323 
324 struct ib_uverbs_create_cq_resp {
325 	uint32_t  cq_handle;
326 	uint32_t  cqe;
327 	uverbs_cq_drv_out_data_t  drv_out;
328 };
329 
330 struct ib_uverbs_resize_cq {
331 	ofv_resp_addr_t response;
332 	uint32_t cq_handle;
333 	uint32_t cqe;
334 	uint64_t driver_data[];
335 };
336 
337 struct ib_uverbs_resize_cq_resp {
338 	uint32_t cqe;
339 	uint32_t reserved;
340 	uverbs_cq_drv_out_data_t  drv_out;
341 };
342 
343 struct ib_uverbs_poll_cq {
344 	ofv_resp_addr_t response;
345 	uint32_t cq_handle;
346 	uint32_t ne;
347 };
348 
349 struct ib_uverbs_wc {
350 	uint64_t wr_id;
351 	uint32_t status;
352 	uint32_t opcode;
353 	uint32_t vendor_err;
354 	uint32_t byte_len;
355 	uint32_t imm_data;
356 	uint32_t qp_num;
357 	uint32_t src_qp;
358 	uint32_t wc_flags;
359 	uint16_t pkey_index;
360 	uint16_t slid;
361 	uint8_t  sl;
362 	uint8_t  dlid_path_bits;
363 	uint8_t  port_num;
364 	uint8_t  reserved;
365 };
366 
367 struct ib_uverbs_poll_cq_resp {
368 	uint32_t count;
369 	uint32_t reserved;
370 	struct ib_uverbs_wc wc[];
371 };
372 
373 struct ib_uverbs_req_notify_cq {
374 	uint32_t cq_handle;
375 	uint32_t solicited_only;
376 };
377 
378 struct ib_uverbs_destroy_cq {
379 	ofv_resp_addr_t response;
380 	uint32_t cq_handle;
381 	uint32_t reserved;
382 };
383 
384 struct ib_uverbs_destroy_cq_resp {
385 	uint32_t comp_events_reported;
386 	uint32_t async_events_reported;
387 };
388 
389 struct ib_uverbs_global_route {
390 	uint8_t  dgid[16];
391 	uint32_t flow_label;
392 	uint8_t  sgid_index;
393 	uint8_t  hop_limit;
394 	uint8_t  traffic_class;
395 	uint8_t  reserved;
396 };
397 
398 struct ib_uverbs_ah_attr {
399 	struct ib_uverbs_global_route grh;
400 	uint16_t dlid;
401 	uint8_t  sl;
402 	uint8_t  src_path_bits;
403 	uint8_t  static_rate;
404 	uint8_t  is_global;
405 	uint8_t  port_num;
406 	uint8_t  reserved;
407 };
408 
409 struct ib_uverbs_qp_attr {
410 	uint32_t	qp_attr_mask;
411 	uint32_t	qp_state;
412 	uint32_t	cur_qp_state;
413 	uint32_t	path_mtu;
414 	uint32_t	path_mig_state;
415 	uint32_t	qkey;
416 	uint32_t	rq_psn;
417 	uint32_t	sq_psn;
418 	uint32_t	dest_qp_num;
419 	uint32_t	qp_access_flags;
420 
421 	struct ib_uverbs_ah_attr ah_attr;
422 	struct ib_uverbs_ah_attr alt_ah_attr;
423 
424 	/* ib_qp_cap */
425 	uint32_t	max_send_wr;
426 	uint32_t	max_recv_wr;
427 	uint32_t	max_send_sge;
428 	uint32_t	max_recv_sge;
429 	uint32_t	max_inline_data;
430 
431 	uint16_t	pkey_index;
432 	uint16_t	alt_pkey_index;
433 	uint8_t		en_sqd_async_notify;
434 	uint8_t		sq_draining;
435 	uint8_t		max_rd_atomic;
436 	uint8_t		max_dest_rd_atomic;
437 	uint8_t		min_rnr_timer;
438 	uint8_t		port_num;
439 	uint8_t		timeout;
440 	uint8_t		retry_cnt;
441 	uint8_t		rnr_retry;
442 	uint8_t		alt_port_num;
443 	uint8_t		alt_timeout;
444 	uint8_t		reserved[5];
445 };
446 
447 struct ib_uverbs_create_qp {
448 	ofv_resp_addr_t response;
449 	uint64_t user_handle;
450 	uint32_t pd_handle;
451 	uint32_t send_cq_handle;
452 	uint32_t recv_cq_handle;
453 	uint32_t srq_handle;
454 	uint32_t max_send_wr;
455 	uint32_t max_recv_wr;
456 	uint32_t max_send_sge;
457 	uint32_t max_recv_sge;
458 	uint32_t max_inline_data;
459 	uint8_t  sq_sig_all;
460 	uint8_t  qp_type;
461 	uint8_t  is_srq;
462 	uint8_t  reserved;
463 	uint64_t driver_data[];
464 };
465 
466 /*
467  * QP responses pass opaque data to userspace drivers, we choose a value
468  * larger than what any HCA requires.
469  */
470 #define	SOL_UVERBS_QP_DATA_OUT_SIZE	24
471 typedef uint64_t uverbs_qp_drv_out_data_t[SOL_UVERBS_QP_DATA_OUT_SIZE];
472 
473 struct ib_uverbs_create_qp_resp {
474 	uint32_t qp_handle;
475 	uint32_t qpn;
476 	uint32_t max_send_wr;
477 	uint32_t max_recv_wr;
478 	uint32_t max_send_sge;
479 	uint32_t max_recv_sge;
480 	uint32_t max_inline_data;
481 	uint32_t reserved;
482 	uverbs_qp_drv_out_data_t drv_out;
483 };
484 
485 /*
486  * This struct needs to remain a multiple of 8 bytes to keep the
487  * alignment of the modify QP parameters.
488  */
489 struct ib_uverbs_qp_dest {
490 	uint8_t  dgid[16];
491 	uint32_t flow_label;
492 	uint16_t dlid;
493 	uint16_t reserved;
494 	uint8_t  sgid_index;
495 	uint8_t  hop_limit;
496 	uint8_t  traffic_class;
497 	uint8_t  sl;
498 	uint8_t  src_path_bits;
499 	uint8_t  static_rate;
500 	uint8_t  is_global;
501 	uint8_t  port_num;
502 };
503 
504 struct ib_uverbs_query_qp {
505 	ofv_resp_addr_t response;
506 	uint32_t qp_handle;
507 	uint32_t attr_mask;
508 	uint64_t driver_data[];
509 };
510 
511 struct ib_uverbs_query_qp_resp {
512 	struct ib_uverbs_qp_dest dest;
513 	struct ib_uverbs_qp_dest alt_dest;
514 	uint32_t max_send_wr;
515 	uint32_t max_recv_wr;
516 	uint32_t max_send_sge;
517 	uint32_t max_recv_sge;
518 	uint32_t max_inline_data;
519 	uint32_t qkey;
520 	uint32_t rq_psn;
521 	uint32_t sq_psn;
522 	uint32_t dest_qp_num;
523 	uint32_t qp_access_flags;
524 	uint16_t pkey_index;
525 	uint16_t alt_pkey_index;
526 	uint8_t  qp_state;
527 	uint8_t  cur_qp_state;
528 	uint8_t  path_mtu;
529 	uint8_t  path_mig_state;
530 	uint8_t  sq_draining;
531 	uint8_t  max_rd_atomic;
532 	uint8_t  max_dest_rd_atomic;
533 	uint8_t  min_rnr_timer;
534 	uint8_t  port_num;
535 	uint8_t  timeout;
536 	uint8_t  retry_cnt;
537 	uint8_t  rnr_retry;
538 	uint8_t  alt_port_num;
539 	uint8_t  alt_timeout;
540 	uint8_t  sq_sig_all;
541 	uint8_t  reserved[5];
542 	uint64_t driver_data[];
543 };
544 
545 struct ib_uverbs_modify_qp {
546 	struct ib_uverbs_qp_dest dest;
547 	struct ib_uverbs_qp_dest alt_dest;
548 	uint32_t qp_handle;
549 	uint32_t attr_mask;
550 	uint32_t qkey;
551 	uint32_t rq_psn;
552 	uint32_t sq_psn;
553 	uint32_t dest_qp_num;
554 	uint32_t qp_access_flags;
555 	uint16_t pkey_index;
556 	uint16_t alt_pkey_index;
557 	uint8_t  qp_state;
558 	uint8_t  cur_qp_state;
559 	uint8_t  path_mtu;
560 	uint8_t  path_mig_state;
561 	uint8_t  en_sqd_async_notify;
562 	uint8_t  max_rd_atomic;
563 	uint8_t  max_dest_rd_atomic;
564 	uint8_t  min_rnr_timer;
565 	uint8_t  port_num;
566 	uint8_t  timeout;
567 	uint8_t  retry_cnt;
568 	uint8_t  rnr_retry;
569 	uint8_t  alt_port_num;
570 	uint8_t  alt_timeout;
571 	uint8_t  reserved[2];
572 	uint64_t driver_data[];
573 };
574 
575 
576 struct ib_uverbs_destroy_qp {
577 	ofv_resp_addr_t response;
578 	uint32_t qp_handle;
579 	uint32_t reserved;
580 };
581 
582 struct ib_uverbs_destroy_qp_resp {
583 	uint32_t events_reported;
584 };
585 
586 /*
587  * The ib_uverbs_sge structure isn't used anywhere, since we assume
588  * the ib_sge structure is packed the same way on 32-bit and 64-bit
589  * architectures in both kernel and user space.  It's just here to
590  * document the ABI.
591  */
592 struct ib_uverbs_sge {
593 	uint64_t addr;
594 	uint32_t length;
595 	uint32_t lkey;
596 };
597 
598 struct ib_uverbs_send_wr {
599 	uint64_t wr_id;
600 	uint32_t num_sge;
601 	uint32_t opcode;
602 	uint32_t send_flags;
603 	uint32_t imm_data;
604 	union {
605 		struct {
606 			uint64_t remote_addr;
607 			uint32_t rkey;
608 			uint32_t reserved;
609 		} rdma;
610 		struct {
611 			uint64_t remote_addr;
612 			uint64_t compare_add;
613 			uint64_t swap;
614 			uint32_t rkey;
615 			uint32_t reserved;
616 		} atomic;
617 		struct {
618 			uint32_t ah;
619 			uint32_t remote_qpn;
620 			uint32_t remote_qkey;
621 			uint32_t reserved;
622 		} ud;
623 	} wr;
624 };
625 
626 struct ib_uverbs_post_send {
627 	uint64_t response;
628 	uint32_t qp_handle;
629 	uint32_t wr_count;
630 	uint32_t sge_count;
631 	uint32_t wqe_size;
632 	struct ib_uverbs_send_wr send_wr[];
633 };
634 
635 struct ib_uverbs_post_send_resp {
636 	uint32_t bad_wr;
637 };
638 
639 struct ib_uverbs_recv_wr {
640 	uint64_t wr_id;
641 	uint32_t num_sge;
642 	uint32_t reserved;
643 };
644 
645 struct ib_uverbs_post_recv {
646 	uint64_t response;
647 	uint32_t qp_handle;
648 	uint32_t wr_count;
649 	uint32_t sge_count;
650 	uint32_t wqe_size;
651 	struct ib_uverbs_recv_wr recv_wr[];
652 };
653 
654 struct ib_uverbs_post_recv_resp {
655 	uint32_t bad_wr;
656 };
657 
658 struct ib_uverbs_post_srq_recv {
659 	uint64_t response;
660 	uint32_t srq_handle;
661 	uint32_t wr_count;
662 	uint32_t sge_count;
663 	uint32_t wqe_size;
664 	struct ib_uverbs_recv_wr recv[];
665 };
666 
667 struct ib_uverbs_post_srq_recv_resp {
668 	uint32_t bad_wr;
669 };
670 
671 struct ib_uverbs_create_ah {
672 	uint64_t response;
673 	uint64_t user_handle;
674 	uint32_t pd_handle;
675 	uint32_t reserved;
676 	struct ib_uverbs_ah_attr attr;
677 };
678 
679 struct ib_uverbs_create_ah_resp {
680 	uint32_t ah_handle;
681 };
682 
683 struct ib_uverbs_destroy_ah {
684 	uint32_t ah_handle;
685 };
686 
687 struct ib_uverbs_attach_mcast {
688 	uint8_t  gid[16];
689 	uint32_t qp_handle;
690 	uint16_t mlid;
691 	uint16_t reserved;
692 	uint64_t driver_data[];
693 };
694 
695 struct ib_uverbs_detach_mcast {
696 	uint8_t  gid[16];
697 	uint32_t qp_handle;
698 	uint16_t mlid;
699 	uint16_t reserved;
700 	uint64_t driver_data[];
701 };
702 
703 struct ib_uverbs_create_srq {
704 	ofv_resp_addr_t response;
705 	uint64_t user_handle;
706 	uint32_t pd_handle;
707 	uint32_t max_wr;
708 	uint32_t max_sge;
709 	uint32_t srq_limit;
710 	uint64_t driver_data[];
711 };
712 
713 /*
714  * SRQ responses pass opaque data to userspace drivers, we choose a value
715  * larger than what any HCA requires.
716  */
717 #define	SOL_UVERBS_SRQ_DATA_OUT_SIZE	24
718 typedef uint64_t uverbs_srq_drv_out_data_t[SOL_UVERBS_SRQ_DATA_OUT_SIZE];
719 
720 struct ib_uverbs_create_srq_resp {
721 	uint32_t srq_handle;
722 	uint32_t max_wr;
723 	uint32_t max_sge;
724 	uint32_t reserved;
725 	uverbs_srq_drv_out_data_t  drv_out;
726 };
727 
728 struct ib_uverbs_modify_srq {
729 	uint32_t srq_handle;
730 	uint32_t attr_mask;
731 	uint32_t max_wr;
732 	uint32_t srq_limit;
733 	uint64_t driver_data[];
734 };
735 
736 struct ib_uverbs_query_srq {
737 	ofv_resp_addr_t response;
738 	uint32_t srq_handle;
739 	uint32_t reserved;
740 	uint64_t driver_data[];
741 };
742 
743 struct ib_uverbs_query_srq_resp {
744 	uint32_t max_wr;
745 	uint32_t max_sge;
746 	uint32_t srq_limit;
747 	uint32_t reserved;
748 };
749 
750 struct ib_uverbs_destroy_srq {
751 	ofv_resp_addr_t response;
752 	uint32_t srq_handle;
753 	uint32_t reserved;
754 };
755 
756 struct ib_uverbs_destroy_srq_resp {
757 	uint32_t events_reported;
758 };
759 
760 #ifdef __cplusplus
761 }
762 #endif
763 #endif /* _SYS_IB_CLIENTS_OF_RDMA_IB_USER_VERBS_H */
764