]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/uapi/rdma/ib_user_verbs.h
IB/core: Extend ib_uverbs_create_cq
[karo-tx-linux.git] / include / uapi / rdma / ib_user_verbs.h
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 #define IB_USER_VERBS_CMD_THRESHOLD    50
47
48 enum {
49         IB_USER_VERBS_CMD_GET_CONTEXT,
50         IB_USER_VERBS_CMD_QUERY_DEVICE,
51         IB_USER_VERBS_CMD_QUERY_PORT,
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,
66         IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
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,
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,
85         IB_USER_VERBS_CMD_POST_SRQ_RECV,
86         IB_USER_VERBS_CMD_OPEN_XRCD,
87         IB_USER_VERBS_CMD_CLOSE_XRCD,
88         IB_USER_VERBS_CMD_CREATE_XSRQ,
89         IB_USER_VERBS_CMD_OPEN_QP,
90 };
91
92 enum {
93         IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
94         IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
95         IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
96         IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
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
110 struct ib_uverbs_async_event_desc {
111         __u64 element;
112         __u32 event_type;       /* enum ib_event_type */
113         __u32 reserved;
114 };
115
116 struct 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
128 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
129 #define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u
130 #define IB_USER_VERBS_CMD_FLAGS_SHIFT 24
131
132 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80
133
134 struct ib_uverbs_cmd_hdr {
135         __u32 command;
136         __u16 in_words;
137         __u16 out_words;
138 };
139
140 struct ib_uverbs_ex_cmd_hdr {
141         __u64 response;
142         __u16 provider_in_words;
143         __u16 provider_out_words;
144         __u32 cmd_hdr_reserved;
145 };
146
147 struct ib_uverbs_get_context {
148         __u64 response;
149         __u64 driver_data[0];
150 };
151
152 struct ib_uverbs_get_context_resp {
153         __u32 async_fd;
154         __u32 num_comp_vectors;
155 };
156
157 struct ib_uverbs_query_device {
158         __u64 response;
159         __u64 driver_data[0];
160 };
161
162 struct ib_uverbs_query_device_resp {
163         __u64 fw_ver;
164         __be64 node_guid;
165         __be64 sys_image_guid;
166         __u64 max_mr_size;
167         __u64 page_size_cap;
168         __u32 vendor_id;
169         __u32 vendor_part_id;
170         __u32 hw_ver;
171         __u32 max_qp;
172         __u32 max_qp_wr;
173         __u32 device_cap_flags;
174         __u32 max_sge;
175         __u32 max_sge_rd;
176         __u32 max_cq;
177         __u32 max_cqe;
178         __u32 max_mr;
179         __u32 max_pd;
180         __u32 max_qp_rd_atom;
181         __u32 max_ee_rd_atom;
182         __u32 max_res_rd_atom;
183         __u32 max_qp_init_rd_atom;
184         __u32 max_ee_init_rd_atom;
185         __u32 atomic_cap;
186         __u32 max_ee;
187         __u32 max_rdd;
188         __u32 max_mw;
189         __u32 max_raw_ipv6_qp;
190         __u32 max_raw_ethy_qp;
191         __u32 max_mcast_grp;
192         __u32 max_mcast_qp_attach;
193         __u32 max_total_mcast_qp_attach;
194         __u32 max_ah;
195         __u32 max_fmr;
196         __u32 max_map_per_fmr;
197         __u32 max_srq;
198         __u32 max_srq_wr;
199         __u32 max_srq_sge;
200         __u16 max_pkeys;
201         __u8  local_ca_ack_delay;
202         __u8  phys_port_cnt;
203         __u8  reserved[4];
204 };
205
206 struct ib_uverbs_ex_query_device {
207         __u32 comp_mask;
208         __u32 reserved;
209 };
210
211 struct ib_uverbs_odp_caps {
212         __u64 general_caps;
213         struct {
214                 __u32 rc_odp_caps;
215                 __u32 uc_odp_caps;
216                 __u32 ud_odp_caps;
217         } per_transport_caps;
218         __u32 reserved;
219 };
220
221 struct ib_uverbs_ex_query_device_resp {
222         struct ib_uverbs_query_device_resp base;
223         __u32 comp_mask;
224         __u32 response_length;
225         struct ib_uverbs_odp_caps odp_caps;
226 };
227
228 struct ib_uverbs_query_port {
229         __u64 response;
230         __u8  port_num;
231         __u8  reserved[7];
232         __u64 driver_data[0];
233 };
234
235 struct ib_uverbs_query_port_resp {
236         __u32 port_cap_flags;
237         __u32 max_msg_sz;
238         __u32 bad_pkey_cntr;
239         __u32 qkey_viol_cntr;
240         __u32 gid_tbl_len;
241         __u16 pkey_tbl_len;
242         __u16 lid;
243         __u16 sm_lid;
244         __u8  state;
245         __u8  max_mtu;
246         __u8  active_mtu;
247         __u8  lmc;
248         __u8  max_vl_num;
249         __u8  sm_sl;
250         __u8  subnet_timeout;
251         __u8  init_type_reply;
252         __u8  active_width;
253         __u8  active_speed;
254         __u8  phys_state;
255         __u8  link_layer;
256         __u8  reserved[2];
257 };
258
259 struct ib_uverbs_alloc_pd {
260         __u64 response;
261         __u64 driver_data[0];
262 };
263
264 struct ib_uverbs_alloc_pd_resp {
265         __u32 pd_handle;
266 };
267
268 struct ib_uverbs_dealloc_pd {
269         __u32 pd_handle;
270 };
271
272 struct ib_uverbs_open_xrcd {
273         __u64 response;
274         __u32 fd;
275         __u32 oflags;
276         __u64 driver_data[0];
277 };
278
279 struct ib_uverbs_open_xrcd_resp {
280         __u32 xrcd_handle;
281 };
282
283 struct ib_uverbs_close_xrcd {
284         __u32 xrcd_handle;
285 };
286
287 struct ib_uverbs_reg_mr {
288         __u64 response;
289         __u64 start;
290         __u64 length;
291         __u64 hca_va;
292         __u32 pd_handle;
293         __u32 access_flags;
294         __u64 driver_data[0];
295 };
296
297 struct ib_uverbs_reg_mr_resp {
298         __u32 mr_handle;
299         __u32 lkey;
300         __u32 rkey;
301 };
302
303 struct ib_uverbs_rereg_mr {
304         __u64 response;
305         __u32 mr_handle;
306         __u32 flags;
307         __u64 start;
308         __u64 length;
309         __u64 hca_va;
310         __u32 pd_handle;
311         __u32 access_flags;
312 };
313
314 struct ib_uverbs_rereg_mr_resp {
315         __u32 lkey;
316         __u32 rkey;
317 };
318
319 struct ib_uverbs_dereg_mr {
320         __u32 mr_handle;
321 };
322
323 struct ib_uverbs_alloc_mw {
324         __u64 response;
325         __u32 pd_handle;
326         __u8  mw_type;
327         __u8  reserved[3];
328 };
329
330 struct ib_uverbs_alloc_mw_resp {
331         __u32 mw_handle;
332         __u32 rkey;
333 };
334
335 struct ib_uverbs_dealloc_mw {
336         __u32 mw_handle;
337 };
338
339 struct ib_uverbs_create_comp_channel {
340         __u64 response;
341 };
342
343 struct ib_uverbs_create_comp_channel_resp {
344         __u32 fd;
345 };
346
347 struct ib_uverbs_create_cq {
348         __u64 response;
349         __u64 user_handle;
350         __u32 cqe;
351         __u32 comp_vector;
352         __s32 comp_channel;
353         __u32 reserved;
354         __u64 driver_data[0];
355 };
356
357 struct ib_uverbs_ex_create_cq {
358         __u64 user_handle;
359         __u32 cqe;
360         __u32 comp_vector;
361         __s32 comp_channel;
362         __u32 comp_mask;
363         __u32 flags;
364         __u32 reserved;
365 };
366
367 struct ib_uverbs_create_cq_resp {
368         __u32 cq_handle;
369         __u32 cqe;
370 };
371
372 struct ib_uverbs_ex_create_cq_resp {
373         struct ib_uverbs_create_cq_resp base;
374         __u32 comp_mask;
375         __u32 response_length;
376 };
377
378 struct ib_uverbs_resize_cq {
379         __u64 response;
380         __u32 cq_handle;
381         __u32 cqe;
382         __u64 driver_data[0];
383 };
384
385 struct ib_uverbs_resize_cq_resp {
386         __u32 cqe;
387         __u32 reserved;
388         __u64 driver_data[0];
389 };
390
391 struct ib_uverbs_poll_cq {
392         __u64 response;
393         __u32 cq_handle;
394         __u32 ne;
395 };
396
397 struct ib_uverbs_wc {
398         __u64 wr_id;
399         __u32 status;
400         __u32 opcode;
401         __u32 vendor_err;
402         __u32 byte_len;
403         union {
404                 __u32 imm_data;
405                 __u32 invalidate_rkey;
406         } ex;
407         __u32 qp_num;
408         __u32 src_qp;
409         __u32 wc_flags;
410         __u16 pkey_index;
411         __u16 slid;
412         __u8 sl;
413         __u8 dlid_path_bits;
414         __u8 port_num;
415         __u8 reserved;
416 };
417
418 struct ib_uverbs_poll_cq_resp {
419         __u32 count;
420         __u32 reserved;
421         struct ib_uverbs_wc wc[0];
422 };
423
424 struct ib_uverbs_req_notify_cq {
425         __u32 cq_handle;
426         __u32 solicited_only;
427 };
428
429 struct ib_uverbs_destroy_cq {
430         __u64 response;
431         __u32 cq_handle;
432         __u32 reserved;
433 };
434
435 struct ib_uverbs_destroy_cq_resp {
436         __u32 comp_events_reported;
437         __u32 async_events_reported;
438 };
439
440 struct ib_uverbs_global_route {
441         __u8  dgid[16];
442         __u32 flow_label;
443         __u8  sgid_index;
444         __u8  hop_limit;
445         __u8  traffic_class;
446         __u8  reserved;
447 };
448
449 struct ib_uverbs_ah_attr {
450         struct ib_uverbs_global_route grh;
451         __u16 dlid;
452         __u8  sl;
453         __u8  src_path_bits;
454         __u8  static_rate;
455         __u8  is_global;
456         __u8  port_num;
457         __u8  reserved;
458 };
459
460 struct ib_uverbs_qp_attr {
461         __u32   qp_attr_mask;
462         __u32   qp_state;
463         __u32   cur_qp_state;
464         __u32   path_mtu;
465         __u32   path_mig_state;
466         __u32   qkey;
467         __u32   rq_psn;
468         __u32   sq_psn;
469         __u32   dest_qp_num;
470         __u32   qp_access_flags;
471
472         struct ib_uverbs_ah_attr ah_attr;
473         struct ib_uverbs_ah_attr alt_ah_attr;
474
475         /* ib_qp_cap */
476         __u32   max_send_wr;
477         __u32   max_recv_wr;
478         __u32   max_send_sge;
479         __u32   max_recv_sge;
480         __u32   max_inline_data;
481
482         __u16   pkey_index;
483         __u16   alt_pkey_index;
484         __u8    en_sqd_async_notify;
485         __u8    sq_draining;
486         __u8    max_rd_atomic;
487         __u8    max_dest_rd_atomic;
488         __u8    min_rnr_timer;
489         __u8    port_num;
490         __u8    timeout;
491         __u8    retry_cnt;
492         __u8    rnr_retry;
493         __u8    alt_port_num;
494         __u8    alt_timeout;
495         __u8    reserved[5];
496 };
497
498 struct ib_uverbs_create_qp {
499         __u64 response;
500         __u64 user_handle;
501         __u32 pd_handle;
502         __u32 send_cq_handle;
503         __u32 recv_cq_handle;
504         __u32 srq_handle;
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         __u8  sq_sig_all;
511         __u8  qp_type;
512         __u8  is_srq;
513         __u8  reserved;
514         __u64 driver_data[0];
515 };
516
517 struct ib_uverbs_open_qp {
518         __u64 response;
519         __u64 user_handle;
520         __u32 pd_handle;
521         __u32 qpn;
522         __u8  qp_type;
523         __u8  reserved[7];
524         __u64 driver_data[0];
525 };
526
527 /* also used for open response */
528 struct ib_uverbs_create_qp_resp {
529         __u32 qp_handle;
530         __u32 qpn;
531         __u32 max_send_wr;
532         __u32 max_recv_wr;
533         __u32 max_send_sge;
534         __u32 max_recv_sge;
535         __u32 max_inline_data;
536         __u32 reserved;
537 };
538
539 /*
540  * This struct needs to remain a multiple of 8 bytes to keep the
541  * alignment of the modify QP parameters.
542  */
543 struct ib_uverbs_qp_dest {
544         __u8  dgid[16];
545         __u32 flow_label;
546         __u16 dlid;
547         __u16 reserved;
548         __u8  sgid_index;
549         __u8  hop_limit;
550         __u8  traffic_class;
551         __u8  sl;
552         __u8  src_path_bits;
553         __u8  static_rate;
554         __u8  is_global;
555         __u8  port_num;
556 };
557
558 struct ib_uverbs_query_qp {
559         __u64 response;
560         __u32 qp_handle;
561         __u32 attr_mask;
562         __u64 driver_data[0];
563 };
564
565 struct ib_uverbs_query_qp_resp {
566         struct ib_uverbs_qp_dest dest;
567         struct ib_uverbs_qp_dest alt_dest;
568         __u32 max_send_wr;
569         __u32 max_recv_wr;
570         __u32 max_send_sge;
571         __u32 max_recv_sge;
572         __u32 max_inline_data;
573         __u32 qkey;
574         __u32 rq_psn;
575         __u32 sq_psn;
576         __u32 dest_qp_num;
577         __u32 qp_access_flags;
578         __u16 pkey_index;
579         __u16 alt_pkey_index;
580         __u8  qp_state;
581         __u8  cur_qp_state;
582         __u8  path_mtu;
583         __u8  path_mig_state;
584         __u8  sq_draining;
585         __u8  max_rd_atomic;
586         __u8  max_dest_rd_atomic;
587         __u8  min_rnr_timer;
588         __u8  port_num;
589         __u8  timeout;
590         __u8  retry_cnt;
591         __u8  rnr_retry;
592         __u8  alt_port_num;
593         __u8  alt_timeout;
594         __u8  sq_sig_all;
595         __u8  reserved[5];
596         __u64 driver_data[0];
597 };
598
599 struct ib_uverbs_modify_qp {
600         struct ib_uverbs_qp_dest dest;
601         struct ib_uverbs_qp_dest alt_dest;
602         __u32 qp_handle;
603         __u32 attr_mask;
604         __u32 qkey;
605         __u32 rq_psn;
606         __u32 sq_psn;
607         __u32 dest_qp_num;
608         __u32 qp_access_flags;
609         __u16 pkey_index;
610         __u16 alt_pkey_index;
611         __u8  qp_state;
612         __u8  cur_qp_state;
613         __u8  path_mtu;
614         __u8  path_mig_state;
615         __u8  en_sqd_async_notify;
616         __u8  max_rd_atomic;
617         __u8  max_dest_rd_atomic;
618         __u8  min_rnr_timer;
619         __u8  port_num;
620         __u8  timeout;
621         __u8  retry_cnt;
622         __u8  rnr_retry;
623         __u8  alt_port_num;
624         __u8  alt_timeout;
625         __u8  reserved[2];
626         __u64 driver_data[0];
627 };
628
629 struct ib_uverbs_modify_qp_resp {
630 };
631
632 struct ib_uverbs_destroy_qp {
633         __u64 response;
634         __u32 qp_handle;
635         __u32 reserved;
636 };
637
638 struct ib_uverbs_destroy_qp_resp {
639         __u32 events_reported;
640 };
641
642 /*
643  * The ib_uverbs_sge structure isn't used anywhere, since we assume
644  * the ib_sge structure is packed the same way on 32-bit and 64-bit
645  * architectures in both kernel and user space.  It's just here to
646  * document the ABI.
647  */
648 struct ib_uverbs_sge {
649         __u64 addr;
650         __u32 length;
651         __u32 lkey;
652 };
653
654 struct ib_uverbs_send_wr {
655         __u64 wr_id;
656         __u32 num_sge;
657         __u32 opcode;
658         __u32 send_flags;
659         union {
660                 __u32 imm_data;
661                 __u32 invalidate_rkey;
662         } ex;
663         union {
664                 struct {
665                         __u64 remote_addr;
666                         __u32 rkey;
667                         __u32 reserved;
668                 } rdma;
669                 struct {
670                         __u64 remote_addr;
671                         __u64 compare_add;
672                         __u64 swap;
673                         __u32 rkey;
674                         __u32 reserved;
675                 } atomic;
676                 struct {
677                         __u32 ah;
678                         __u32 remote_qpn;
679                         __u32 remote_qkey;
680                         __u32 reserved;
681                 } ud;
682         } wr;
683 };
684
685 struct ib_uverbs_post_send {
686         __u64 response;
687         __u32 qp_handle;
688         __u32 wr_count;
689         __u32 sge_count;
690         __u32 wqe_size;
691         struct ib_uverbs_send_wr send_wr[0];
692 };
693
694 struct ib_uverbs_post_send_resp {
695         __u32 bad_wr;
696 };
697
698 struct ib_uverbs_recv_wr {
699         __u64 wr_id;
700         __u32 num_sge;
701         __u32 reserved;
702 };
703
704 struct ib_uverbs_post_recv {
705         __u64 response;
706         __u32 qp_handle;
707         __u32 wr_count;
708         __u32 sge_count;
709         __u32 wqe_size;
710         struct ib_uverbs_recv_wr recv_wr[0];
711 };
712
713 struct ib_uverbs_post_recv_resp {
714         __u32 bad_wr;
715 };
716
717 struct ib_uverbs_post_srq_recv {
718         __u64 response;
719         __u32 srq_handle;
720         __u32 wr_count;
721         __u32 sge_count;
722         __u32 wqe_size;
723         struct ib_uverbs_recv_wr recv[0];
724 };
725
726 struct ib_uverbs_post_srq_recv_resp {
727         __u32 bad_wr;
728 };
729
730 struct ib_uverbs_create_ah {
731         __u64 response;
732         __u64 user_handle;
733         __u32 pd_handle;
734         __u32 reserved;
735         struct ib_uverbs_ah_attr attr;
736 };
737
738 struct ib_uverbs_create_ah_resp {
739         __u32 ah_handle;
740 };
741
742 struct ib_uverbs_destroy_ah {
743         __u32 ah_handle;
744 };
745
746 struct ib_uverbs_attach_mcast {
747         __u8  gid[16];
748         __u32 qp_handle;
749         __u16 mlid;
750         __u16 reserved;
751         __u64 driver_data[0];
752 };
753
754 struct ib_uverbs_detach_mcast {
755         __u8  gid[16];
756         __u32 qp_handle;
757         __u16 mlid;
758         __u16 reserved;
759         __u64 driver_data[0];
760 };
761
762 struct ib_uverbs_flow_spec_hdr {
763         __u32 type;
764         __u16 size;
765         __u16 reserved;
766         /* followed by flow_spec */
767         __u64 flow_spec_data[0];
768 };
769
770 struct ib_uverbs_flow_eth_filter {
771         __u8  dst_mac[6];
772         __u8  src_mac[6];
773         __be16 ether_type;
774         __be16 vlan_tag;
775 };
776
777 struct ib_uverbs_flow_spec_eth {
778         union {
779                 struct ib_uverbs_flow_spec_hdr hdr;
780                 struct {
781                         __u32 type;
782                         __u16 size;
783                         __u16 reserved;
784                 };
785         };
786         struct ib_uverbs_flow_eth_filter val;
787         struct ib_uverbs_flow_eth_filter mask;
788 };
789
790 struct ib_uverbs_flow_ipv4_filter {
791         __be32 src_ip;
792         __be32 dst_ip;
793 };
794
795 struct ib_uverbs_flow_spec_ipv4 {
796         union {
797                 struct ib_uverbs_flow_spec_hdr hdr;
798                 struct {
799                         __u32 type;
800                         __u16 size;
801                         __u16 reserved;
802                 };
803         };
804         struct ib_uverbs_flow_ipv4_filter val;
805         struct ib_uverbs_flow_ipv4_filter mask;
806 };
807
808 struct ib_uverbs_flow_tcp_udp_filter {
809         __be16 dst_port;
810         __be16 src_port;
811 };
812
813 struct ib_uverbs_flow_spec_tcp_udp {
814         union {
815                 struct ib_uverbs_flow_spec_hdr hdr;
816                 struct {
817                         __u32 type;
818                         __u16 size;
819                         __u16 reserved;
820                 };
821         };
822         struct ib_uverbs_flow_tcp_udp_filter val;
823         struct ib_uverbs_flow_tcp_udp_filter mask;
824 };
825
826 struct ib_uverbs_flow_attr {
827         __u32 type;
828         __u16 size;
829         __u16 priority;
830         __u8  num_of_specs;
831         __u8  reserved[2];
832         __u8  port;
833         __u32 flags;
834         /* Following are the optional layers according to user request
835          * struct ib_flow_spec_xxx
836          * struct ib_flow_spec_yyy
837          */
838         struct ib_uverbs_flow_spec_hdr flow_specs[0];
839 };
840
841 struct ib_uverbs_create_flow  {
842         __u32 comp_mask;
843         __u32 qp_handle;
844         struct ib_uverbs_flow_attr flow_attr;
845 };
846
847 struct ib_uverbs_create_flow_resp {
848         __u32 comp_mask;
849         __u32 flow_handle;
850 };
851
852 struct ib_uverbs_destroy_flow  {
853         __u32 comp_mask;
854         __u32 flow_handle;
855 };
856
857 struct ib_uverbs_create_srq {
858         __u64 response;
859         __u64 user_handle;
860         __u32 pd_handle;
861         __u32 max_wr;
862         __u32 max_sge;
863         __u32 srq_limit;
864         __u64 driver_data[0];
865 };
866
867 struct ib_uverbs_create_xsrq {
868         __u64 response;
869         __u64 user_handle;
870         __u32 srq_type;
871         __u32 pd_handle;
872         __u32 max_wr;
873         __u32 max_sge;
874         __u32 srq_limit;
875         __u32 reserved;
876         __u32 xrcd_handle;
877         __u32 cq_handle;
878         __u64 driver_data[0];
879 };
880
881 struct ib_uverbs_create_srq_resp {
882         __u32 srq_handle;
883         __u32 max_wr;
884         __u32 max_sge;
885         __u32 srqn;
886 };
887
888 struct ib_uverbs_modify_srq {
889         __u32 srq_handle;
890         __u32 attr_mask;
891         __u32 max_wr;
892         __u32 srq_limit;
893         __u64 driver_data[0];
894 };
895
896 struct ib_uverbs_query_srq {
897         __u64 response;
898         __u32 srq_handle;
899         __u32 reserved;
900         __u64 driver_data[0];
901 };
902
903 struct ib_uverbs_query_srq_resp {
904         __u32 max_wr;
905         __u32 max_sge;
906         __u32 srq_limit;
907         __u32 reserved;
908 };
909
910 struct ib_uverbs_destroy_srq {
911         __u64 response;
912         __u32 srq_handle;
913         __u32 reserved;
914 };
915
916 struct ib_uverbs_destroy_srq_resp {
917         __u32 events_reported;
918 };
919
920 #endif /* IB_USER_VERBS_H */