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