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 enum ib_uverbs_wc_opcode {
365   IB_UVERBS_WC_SEND = 0,
366   IB_UVERBS_WC_RDMA_WRITE = 1,
367   IB_UVERBS_WC_RDMA_READ = 2,
368   IB_UVERBS_WC_COMP_SWAP = 3,
369   IB_UVERBS_WC_FETCH_ADD = 4,
370   IB_UVERBS_WC_BIND_MW = 5,
371   IB_UVERBS_WC_LOCAL_INV = 6,
372   IB_UVERBS_WC_TSO = 7,
373 };
374 struct ib_uverbs_wc {
375   __aligned_u64 wr_id;
376   __u32 status;
377   __u32 opcode;
378   __u32 vendor_err;
379   __u32 byte_len;
380   union {
381     __be32 imm_data;
382     __u32 invalidate_rkey;
383   } ex;
384   __u32 qp_num;
385   __u32 src_qp;
386   __u32 wc_flags;
387   __u16 pkey_index;
388   __u16 slid;
389   __u8 sl;
390   __u8 dlid_path_bits;
391   __u8 port_num;
392   __u8 reserved;
393 };
394 struct ib_uverbs_poll_cq_resp {
395   __u32 count;
396   __u32 reserved;
397   struct ib_uverbs_wc wc[0];
398 };
399 struct ib_uverbs_req_notify_cq {
400   __u32 cq_handle;
401   __u32 solicited_only;
402 };
403 struct ib_uverbs_destroy_cq {
404   __aligned_u64 response;
405   __u32 cq_handle;
406   __u32 reserved;
407 };
408 struct ib_uverbs_destroy_cq_resp {
409   __u32 comp_events_reported;
410   __u32 async_events_reported;
411 };
412 struct ib_uverbs_global_route {
413   __u8 dgid[16];
414   __u32 flow_label;
415   __u8 sgid_index;
416   __u8 hop_limit;
417   __u8 traffic_class;
418   __u8 reserved;
419 };
420 struct ib_uverbs_ah_attr {
421   struct ib_uverbs_global_route grh;
422   __u16 dlid;
423   __u8 sl;
424   __u8 src_path_bits;
425   __u8 static_rate;
426   __u8 is_global;
427   __u8 port_num;
428   __u8 reserved;
429 };
430 struct ib_uverbs_qp_attr {
431   __u32 qp_attr_mask;
432   __u32 qp_state;
433   __u32 cur_qp_state;
434   __u32 path_mtu;
435   __u32 path_mig_state;
436   __u32 qkey;
437   __u32 rq_psn;
438   __u32 sq_psn;
439   __u32 dest_qp_num;
440   __u32 qp_access_flags;
441   struct ib_uverbs_ah_attr ah_attr;
442   struct ib_uverbs_ah_attr alt_ah_attr;
443   __u32 max_send_wr;
444   __u32 max_recv_wr;
445   __u32 max_send_sge;
446   __u32 max_recv_sge;
447   __u32 max_inline_data;
448   __u16 pkey_index;
449   __u16 alt_pkey_index;
450   __u8 en_sqd_async_notify;
451   __u8 sq_draining;
452   __u8 max_rd_atomic;
453   __u8 max_dest_rd_atomic;
454   __u8 min_rnr_timer;
455   __u8 port_num;
456   __u8 timeout;
457   __u8 retry_cnt;
458   __u8 rnr_retry;
459   __u8 alt_port_num;
460   __u8 alt_timeout;
461   __u8 reserved[5];
462 };
463 struct ib_uverbs_create_qp {
464   __aligned_u64 response;
465   __aligned_u64 user_handle;
466   __u32 pd_handle;
467   __u32 send_cq_handle;
468   __u32 recv_cq_handle;
469   __u32 srq_handle;
470   __u32 max_send_wr;
471   __u32 max_recv_wr;
472   __u32 max_send_sge;
473   __u32 max_recv_sge;
474   __u32 max_inline_data;
475   __u8 sq_sig_all;
476   __u8 qp_type;
477   __u8 is_srq;
478   __u8 reserved;
479   __aligned_u64 driver_data[0];
480 };
481 enum ib_uverbs_create_qp_mask {
482   IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
483 };
484 enum {
485   IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
486 };
487 struct ib_uverbs_ex_create_qp {
488   __aligned_u64 user_handle;
489   __u32 pd_handle;
490   __u32 send_cq_handle;
491   __u32 recv_cq_handle;
492   __u32 srq_handle;
493   __u32 max_send_wr;
494   __u32 max_recv_wr;
495   __u32 max_send_sge;
496   __u32 max_recv_sge;
497   __u32 max_inline_data;
498   __u8 sq_sig_all;
499   __u8 qp_type;
500   __u8 is_srq;
501   __u8 reserved;
502   __u32 comp_mask;
503   __u32 create_flags;
504   __u32 rwq_ind_tbl_handle;
505   __u32 source_qpn;
506 };
507 struct ib_uverbs_open_qp {
508   __aligned_u64 response;
509   __aligned_u64 user_handle;
510   __u32 pd_handle;
511   __u32 qpn;
512   __u8 qp_type;
513   __u8 reserved[7];
514   __aligned_u64 driver_data[0];
515 };
516 struct ib_uverbs_create_qp_resp {
517   __u32 qp_handle;
518   __u32 qpn;
519   __u32 max_send_wr;
520   __u32 max_recv_wr;
521   __u32 max_send_sge;
522   __u32 max_recv_sge;
523   __u32 max_inline_data;
524   __u32 reserved;
525   __u32 driver_data[0];
526 };
527 struct ib_uverbs_ex_create_qp_resp {
528   struct ib_uverbs_create_qp_resp base;
529   __u32 comp_mask;
530   __u32 response_length;
531 };
532 struct ib_uverbs_qp_dest {
533   __u8 dgid[16];
534   __u32 flow_label;
535   __u16 dlid;
536   __u16 reserved;
537   __u8 sgid_index;
538   __u8 hop_limit;
539   __u8 traffic_class;
540   __u8 sl;
541   __u8 src_path_bits;
542   __u8 static_rate;
543   __u8 is_global;
544   __u8 port_num;
545 };
546 struct ib_uverbs_query_qp {
547   __aligned_u64 response;
548   __u32 qp_handle;
549   __u32 attr_mask;
550   __aligned_u64 driver_data[0];
551 };
552 struct ib_uverbs_query_qp_resp {
553   struct ib_uverbs_qp_dest dest;
554   struct ib_uverbs_qp_dest alt_dest;
555   __u32 max_send_wr;
556   __u32 max_recv_wr;
557   __u32 max_send_sge;
558   __u32 max_recv_sge;
559   __u32 max_inline_data;
560   __u32 qkey;
561   __u32 rq_psn;
562   __u32 sq_psn;
563   __u32 dest_qp_num;
564   __u32 qp_access_flags;
565   __u16 pkey_index;
566   __u16 alt_pkey_index;
567   __u8 qp_state;
568   __u8 cur_qp_state;
569   __u8 path_mtu;
570   __u8 path_mig_state;
571   __u8 sq_draining;
572   __u8 max_rd_atomic;
573   __u8 max_dest_rd_atomic;
574   __u8 min_rnr_timer;
575   __u8 port_num;
576   __u8 timeout;
577   __u8 retry_cnt;
578   __u8 rnr_retry;
579   __u8 alt_port_num;
580   __u8 alt_timeout;
581   __u8 sq_sig_all;
582   __u8 reserved[5];
583   __aligned_u64 driver_data[0];
584 };
585 struct ib_uverbs_modify_qp {
586   struct ib_uverbs_qp_dest dest;
587   struct ib_uverbs_qp_dest alt_dest;
588   __u32 qp_handle;
589   __u32 attr_mask;
590   __u32 qkey;
591   __u32 rq_psn;
592   __u32 sq_psn;
593   __u32 dest_qp_num;
594   __u32 qp_access_flags;
595   __u16 pkey_index;
596   __u16 alt_pkey_index;
597   __u8 qp_state;
598   __u8 cur_qp_state;
599   __u8 path_mtu;
600   __u8 path_mig_state;
601   __u8 en_sqd_async_notify;
602   __u8 max_rd_atomic;
603   __u8 max_dest_rd_atomic;
604   __u8 min_rnr_timer;
605   __u8 port_num;
606   __u8 timeout;
607   __u8 retry_cnt;
608   __u8 rnr_retry;
609   __u8 alt_port_num;
610   __u8 alt_timeout;
611   __u8 reserved[2];
612   __aligned_u64 driver_data[0];
613 };
614 struct ib_uverbs_ex_modify_qp {
615   struct ib_uverbs_modify_qp base;
616   __u32 rate_limit;
617   __u32 reserved;
618 };
619 struct ib_uverbs_ex_modify_qp_resp {
620   __u32 comp_mask;
621   __u32 response_length;
622 };
623 struct ib_uverbs_destroy_qp {
624   __aligned_u64 response;
625   __u32 qp_handle;
626   __u32 reserved;
627 };
628 struct ib_uverbs_destroy_qp_resp {
629   __u32 events_reported;
630 };
631 struct ib_uverbs_sge {
632   __aligned_u64 addr;
633   __u32 length;
634   __u32 lkey;
635 };
636 enum ib_uverbs_wr_opcode {
637   IB_UVERBS_WR_RDMA_WRITE = 0,
638   IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
639   IB_UVERBS_WR_SEND = 2,
640   IB_UVERBS_WR_SEND_WITH_IMM = 3,
641   IB_UVERBS_WR_RDMA_READ = 4,
642   IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
643   IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
644   IB_UVERBS_WR_LOCAL_INV = 7,
645   IB_UVERBS_WR_BIND_MW = 8,
646   IB_UVERBS_WR_SEND_WITH_INV = 9,
647   IB_UVERBS_WR_TSO = 10,
648   IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
649   IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
650   IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
651 };
652 struct ib_uverbs_send_wr {
653   __aligned_u64 wr_id;
654   __u32 num_sge;
655   __u32 opcode;
656   __u32 send_flags;
657   union {
658     __be32 imm_data;
659     __u32 invalidate_rkey;
660   } ex;
661   union {
662     struct {
663       __aligned_u64 remote_addr;
664       __u32 rkey;
665       __u32 reserved;
666     } rdma;
667     struct {
668       __aligned_u64 remote_addr;
669       __aligned_u64 compare_add;
670       __aligned_u64 swap;
671       __u32 rkey;
672       __u32 reserved;
673     } atomic;
674     struct {
675       __u32 ah;
676       __u32 remote_qpn;
677       __u32 remote_qkey;
678       __u32 reserved;
679     } ud;
680   } wr;
681 };
682 struct ib_uverbs_post_send {
683   __aligned_u64 response;
684   __u32 qp_handle;
685   __u32 wr_count;
686   __u32 sge_count;
687   __u32 wqe_size;
688   struct ib_uverbs_send_wr send_wr[0];
689 };
690 struct ib_uverbs_post_send_resp {
691   __u32 bad_wr;
692 };
693 struct ib_uverbs_recv_wr {
694   __aligned_u64 wr_id;
695   __u32 num_sge;
696   __u32 reserved;
697 };
698 struct ib_uverbs_post_recv {
699   __aligned_u64 response;
700   __u32 qp_handle;
701   __u32 wr_count;
702   __u32 sge_count;
703   __u32 wqe_size;
704   struct ib_uverbs_recv_wr recv_wr[0];
705 };
706 struct ib_uverbs_post_recv_resp {
707   __u32 bad_wr;
708 };
709 struct ib_uverbs_post_srq_recv {
710   __aligned_u64 response;
711   __u32 srq_handle;
712   __u32 wr_count;
713   __u32 sge_count;
714   __u32 wqe_size;
715   struct ib_uverbs_recv_wr recv[0];
716 };
717 struct ib_uverbs_post_srq_recv_resp {
718   __u32 bad_wr;
719 };
720 struct ib_uverbs_create_ah {
721   __aligned_u64 response;
722   __aligned_u64 user_handle;
723   __u32 pd_handle;
724   __u32 reserved;
725   struct ib_uverbs_ah_attr attr;
726   __aligned_u64 driver_data[0];
727 };
728 struct ib_uverbs_create_ah_resp {
729   __u32 ah_handle;
730   __u32 driver_data[0];
731 };
732 struct ib_uverbs_destroy_ah {
733   __u32 ah_handle;
734 };
735 struct ib_uverbs_attach_mcast {
736   __u8 gid[16];
737   __u32 qp_handle;
738   __u16 mlid;
739   __u16 reserved;
740   __aligned_u64 driver_data[0];
741 };
742 struct ib_uverbs_detach_mcast {
743   __u8 gid[16];
744   __u32 qp_handle;
745   __u16 mlid;
746   __u16 reserved;
747   __aligned_u64 driver_data[0];
748 };
749 struct ib_uverbs_flow_spec_hdr {
750   __u32 type;
751   __u16 size;
752   __u16 reserved;
753   __aligned_u64 flow_spec_data[0];
754 };
755 struct ib_uverbs_flow_eth_filter {
756   __u8 dst_mac[6];
757   __u8 src_mac[6];
758   __be16 ether_type;
759   __be16 vlan_tag;
760 };
761 struct ib_uverbs_flow_spec_eth {
762   union {
763     struct ib_uverbs_flow_spec_hdr hdr;
764     struct {
765       __u32 type;
766       __u16 size;
767       __u16 reserved;
768     };
769   };
770   struct ib_uverbs_flow_eth_filter val;
771   struct ib_uverbs_flow_eth_filter mask;
772 };
773 struct ib_uverbs_flow_ipv4_filter {
774   __be32 src_ip;
775   __be32 dst_ip;
776   __u8 proto;
777   __u8 tos;
778   __u8 ttl;
779   __u8 flags;
780 };
781 struct ib_uverbs_flow_spec_ipv4 {
782   union {
783     struct ib_uverbs_flow_spec_hdr hdr;
784     struct {
785       __u32 type;
786       __u16 size;
787       __u16 reserved;
788     };
789   };
790   struct ib_uverbs_flow_ipv4_filter val;
791   struct ib_uverbs_flow_ipv4_filter mask;
792 };
793 struct ib_uverbs_flow_tcp_udp_filter {
794   __be16 dst_port;
795   __be16 src_port;
796 };
797 struct ib_uverbs_flow_spec_tcp_udp {
798   union {
799     struct ib_uverbs_flow_spec_hdr hdr;
800     struct {
801       __u32 type;
802       __u16 size;
803       __u16 reserved;
804     };
805   };
806   struct ib_uverbs_flow_tcp_udp_filter val;
807   struct ib_uverbs_flow_tcp_udp_filter mask;
808 };
809 struct ib_uverbs_flow_ipv6_filter {
810   __u8 src_ip[16];
811   __u8 dst_ip[16];
812   __be32 flow_label;
813   __u8 next_hdr;
814   __u8 traffic_class;
815   __u8 hop_limit;
816   __u8 reserved;
817 };
818 struct ib_uverbs_flow_spec_ipv6 {
819   union {
820     struct ib_uverbs_flow_spec_hdr hdr;
821     struct {
822       __u32 type;
823       __u16 size;
824       __u16 reserved;
825     };
826   };
827   struct ib_uverbs_flow_ipv6_filter val;
828   struct ib_uverbs_flow_ipv6_filter mask;
829 };
830 struct ib_uverbs_flow_spec_action_tag {
831   union {
832     struct ib_uverbs_flow_spec_hdr hdr;
833     struct {
834       __u32 type;
835       __u16 size;
836       __u16 reserved;
837     };
838   };
839   __u32 tag_id;
840   __u32 reserved1;
841 };
842 struct ib_uverbs_flow_spec_action_drop {
843   union {
844     struct ib_uverbs_flow_spec_hdr hdr;
845     struct {
846       __u32 type;
847       __u16 size;
848       __u16 reserved;
849     };
850   };
851 };
852 struct ib_uverbs_flow_spec_action_handle {
853   union {
854     struct ib_uverbs_flow_spec_hdr hdr;
855     struct {
856       __u32 type;
857       __u16 size;
858       __u16 reserved;
859     };
860   };
861   __u32 handle;
862   __u32 reserved1;
863 };
864 struct ib_uverbs_flow_spec_action_count {
865   union {
866     struct ib_uverbs_flow_spec_hdr hdr;
867     struct {
868       __u32 type;
869       __u16 size;
870       __u16 reserved;
871     };
872   };
873   __u32 handle;
874   __u32 reserved1;
875 };
876 struct ib_uverbs_flow_tunnel_filter {
877   __be32 tunnel_id;
878 };
879 struct ib_uverbs_flow_spec_tunnel {
880   union {
881     struct ib_uverbs_flow_spec_hdr hdr;
882     struct {
883       __u32 type;
884       __u16 size;
885       __u16 reserved;
886     };
887   };
888   struct ib_uverbs_flow_tunnel_filter val;
889   struct ib_uverbs_flow_tunnel_filter mask;
890 };
891 struct ib_uverbs_flow_spec_esp_filter {
892   __u32 spi;
893   __u32 seq;
894 };
895 struct ib_uverbs_flow_spec_esp {
896   union {
897     struct ib_uverbs_flow_spec_hdr hdr;
898     struct {
899       __u32 type;
900       __u16 size;
901       __u16 reserved;
902     };
903   };
904   struct ib_uverbs_flow_spec_esp_filter val;
905   struct ib_uverbs_flow_spec_esp_filter mask;
906 };
907 struct ib_uverbs_flow_gre_filter {
908   __be16 c_ks_res0_ver;
909   __be16 protocol;
910   __be32 key;
911 };
912 struct ib_uverbs_flow_spec_gre {
913   union {
914     struct ib_uverbs_flow_spec_hdr hdr;
915     struct {
916       __u32 type;
917       __u16 size;
918       __u16 reserved;
919     };
920   };
921   struct ib_uverbs_flow_gre_filter val;
922   struct ib_uverbs_flow_gre_filter mask;
923 };
924 struct ib_uverbs_flow_mpls_filter {
925   __be32 label;
926 };
927 struct ib_uverbs_flow_spec_mpls {
928   union {
929     struct ib_uverbs_flow_spec_hdr hdr;
930     struct {
931       __u32 type;
932       __u16 size;
933       __u16 reserved;
934     };
935   };
936   struct ib_uverbs_flow_mpls_filter val;
937   struct ib_uverbs_flow_mpls_filter mask;
938 };
939 struct ib_uverbs_flow_attr {
940   __u32 type;
941   __u16 size;
942   __u16 priority;
943   __u8 num_of_specs;
944   __u8 reserved[2];
945   __u8 port;
946   __u32 flags;
947   struct ib_uverbs_flow_spec_hdr flow_specs[0];
948 };
949 struct ib_uverbs_create_flow {
950   __u32 comp_mask;
951   __u32 qp_handle;
952   struct ib_uverbs_flow_attr flow_attr;
953 };
954 struct ib_uverbs_create_flow_resp {
955   __u32 comp_mask;
956   __u32 flow_handle;
957 };
958 struct ib_uverbs_destroy_flow {
959   __u32 comp_mask;
960   __u32 flow_handle;
961 };
962 struct ib_uverbs_create_srq {
963   __aligned_u64 response;
964   __aligned_u64 user_handle;
965   __u32 pd_handle;
966   __u32 max_wr;
967   __u32 max_sge;
968   __u32 srq_limit;
969   __aligned_u64 driver_data[0];
970 };
971 struct ib_uverbs_create_xsrq {
972   __aligned_u64 response;
973   __aligned_u64 user_handle;
974   __u32 srq_type;
975   __u32 pd_handle;
976   __u32 max_wr;
977   __u32 max_sge;
978   __u32 srq_limit;
979   __u32 max_num_tags;
980   __u32 xrcd_handle;
981   __u32 cq_handle;
982   __aligned_u64 driver_data[0];
983 };
984 struct ib_uverbs_create_srq_resp {
985   __u32 srq_handle;
986   __u32 max_wr;
987   __u32 max_sge;
988   __u32 srqn;
989   __u32 driver_data[0];
990 };
991 struct ib_uverbs_modify_srq {
992   __u32 srq_handle;
993   __u32 attr_mask;
994   __u32 max_wr;
995   __u32 srq_limit;
996   __aligned_u64 driver_data[0];
997 };
998 struct ib_uverbs_query_srq {
999   __aligned_u64 response;
1000   __u32 srq_handle;
1001   __u32 reserved;
1002   __aligned_u64 driver_data[0];
1003 };
1004 struct ib_uverbs_query_srq_resp {
1005   __u32 max_wr;
1006   __u32 max_sge;
1007   __u32 srq_limit;
1008   __u32 reserved;
1009 };
1010 struct ib_uverbs_destroy_srq {
1011   __aligned_u64 response;
1012   __u32 srq_handle;
1013   __u32 reserved;
1014 };
1015 struct ib_uverbs_destroy_srq_resp {
1016   __u32 events_reported;
1017 };
1018 struct ib_uverbs_ex_create_wq {
1019   __u32 comp_mask;
1020   __u32 wq_type;
1021   __aligned_u64 user_handle;
1022   __u32 pd_handle;
1023   __u32 cq_handle;
1024   __u32 max_wr;
1025   __u32 max_sge;
1026   __u32 create_flags;
1027   __u32 reserved;
1028 };
1029 struct ib_uverbs_ex_create_wq_resp {
1030   __u32 comp_mask;
1031   __u32 response_length;
1032   __u32 wq_handle;
1033   __u32 max_wr;
1034   __u32 max_sge;
1035   __u32 wqn;
1036 };
1037 struct ib_uverbs_ex_destroy_wq {
1038   __u32 comp_mask;
1039   __u32 wq_handle;
1040 };
1041 struct ib_uverbs_ex_destroy_wq_resp {
1042   __u32 comp_mask;
1043   __u32 response_length;
1044   __u32 events_reported;
1045   __u32 reserved;
1046 };
1047 struct ib_uverbs_ex_modify_wq {
1048   __u32 attr_mask;
1049   __u32 wq_handle;
1050   __u32 wq_state;
1051   __u32 curr_wq_state;
1052   __u32 flags;
1053   __u32 flags_mask;
1054 };
1055 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1056 struct ib_uverbs_ex_create_rwq_ind_table {
1057   __u32 comp_mask;
1058   __u32 log_ind_tbl_size;
1059   __u32 wq_handles[0];
1060 };
1061 struct ib_uverbs_ex_create_rwq_ind_table_resp {
1062   __u32 comp_mask;
1063   __u32 response_length;
1064   __u32 ind_tbl_handle;
1065   __u32 ind_tbl_num;
1066 };
1067 struct ib_uverbs_ex_destroy_rwq_ind_table {
1068   __u32 comp_mask;
1069   __u32 ind_tbl_handle;
1070 };
1071 struct ib_uverbs_cq_moderation {
1072   __u16 cq_count;
1073   __u16 cq_period;
1074 };
1075 struct ib_uverbs_ex_modify_cq {
1076   __u32 cq_handle;
1077   __u32 attr_mask;
1078   struct ib_uverbs_cq_moderation attr;
1079   __u32 reserved;
1080 };
1081 #define IB_DEVICE_NAME_MAX 64
1082 #endif
1083