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