1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef IB_USER_VERBS_H
20 #define IB_USER_VERBS_H
21 #include <linux/types.h>
22 #define IB_USER_VERBS_ABI_VERSION 6
23 #define IB_USER_VERBS_CMD_THRESHOLD 50
24 enum ib_uverbs_write_cmds {
25   IB_USER_VERBS_CMD_GET_CONTEXT,
26   IB_USER_VERBS_CMD_QUERY_DEVICE,
27   IB_USER_VERBS_CMD_QUERY_PORT,
28   IB_USER_VERBS_CMD_ALLOC_PD,
29   IB_USER_VERBS_CMD_DEALLOC_PD,
30   IB_USER_VERBS_CMD_CREATE_AH,
31   IB_USER_VERBS_CMD_MODIFY_AH,
32   IB_USER_VERBS_CMD_QUERY_AH,
33   IB_USER_VERBS_CMD_DESTROY_AH,
34   IB_USER_VERBS_CMD_REG_MR,
35   IB_USER_VERBS_CMD_REG_SMR,
36   IB_USER_VERBS_CMD_REREG_MR,
37   IB_USER_VERBS_CMD_QUERY_MR,
38   IB_USER_VERBS_CMD_DEREG_MR,
39   IB_USER_VERBS_CMD_ALLOC_MW,
40   IB_USER_VERBS_CMD_BIND_MW,
41   IB_USER_VERBS_CMD_DEALLOC_MW,
42   IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
43   IB_USER_VERBS_CMD_CREATE_CQ,
44   IB_USER_VERBS_CMD_RESIZE_CQ,
45   IB_USER_VERBS_CMD_DESTROY_CQ,
46   IB_USER_VERBS_CMD_POLL_CQ,
47   IB_USER_VERBS_CMD_PEEK_CQ,
48   IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
49   IB_USER_VERBS_CMD_CREATE_QP,
50   IB_USER_VERBS_CMD_QUERY_QP,
51   IB_USER_VERBS_CMD_MODIFY_QP,
52   IB_USER_VERBS_CMD_DESTROY_QP,
53   IB_USER_VERBS_CMD_POST_SEND,
54   IB_USER_VERBS_CMD_POST_RECV,
55   IB_USER_VERBS_CMD_ATTACH_MCAST,
56   IB_USER_VERBS_CMD_DETACH_MCAST,
57   IB_USER_VERBS_CMD_CREATE_SRQ,
58   IB_USER_VERBS_CMD_MODIFY_SRQ,
59   IB_USER_VERBS_CMD_QUERY_SRQ,
60   IB_USER_VERBS_CMD_DESTROY_SRQ,
61   IB_USER_VERBS_CMD_POST_SRQ_RECV,
62   IB_USER_VERBS_CMD_OPEN_XRCD,
63   IB_USER_VERBS_CMD_CLOSE_XRCD,
64   IB_USER_VERBS_CMD_CREATE_XSRQ,
65   IB_USER_VERBS_CMD_OPEN_QP,
66 };
67 enum {
68   IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
69   IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
70   IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
71   IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
72   IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
73   IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
74   IB_USER_VERBS_EX_CMD_CREATE_WQ,
75   IB_USER_VERBS_EX_CMD_MODIFY_WQ,
76   IB_USER_VERBS_EX_CMD_DESTROY_WQ,
77   IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
78   IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
79   IB_USER_VERBS_EX_CMD_MODIFY_CQ
80 };
81 struct ib_uverbs_async_event_desc {
82   __aligned_u64 element;
83   __u32 event_type;
84   __u32 reserved;
85 };
86 struct ib_uverbs_comp_event_desc {
87   __aligned_u64 cq_handle;
88 };
89 struct ib_uverbs_cq_moderation_caps {
90   __u16 max_cq_moderation_count;
91   __u16 max_cq_moderation_period;
92   __u32 reserved;
93 };
94 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
95 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
96 struct ib_uverbs_cmd_hdr {
97   __u32 command;
98   __u16 in_words;
99   __u16 out_words;
100 };
101 struct ib_uverbs_ex_cmd_hdr {
102   __aligned_u64 response;
103   __u16 provider_in_words;
104   __u16 provider_out_words;
105   __u32 cmd_hdr_reserved;
106 };
107 struct ib_uverbs_get_context {
108   __aligned_u64 response;
109   __aligned_u64 driver_data[0];
110 };
111 struct ib_uverbs_get_context_resp {
112   __u32 async_fd;
113   __u32 num_comp_vectors;
114   __aligned_u64 driver_data[0];
115 };
116 struct ib_uverbs_query_device {
117   __aligned_u64 response;
118   __aligned_u64 driver_data[0];
119 };
120 struct ib_uverbs_query_device_resp {
121   __aligned_u64 fw_ver;
122   __be64 node_guid;
123   __be64 sys_image_guid;
124   __aligned_u64 max_mr_size;
125   __aligned_u64 page_size_cap;
126   __u32 vendor_id;
127   __u32 vendor_part_id;
128   __u32 hw_ver;
129   __u32 max_qp;
130   __u32 max_qp_wr;
131   __u32 device_cap_flags;
132   __u32 max_sge;
133   __u32 max_sge_rd;
134   __u32 max_cq;
135   __u32 max_cqe;
136   __u32 max_mr;
137   __u32 max_pd;
138   __u32 max_qp_rd_atom;
139   __u32 max_ee_rd_atom;
140   __u32 max_res_rd_atom;
141   __u32 max_qp_init_rd_atom;
142   __u32 max_ee_init_rd_atom;
143   __u32 atomic_cap;
144   __u32 max_ee;
145   __u32 max_rdd;
146   __u32 max_mw;
147   __u32 max_raw_ipv6_qp;
148   __u32 max_raw_ethy_qp;
149   __u32 max_mcast_grp;
150   __u32 max_mcast_qp_attach;
151   __u32 max_total_mcast_qp_attach;
152   __u32 max_ah;
153   __u32 max_fmr;
154   __u32 max_map_per_fmr;
155   __u32 max_srq;
156   __u32 max_srq_wr;
157   __u32 max_srq_sge;
158   __u16 max_pkeys;
159   __u8 local_ca_ack_delay;
160   __u8 phys_port_cnt;
161   __u8 reserved[4];
162 };
163 struct ib_uverbs_ex_query_device {
164   __u32 comp_mask;
165   __u32 reserved;
166 };
167 struct ib_uverbs_odp_caps {
168   __aligned_u64 general_caps;
169   struct {
170     __u32 rc_odp_caps;
171     __u32 uc_odp_caps;
172     __u32 ud_odp_caps;
173   } per_transport_caps;
174   __u32 reserved;
175 };
176 struct ib_uverbs_rss_caps {
177   __u32 supported_qpts;
178   __u32 max_rwq_indirection_tables;
179   __u32 max_rwq_indirection_table_size;
180   __u32 reserved;
181 };
182 struct ib_uverbs_tm_caps {
183   __u32 max_rndv_hdr_size;
184   __u32 max_num_tags;
185   __u32 flags;
186   __u32 max_ops;
187   __u32 max_sge;
188   __u32 reserved;
189 };
190 struct ib_uverbs_ex_query_device_resp {
191   struct ib_uverbs_query_device_resp base;
192   __u32 comp_mask;
193   __u32 response_length;
194   struct ib_uverbs_odp_caps odp_caps;
195   __aligned_u64 timestamp_mask;
196   __aligned_u64 hca_core_clock;
197   __aligned_u64 device_cap_flags_ex;
198   struct ib_uverbs_rss_caps rss_caps;
199   __u32 max_wq_type_rq;
200   __u32 raw_packet_caps;
201   struct ib_uverbs_tm_caps tm_caps;
202   struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
203   __aligned_u64 max_dm_size;
204   __u32 xrc_odp_caps;
205   __u32 reserved;
206 };
207 struct ib_uverbs_query_port {
208   __aligned_u64 response;
209   __u8 port_num;
210   __u8 reserved[7];
211   __aligned_u64 driver_data[0];
212 };
213 struct ib_uverbs_query_port_resp {
214   __u32 port_cap_flags;
215   __u32 max_msg_sz;
216   __u32 bad_pkey_cntr;
217   __u32 qkey_viol_cntr;
218   __u32 gid_tbl_len;
219   __u16 pkey_tbl_len;
220   __u16 lid;
221   __u16 sm_lid;
222   __u8 state;
223   __u8 max_mtu;
224   __u8 active_mtu;
225   __u8 lmc;
226   __u8 max_vl_num;
227   __u8 sm_sl;
228   __u8 subnet_timeout;
229   __u8 init_type_reply;
230   __u8 active_width;
231   __u8 active_speed;
232   __u8 phys_state;
233   __u8 link_layer;
234   __u8 flags;
235   __u8 reserved;
236 };
237 struct ib_uverbs_alloc_pd {
238   __aligned_u64 response;
239   __aligned_u64 driver_data[0];
240 };
241 struct ib_uverbs_alloc_pd_resp {
242   __u32 pd_handle;
243   __u32 driver_data[0];
244 };
245 struct ib_uverbs_dealloc_pd {
246   __u32 pd_handle;
247 };
248 struct ib_uverbs_open_xrcd {
249   __aligned_u64 response;
250   __u32 fd;
251   __u32 oflags;
252   __aligned_u64 driver_data[0];
253 };
254 struct ib_uverbs_open_xrcd_resp {
255   __u32 xrcd_handle;
256   __u32 driver_data[0];
257 };
258 struct ib_uverbs_close_xrcd {
259   __u32 xrcd_handle;
260 };
261 struct ib_uverbs_reg_mr {
262   __aligned_u64 response;
263   __aligned_u64 start;
264   __aligned_u64 length;
265   __aligned_u64 hca_va;
266   __u32 pd_handle;
267   __u32 access_flags;
268   __aligned_u64 driver_data[0];
269 };
270 struct ib_uverbs_reg_mr_resp {
271   __u32 mr_handle;
272   __u32 lkey;
273   __u32 rkey;
274   __u32 driver_data[0];
275 };
276 struct ib_uverbs_rereg_mr {
277   __aligned_u64 response;
278   __u32 mr_handle;
279   __u32 flags;
280   __aligned_u64 start;
281   __aligned_u64 length;
282   __aligned_u64 hca_va;
283   __u32 pd_handle;
284   __u32 access_flags;
285   __aligned_u64 driver_data[0];
286 };
287 struct ib_uverbs_rereg_mr_resp {
288   __u32 lkey;
289   __u32 rkey;
290   __aligned_u64 driver_data[0];
291 };
292 struct ib_uverbs_dereg_mr {
293   __u32 mr_handle;
294 };
295 struct ib_uverbs_alloc_mw {
296   __aligned_u64 response;
297   __u32 pd_handle;
298   __u8 mw_type;
299   __u8 reserved[3];
300   __aligned_u64 driver_data[0];
301 };
302 struct ib_uverbs_alloc_mw_resp {
303   __u32 mw_handle;
304   __u32 rkey;
305   __aligned_u64 driver_data[0];
306 };
307 struct ib_uverbs_dealloc_mw {
308   __u32 mw_handle;
309 };
310 struct ib_uverbs_create_comp_channel {
311   __aligned_u64 response;
312 };
313 struct ib_uverbs_create_comp_channel_resp {
314   __u32 fd;
315 };
316 struct ib_uverbs_create_cq {
317   __aligned_u64 response;
318   __aligned_u64 user_handle;
319   __u32 cqe;
320   __u32 comp_vector;
321   __s32 comp_channel;
322   __u32 reserved;
323   __aligned_u64 driver_data[0];
324 };
325 enum ib_uverbs_ex_create_cq_flags {
326   IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
327   IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
328 };
329 struct ib_uverbs_ex_create_cq {
330   __aligned_u64 user_handle;
331   __u32 cqe;
332   __u32 comp_vector;
333   __s32 comp_channel;
334   __u32 comp_mask;
335   __u32 flags;
336   __u32 reserved;
337 };
338 struct ib_uverbs_create_cq_resp {
339   __u32 cq_handle;
340   __u32 cqe;
341   __aligned_u64 driver_data[0];
342 };
343 struct ib_uverbs_ex_create_cq_resp {
344   struct ib_uverbs_create_cq_resp base;
345   __u32 comp_mask;
346   __u32 response_length;
347 };
348 struct ib_uverbs_resize_cq {
349   __aligned_u64 response;
350   __u32 cq_handle;
351   __u32 cqe;
352   __aligned_u64 driver_data[0];
353 };
354 struct ib_uverbs_resize_cq_resp {
355   __u32 cqe;
356   __u32 reserved;
357   __aligned_u64 driver_data[0];
358 };
359 struct ib_uverbs_poll_cq {
360   __aligned_u64 response;
361   __u32 cq_handle;
362   __u32 ne;
363 };
364 struct ib_uverbs_wc {
365   __aligned_u64 wr_id;
366   __u32 status;
367   __u32 opcode;
368   __u32 vendor_err;
369   __u32 byte_len;
370   union {
371     __be32 imm_data;
372     __u32 invalidate_rkey;
373   } ex;
374   __u32 qp_num;
375   __u32 src_qp;
376   __u32 wc_flags;
377   __u16 pkey_index;
378   __u16 slid;
379   __u8 sl;
380   __u8 dlid_path_bits;
381   __u8 port_num;
382   __u8 reserved;
383 };
384 struct ib_uverbs_poll_cq_resp {
385   __u32 count;
386   __u32 reserved;
387   struct ib_uverbs_wc wc[0];
388 };
389 struct ib_uverbs_req_notify_cq {
390   __u32 cq_handle;
391   __u32 solicited_only;
392 };
393 struct ib_uverbs_destroy_cq {
394   __aligned_u64 response;
395   __u32 cq_handle;
396   __u32 reserved;
397 };
398 struct ib_uverbs_destroy_cq_resp {
399   __u32 comp_events_reported;
400   __u32 async_events_reported;
401 };
402 struct ib_uverbs_global_route {
403   __u8 dgid[16];
404   __u32 flow_label;
405   __u8 sgid_index;
406   __u8 hop_limit;
407   __u8 traffic_class;
408   __u8 reserved;
409 };
410 struct ib_uverbs_ah_attr {
411   struct ib_uverbs_global_route grh;
412   __u16 dlid;
413   __u8 sl;
414   __u8 src_path_bits;
415   __u8 static_rate;
416   __u8 is_global;
417   __u8 port_num;
418   __u8 reserved;
419 };
420 struct ib_uverbs_qp_attr {
421   __u32 qp_attr_mask;
422   __u32 qp_state;
423   __u32 cur_qp_state;
424   __u32 path_mtu;
425   __u32 path_mig_state;
426   __u32 qkey;
427   __u32 rq_psn;
428   __u32 sq_psn;
429   __u32 dest_qp_num;
430   __u32 qp_access_flags;
431   struct ib_uverbs_ah_attr ah_attr;
432   struct ib_uverbs_ah_attr alt_ah_attr;
433   __u32 max_send_wr;
434   __u32 max_recv_wr;
435   __u32 max_send_sge;
436   __u32 max_recv_sge;
437   __u32 max_inline_data;
438   __u16 pkey_index;
439   __u16 alt_pkey_index;
440   __u8 en_sqd_async_notify;
441   __u8 sq_draining;
442   __u8 max_rd_atomic;
443   __u8 max_dest_rd_atomic;
444   __u8 min_rnr_timer;
445   __u8 port_num;
446   __u8 timeout;
447   __u8 retry_cnt;
448   __u8 rnr_retry;
449   __u8 alt_port_num;
450   __u8 alt_timeout;
451   __u8 reserved[5];
452 };
453 struct ib_uverbs_create_qp {
454   __aligned_u64 response;
455   __aligned_u64 user_handle;
456   __u32 pd_handle;
457   __u32 send_cq_handle;
458   __u32 recv_cq_handle;
459   __u32 srq_handle;
460   __u32 max_send_wr;
461   __u32 max_recv_wr;
462   __u32 max_send_sge;
463   __u32 max_recv_sge;
464   __u32 max_inline_data;
465   __u8 sq_sig_all;
466   __u8 qp_type;
467   __u8 is_srq;
468   __u8 reserved;
469   __aligned_u64 driver_data[0];
470 };
471 enum ib_uverbs_create_qp_mask {
472   IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
473 };
474 enum {
475   IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
476 };
477 enum {
478   IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
479 };
480 enum {
481   IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
482 };
483 struct ib_uverbs_ex_create_qp {
484   __aligned_u64 user_handle;
485   __u32 pd_handle;
486   __u32 send_cq_handle;
487   __u32 recv_cq_handle;
488   __u32 srq_handle;
489   __u32 max_send_wr;
490   __u32 max_recv_wr;
491   __u32 max_send_sge;
492   __u32 max_recv_sge;
493   __u32 max_inline_data;
494   __u8 sq_sig_all;
495   __u8 qp_type;
496   __u8 is_srq;
497   __u8 reserved;
498   __u32 comp_mask;
499   __u32 create_flags;
500   __u32 rwq_ind_tbl_handle;
501   __u32 source_qpn;
502 };
503 struct ib_uverbs_open_qp {
504   __aligned_u64 response;
505   __aligned_u64 user_handle;
506   __u32 pd_handle;
507   __u32 qpn;
508   __u8 qp_type;
509   __u8 reserved[7];
510   __aligned_u64 driver_data[0];
511 };
512 struct ib_uverbs_create_qp_resp {
513   __u32 qp_handle;
514   __u32 qpn;
515   __u32 max_send_wr;
516   __u32 max_recv_wr;
517   __u32 max_send_sge;
518   __u32 max_recv_sge;
519   __u32 max_inline_data;
520   __u32 reserved;
521   __u32 driver_data[0];
522 };
523 struct ib_uverbs_ex_create_qp_resp {
524   struct ib_uverbs_create_qp_resp base;
525   __u32 comp_mask;
526   __u32 response_length;
527 };
528 struct ib_uverbs_qp_dest {
529   __u8 dgid[16];
530   __u32 flow_label;
531   __u16 dlid;
532   __u16 reserved;
533   __u8 sgid_index;
534   __u8 hop_limit;
535   __u8 traffic_class;
536   __u8 sl;
537   __u8 src_path_bits;
538   __u8 static_rate;
539   __u8 is_global;
540   __u8 port_num;
541 };
542 struct ib_uverbs_query_qp {
543   __aligned_u64 response;
544   __u32 qp_handle;
545   __u32 attr_mask;
546   __aligned_u64 driver_data[0];
547 };
548 struct ib_uverbs_query_qp_resp {
549   struct ib_uverbs_qp_dest dest;
550   struct ib_uverbs_qp_dest alt_dest;
551   __u32 max_send_wr;
552   __u32 max_recv_wr;
553   __u32 max_send_sge;
554   __u32 max_recv_sge;
555   __u32 max_inline_data;
556   __u32 qkey;
557   __u32 rq_psn;
558   __u32 sq_psn;
559   __u32 dest_qp_num;
560   __u32 qp_access_flags;
561   __u16 pkey_index;
562   __u16 alt_pkey_index;
563   __u8 qp_state;
564   __u8 cur_qp_state;
565   __u8 path_mtu;
566   __u8 path_mig_state;
567   __u8 sq_draining;
568   __u8 max_rd_atomic;
569   __u8 max_dest_rd_atomic;
570   __u8 min_rnr_timer;
571   __u8 port_num;
572   __u8 timeout;
573   __u8 retry_cnt;
574   __u8 rnr_retry;
575   __u8 alt_port_num;
576   __u8 alt_timeout;
577   __u8 sq_sig_all;
578   __u8 reserved[5];
579   __aligned_u64 driver_data[0];
580 };
581 struct ib_uverbs_modify_qp {
582   struct ib_uverbs_qp_dest dest;
583   struct ib_uverbs_qp_dest alt_dest;
584   __u32 qp_handle;
585   __u32 attr_mask;
586   __u32 qkey;
587   __u32 rq_psn;
588   __u32 sq_psn;
589   __u32 dest_qp_num;
590   __u32 qp_access_flags;
591   __u16 pkey_index;
592   __u16 alt_pkey_index;
593   __u8 qp_state;
594   __u8 cur_qp_state;
595   __u8 path_mtu;
596   __u8 path_mig_state;
597   __u8 en_sqd_async_notify;
598   __u8 max_rd_atomic;
599   __u8 max_dest_rd_atomic;
600   __u8 min_rnr_timer;
601   __u8 port_num;
602   __u8 timeout;
603   __u8 retry_cnt;
604   __u8 rnr_retry;
605   __u8 alt_port_num;
606   __u8 alt_timeout;
607   __u8 reserved[2];
608   __aligned_u64 driver_data[0];
609 };
610 struct ib_uverbs_ex_modify_qp {
611   struct ib_uverbs_modify_qp base;
612   __u32 rate_limit;
613   __u32 reserved;
614 };
615 struct ib_uverbs_ex_modify_qp_resp {
616   __u32 comp_mask;
617   __u32 response_length;
618 };
619 struct ib_uverbs_destroy_qp {
620   __aligned_u64 response;
621   __u32 qp_handle;
622   __u32 reserved;
623 };
624 struct ib_uverbs_destroy_qp_resp {
625   __u32 events_reported;
626 };
627 struct ib_uverbs_sge {
628   __aligned_u64 addr;
629   __u32 length;
630   __u32 lkey;
631 };
632 enum ib_uverbs_wr_opcode {
633   IB_UVERBS_WR_RDMA_WRITE = 0,
634   IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
635   IB_UVERBS_WR_SEND = 2,
636   IB_UVERBS_WR_SEND_WITH_IMM = 3,
637   IB_UVERBS_WR_RDMA_READ = 4,
638   IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
639   IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
640   IB_UVERBS_WR_LOCAL_INV = 7,
641   IB_UVERBS_WR_BIND_MW = 8,
642   IB_UVERBS_WR_SEND_WITH_INV = 9,
643   IB_UVERBS_WR_TSO = 10,
644   IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
645   IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
646   IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
647 };
648 struct ib_uverbs_send_wr {
649   __aligned_u64 wr_id;
650   __u32 num_sge;
651   __u32 opcode;
652   __u32 send_flags;
653   union {
654     __be32 imm_data;
655     __u32 invalidate_rkey;
656   } ex;
657   union {
658     struct {
659       __aligned_u64 remote_addr;
660       __u32 rkey;
661       __u32 reserved;
662     } rdma;
663     struct {
664       __aligned_u64 remote_addr;
665       __aligned_u64 compare_add;
666       __aligned_u64 swap;
667       __u32 rkey;
668       __u32 reserved;
669     } atomic;
670     struct {
671       __u32 ah;
672       __u32 remote_qpn;
673       __u32 remote_qkey;
674       __u32 reserved;
675     } ud;
676   } wr;
677 };
678 struct ib_uverbs_post_send {
679   __aligned_u64 response;
680   __u32 qp_handle;
681   __u32 wr_count;
682   __u32 sge_count;
683   __u32 wqe_size;
684   struct ib_uverbs_send_wr send_wr[0];
685 };
686 struct ib_uverbs_post_send_resp {
687   __u32 bad_wr;
688 };
689 struct ib_uverbs_recv_wr {
690   __aligned_u64 wr_id;
691   __u32 num_sge;
692   __u32 reserved;
693 };
694 struct ib_uverbs_post_recv {
695   __aligned_u64 response;
696   __u32 qp_handle;
697   __u32 wr_count;
698   __u32 sge_count;
699   __u32 wqe_size;
700   struct ib_uverbs_recv_wr recv_wr[0];
701 };
702 struct ib_uverbs_post_recv_resp {
703   __u32 bad_wr;
704 };
705 struct ib_uverbs_post_srq_recv {
706   __aligned_u64 response;
707   __u32 srq_handle;
708   __u32 wr_count;
709   __u32 sge_count;
710   __u32 wqe_size;
711   struct ib_uverbs_recv_wr recv[0];
712 };
713 struct ib_uverbs_post_srq_recv_resp {
714   __u32 bad_wr;
715 };
716 struct ib_uverbs_create_ah {
717   __aligned_u64 response;
718   __aligned_u64 user_handle;
719   __u32 pd_handle;
720   __u32 reserved;
721   struct ib_uverbs_ah_attr attr;
722   __aligned_u64 driver_data[0];
723 };
724 struct ib_uverbs_create_ah_resp {
725   __u32 ah_handle;
726   __u32 driver_data[0];
727 };
728 struct ib_uverbs_destroy_ah {
729   __u32 ah_handle;
730 };
731 struct ib_uverbs_attach_mcast {
732   __u8 gid[16];
733   __u32 qp_handle;
734   __u16 mlid;
735   __u16 reserved;
736   __aligned_u64 driver_data[0];
737 };
738 struct ib_uverbs_detach_mcast {
739   __u8 gid[16];
740   __u32 qp_handle;
741   __u16 mlid;
742   __u16 reserved;
743   __aligned_u64 driver_data[0];
744 };
745 struct ib_uverbs_flow_spec_hdr {
746   __u32 type;
747   __u16 size;
748   __u16 reserved;
749   __aligned_u64 flow_spec_data[0];
750 };
751 struct ib_uverbs_flow_eth_filter {
752   __u8 dst_mac[6];
753   __u8 src_mac[6];
754   __be16 ether_type;
755   __be16 vlan_tag;
756 };
757 struct ib_uverbs_flow_spec_eth {
758   union {
759     struct ib_uverbs_flow_spec_hdr hdr;
760     struct {
761       __u32 type;
762       __u16 size;
763       __u16 reserved;
764     };
765   };
766   struct ib_uverbs_flow_eth_filter val;
767   struct ib_uverbs_flow_eth_filter mask;
768 };
769 struct ib_uverbs_flow_ipv4_filter {
770   __be32 src_ip;
771   __be32 dst_ip;
772   __u8 proto;
773   __u8 tos;
774   __u8 ttl;
775   __u8 flags;
776 };
777 struct ib_uverbs_flow_spec_ipv4 {
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_ipv4_filter val;
787   struct ib_uverbs_flow_ipv4_filter mask;
788 };
789 struct ib_uverbs_flow_tcp_udp_filter {
790   __be16 dst_port;
791   __be16 src_port;
792 };
793 struct ib_uverbs_flow_spec_tcp_udp {
794   union {
795     struct ib_uverbs_flow_spec_hdr hdr;
796     struct {
797       __u32 type;
798       __u16 size;
799       __u16 reserved;
800     };
801   };
802   struct ib_uverbs_flow_tcp_udp_filter val;
803   struct ib_uverbs_flow_tcp_udp_filter mask;
804 };
805 struct ib_uverbs_flow_ipv6_filter {
806   __u8 src_ip[16];
807   __u8 dst_ip[16];
808   __be32 flow_label;
809   __u8 next_hdr;
810   __u8 traffic_class;
811   __u8 hop_limit;
812   __u8 reserved;
813 };
814 struct ib_uverbs_flow_spec_ipv6 {
815   union {
816     struct ib_uverbs_flow_spec_hdr hdr;
817     struct {
818       __u32 type;
819       __u16 size;
820       __u16 reserved;
821     };
822   };
823   struct ib_uverbs_flow_ipv6_filter val;
824   struct ib_uverbs_flow_ipv6_filter mask;
825 };
826 struct ib_uverbs_flow_spec_action_tag {
827   union {
828     struct ib_uverbs_flow_spec_hdr hdr;
829     struct {
830       __u32 type;
831       __u16 size;
832       __u16 reserved;
833     };
834   };
835   __u32 tag_id;
836   __u32 reserved1;
837 };
838 struct ib_uverbs_flow_spec_action_drop {
839   union {
840     struct ib_uverbs_flow_spec_hdr hdr;
841     struct {
842       __u32 type;
843       __u16 size;
844       __u16 reserved;
845     };
846   };
847 };
848 struct ib_uverbs_flow_spec_action_handle {
849   union {
850     struct ib_uverbs_flow_spec_hdr hdr;
851     struct {
852       __u32 type;
853       __u16 size;
854       __u16 reserved;
855     };
856   };
857   __u32 handle;
858   __u32 reserved1;
859 };
860 struct ib_uverbs_flow_spec_action_count {
861   union {
862     struct ib_uverbs_flow_spec_hdr hdr;
863     struct {
864       __u32 type;
865       __u16 size;
866       __u16 reserved;
867     };
868   };
869   __u32 handle;
870   __u32 reserved1;
871 };
872 struct ib_uverbs_flow_tunnel_filter {
873   __be32 tunnel_id;
874 };
875 struct ib_uverbs_flow_spec_tunnel {
876   union {
877     struct ib_uverbs_flow_spec_hdr hdr;
878     struct {
879       __u32 type;
880       __u16 size;
881       __u16 reserved;
882     };
883   };
884   struct ib_uverbs_flow_tunnel_filter val;
885   struct ib_uverbs_flow_tunnel_filter mask;
886 };
887 struct ib_uverbs_flow_spec_esp_filter {
888   __u32 spi;
889   __u32 seq;
890 };
891 struct ib_uverbs_flow_spec_esp {
892   union {
893     struct ib_uverbs_flow_spec_hdr hdr;
894     struct {
895       __u32 type;
896       __u16 size;
897       __u16 reserved;
898     };
899   };
900   struct ib_uverbs_flow_spec_esp_filter val;
901   struct ib_uverbs_flow_spec_esp_filter mask;
902 };
903 struct ib_uverbs_flow_gre_filter {
904   __be16 c_ks_res0_ver;
905   __be16 protocol;
906   __be32 key;
907 };
908 struct ib_uverbs_flow_spec_gre {
909   union {
910     struct ib_uverbs_flow_spec_hdr hdr;
911     struct {
912       __u32 type;
913       __u16 size;
914       __u16 reserved;
915     };
916   };
917   struct ib_uverbs_flow_gre_filter val;
918   struct ib_uverbs_flow_gre_filter mask;
919 };
920 struct ib_uverbs_flow_mpls_filter {
921   __be32 label;
922 };
923 struct ib_uverbs_flow_spec_mpls {
924   union {
925     struct ib_uverbs_flow_spec_hdr hdr;
926     struct {
927       __u32 type;
928       __u16 size;
929       __u16 reserved;
930     };
931   };
932   struct ib_uverbs_flow_mpls_filter val;
933   struct ib_uverbs_flow_mpls_filter mask;
934 };
935 struct ib_uverbs_flow_attr {
936   __u32 type;
937   __u16 size;
938   __u16 priority;
939   __u8 num_of_specs;
940   __u8 reserved[2];
941   __u8 port;
942   __u32 flags;
943   struct ib_uverbs_flow_spec_hdr flow_specs[0];
944 };
945 struct ib_uverbs_create_flow {
946   __u32 comp_mask;
947   __u32 qp_handle;
948   struct ib_uverbs_flow_attr flow_attr;
949 };
950 struct ib_uverbs_create_flow_resp {
951   __u32 comp_mask;
952   __u32 flow_handle;
953 };
954 struct ib_uverbs_destroy_flow {
955   __u32 comp_mask;
956   __u32 flow_handle;
957 };
958 struct ib_uverbs_create_srq {
959   __aligned_u64 response;
960   __aligned_u64 user_handle;
961   __u32 pd_handle;
962   __u32 max_wr;
963   __u32 max_sge;
964   __u32 srq_limit;
965   __aligned_u64 driver_data[0];
966 };
967 struct ib_uverbs_create_xsrq {
968   __aligned_u64 response;
969   __aligned_u64 user_handle;
970   __u32 srq_type;
971   __u32 pd_handle;
972   __u32 max_wr;
973   __u32 max_sge;
974   __u32 srq_limit;
975   __u32 max_num_tags;
976   __u32 xrcd_handle;
977   __u32 cq_handle;
978   __aligned_u64 driver_data[0];
979 };
980 struct ib_uverbs_create_srq_resp {
981   __u32 srq_handle;
982   __u32 max_wr;
983   __u32 max_sge;
984   __u32 srqn;
985   __u32 driver_data[0];
986 };
987 struct ib_uverbs_modify_srq {
988   __u32 srq_handle;
989   __u32 attr_mask;
990   __u32 max_wr;
991   __u32 srq_limit;
992   __aligned_u64 driver_data[0];
993 };
994 struct ib_uverbs_query_srq {
995   __aligned_u64 response;
996   __u32 srq_handle;
997   __u32 reserved;
998   __aligned_u64 driver_data[0];
999 };
1000 struct ib_uverbs_query_srq_resp {
1001   __u32 max_wr;
1002   __u32 max_sge;
1003   __u32 srq_limit;
1004   __u32 reserved;
1005 };
1006 struct ib_uverbs_destroy_srq {
1007   __aligned_u64 response;
1008   __u32 srq_handle;
1009   __u32 reserved;
1010 };
1011 struct ib_uverbs_destroy_srq_resp {
1012   __u32 events_reported;
1013 };
1014 struct ib_uverbs_ex_create_wq {
1015   __u32 comp_mask;
1016   __u32 wq_type;
1017   __aligned_u64 user_handle;
1018   __u32 pd_handle;
1019   __u32 cq_handle;
1020   __u32 max_wr;
1021   __u32 max_sge;
1022   __u32 create_flags;
1023   __u32 reserved;
1024 };
1025 struct ib_uverbs_ex_create_wq_resp {
1026   __u32 comp_mask;
1027   __u32 response_length;
1028   __u32 wq_handle;
1029   __u32 max_wr;
1030   __u32 max_sge;
1031   __u32 wqn;
1032 };
1033 struct ib_uverbs_ex_destroy_wq {
1034   __u32 comp_mask;
1035   __u32 wq_handle;
1036 };
1037 struct ib_uverbs_ex_destroy_wq_resp {
1038   __u32 comp_mask;
1039   __u32 response_length;
1040   __u32 events_reported;
1041   __u32 reserved;
1042 };
1043 struct ib_uverbs_ex_modify_wq {
1044   __u32 attr_mask;
1045   __u32 wq_handle;
1046   __u32 wq_state;
1047   __u32 curr_wq_state;
1048   __u32 flags;
1049   __u32 flags_mask;
1050 };
1051 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1052 struct ib_uverbs_ex_create_rwq_ind_table {
1053   __u32 comp_mask;
1054   __u32 log_ind_tbl_size;
1055   __u32 wq_handles[0];
1056 };
1057 struct ib_uverbs_ex_create_rwq_ind_table_resp {
1058   __u32 comp_mask;
1059   __u32 response_length;
1060   __u32 ind_tbl_handle;
1061   __u32 ind_tbl_num;
1062 };
1063 struct ib_uverbs_ex_destroy_rwq_ind_table {
1064   __u32 comp_mask;
1065   __u32 ind_tbl_handle;
1066 };
1067 struct ib_uverbs_cq_moderation {
1068   __u16 cq_count;
1069   __u16 cq_period;
1070 };
1071 struct ib_uverbs_ex_modify_cq {
1072   __u32 cq_handle;
1073   __u32 attr_mask;
1074   struct ib_uverbs_cq_moderation attr;
1075   __u32 reserved;
1076 };
1077 #define IB_DEVICE_NAME_MAX 64
1078 #endif
1079