• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef IB_USER_VERBS_H
8 #define IB_USER_VERBS_H
9 #include <linux/types.h>
10 #define IB_USER_VERBS_ABI_VERSION 6
11 #define IB_USER_VERBS_CMD_THRESHOLD 50
12 enum ib_uverbs_write_cmds {
13   IB_USER_VERBS_CMD_GET_CONTEXT,
14   IB_USER_VERBS_CMD_QUERY_DEVICE,
15   IB_USER_VERBS_CMD_QUERY_PORT,
16   IB_USER_VERBS_CMD_ALLOC_PD,
17   IB_USER_VERBS_CMD_DEALLOC_PD,
18   IB_USER_VERBS_CMD_CREATE_AH,
19   IB_USER_VERBS_CMD_MODIFY_AH,
20   IB_USER_VERBS_CMD_QUERY_AH,
21   IB_USER_VERBS_CMD_DESTROY_AH,
22   IB_USER_VERBS_CMD_REG_MR,
23   IB_USER_VERBS_CMD_REG_SMR,
24   IB_USER_VERBS_CMD_REREG_MR,
25   IB_USER_VERBS_CMD_QUERY_MR,
26   IB_USER_VERBS_CMD_DEREG_MR,
27   IB_USER_VERBS_CMD_ALLOC_MW,
28   IB_USER_VERBS_CMD_BIND_MW,
29   IB_USER_VERBS_CMD_DEALLOC_MW,
30   IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
31   IB_USER_VERBS_CMD_CREATE_CQ,
32   IB_USER_VERBS_CMD_RESIZE_CQ,
33   IB_USER_VERBS_CMD_DESTROY_CQ,
34   IB_USER_VERBS_CMD_POLL_CQ,
35   IB_USER_VERBS_CMD_PEEK_CQ,
36   IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
37   IB_USER_VERBS_CMD_CREATE_QP,
38   IB_USER_VERBS_CMD_QUERY_QP,
39   IB_USER_VERBS_CMD_MODIFY_QP,
40   IB_USER_VERBS_CMD_DESTROY_QP,
41   IB_USER_VERBS_CMD_POST_SEND,
42   IB_USER_VERBS_CMD_POST_RECV,
43   IB_USER_VERBS_CMD_ATTACH_MCAST,
44   IB_USER_VERBS_CMD_DETACH_MCAST,
45   IB_USER_VERBS_CMD_CREATE_SRQ,
46   IB_USER_VERBS_CMD_MODIFY_SRQ,
47   IB_USER_VERBS_CMD_QUERY_SRQ,
48   IB_USER_VERBS_CMD_DESTROY_SRQ,
49   IB_USER_VERBS_CMD_POST_SRQ_RECV,
50   IB_USER_VERBS_CMD_OPEN_XRCD,
51   IB_USER_VERBS_CMD_CLOSE_XRCD,
52   IB_USER_VERBS_CMD_CREATE_XSRQ,
53   IB_USER_VERBS_CMD_OPEN_QP,
54 };
55 enum {
56   IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
57   IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
58   IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
59   IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
60   IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
61   IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
62   IB_USER_VERBS_EX_CMD_CREATE_WQ,
63   IB_USER_VERBS_EX_CMD_MODIFY_WQ,
64   IB_USER_VERBS_EX_CMD_DESTROY_WQ,
65   IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
66   IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
67   IB_USER_VERBS_EX_CMD_MODIFY_CQ
68 };
69 enum ib_placement_type {
70   IB_FLUSH_GLOBAL = 1U << 0,
71   IB_FLUSH_PERSISTENT = 1U << 1,
72 };
73 enum ib_selectivity_level {
74   IB_FLUSH_RANGE = 0,
75   IB_FLUSH_MR,
76 };
77 struct ib_uverbs_async_event_desc {
78   __aligned_u64 element;
79   __u32 event_type;
80   __u32 reserved;
81 };
82 struct ib_uverbs_comp_event_desc {
83   __aligned_u64 cq_handle;
84 };
85 struct ib_uverbs_cq_moderation_caps {
86   __u16 max_cq_moderation_count;
87   __u16 max_cq_moderation_period;
88   __u32 reserved;
89 };
90 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
91 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
92 struct ib_uverbs_cmd_hdr {
93   __u32 command;
94   __u16 in_words;
95   __u16 out_words;
96 };
97 struct ib_uverbs_ex_cmd_hdr {
98   __aligned_u64 response;
99   __u16 provider_in_words;
100   __u16 provider_out_words;
101   __u32 cmd_hdr_reserved;
102 };
103 struct ib_uverbs_get_context {
104   __aligned_u64 response;
105   __aligned_u64 driver_data[];
106 };
107 struct ib_uverbs_get_context_resp {
108   __u32 async_fd;
109   __u32 num_comp_vectors;
110   __aligned_u64 driver_data[];
111 };
112 struct ib_uverbs_query_device {
113   __aligned_u64 response;
114   __aligned_u64 driver_data[];
115 };
116 struct ib_uverbs_query_device_resp {
117   __aligned_u64 fw_ver;
118   __be64 node_guid;
119   __be64 sys_image_guid;
120   __aligned_u64 max_mr_size;
121   __aligned_u64 page_size_cap;
122   __u32 vendor_id;
123   __u32 vendor_part_id;
124   __u32 hw_ver;
125   __u32 max_qp;
126   __u32 max_qp_wr;
127   __u32 device_cap_flags;
128   __u32 max_sge;
129   __u32 max_sge_rd;
130   __u32 max_cq;
131   __u32 max_cqe;
132   __u32 max_mr;
133   __u32 max_pd;
134   __u32 max_qp_rd_atom;
135   __u32 max_ee_rd_atom;
136   __u32 max_res_rd_atom;
137   __u32 max_qp_init_rd_atom;
138   __u32 max_ee_init_rd_atom;
139   __u32 atomic_cap;
140   __u32 max_ee;
141   __u32 max_rdd;
142   __u32 max_mw;
143   __u32 max_raw_ipv6_qp;
144   __u32 max_raw_ethy_qp;
145   __u32 max_mcast_grp;
146   __u32 max_mcast_qp_attach;
147   __u32 max_total_mcast_qp_attach;
148   __u32 max_ah;
149   __u32 max_fmr;
150   __u32 max_map_per_fmr;
151   __u32 max_srq;
152   __u32 max_srq_wr;
153   __u32 max_srq_sge;
154   __u16 max_pkeys;
155   __u8 local_ca_ack_delay;
156   __u8 phys_port_cnt;
157   __u8 reserved[4];
158 };
159 struct ib_uverbs_ex_query_device {
160   __u32 comp_mask;
161   __u32 reserved;
162 };
163 struct ib_uverbs_odp_caps {
164   __aligned_u64 general_caps;
165   struct {
166     __u32 rc_odp_caps;
167     __u32 uc_odp_caps;
168     __u32 ud_odp_caps;
169   } per_transport_caps;
170   __u32 reserved;
171 };
172 struct ib_uverbs_rss_caps {
173   __u32 supported_qpts;
174   __u32 max_rwq_indirection_tables;
175   __u32 max_rwq_indirection_table_size;
176   __u32 reserved;
177 };
178 struct ib_uverbs_tm_caps {
179   __u32 max_rndv_hdr_size;
180   __u32 max_num_tags;
181   __u32 flags;
182   __u32 max_ops;
183   __u32 max_sge;
184   __u32 reserved;
185 };
186 struct ib_uverbs_ex_query_device_resp {
187   struct ib_uverbs_query_device_resp base;
188   __u32 comp_mask;
189   __u32 response_length;
190   struct ib_uverbs_odp_caps odp_caps;
191   __aligned_u64 timestamp_mask;
192   __aligned_u64 hca_core_clock;
193   __aligned_u64 device_cap_flags_ex;
194   struct ib_uverbs_rss_caps rss_caps;
195   __u32 max_wq_type_rq;
196   __u32 raw_packet_caps;
197   struct ib_uverbs_tm_caps tm_caps;
198   struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
199   __aligned_u64 max_dm_size;
200   __u32 xrc_odp_caps;
201   __u32 reserved;
202 };
203 struct ib_uverbs_query_port {
204   __aligned_u64 response;
205   __u8 port_num;
206   __u8 reserved[7];
207   __aligned_u64 driver_data[];
208 };
209 struct ib_uverbs_query_port_resp {
210   __u32 port_cap_flags;
211   __u32 max_msg_sz;
212   __u32 bad_pkey_cntr;
213   __u32 qkey_viol_cntr;
214   __u32 gid_tbl_len;
215   __u16 pkey_tbl_len;
216   __u16 lid;
217   __u16 sm_lid;
218   __u8 state;
219   __u8 max_mtu;
220   __u8 active_mtu;
221   __u8 lmc;
222   __u8 max_vl_num;
223   __u8 sm_sl;
224   __u8 subnet_timeout;
225   __u8 init_type_reply;
226   __u8 active_width;
227   __u8 active_speed;
228   __u8 phys_state;
229   __u8 link_layer;
230   __u8 flags;
231   __u8 reserved;
232 };
233 struct ib_uverbs_alloc_pd {
234   __aligned_u64 response;
235   __aligned_u64 driver_data[];
236 };
237 struct ib_uverbs_alloc_pd_resp {
238   __u32 pd_handle;
239   __u32 driver_data[];
240 };
241 struct ib_uverbs_dealloc_pd {
242   __u32 pd_handle;
243 };
244 struct ib_uverbs_open_xrcd {
245   __aligned_u64 response;
246   __u32 fd;
247   __u32 oflags;
248   __aligned_u64 driver_data[];
249 };
250 struct ib_uverbs_open_xrcd_resp {
251   __u32 xrcd_handle;
252   __u32 driver_data[];
253 };
254 struct ib_uverbs_close_xrcd {
255   __u32 xrcd_handle;
256 };
257 struct ib_uverbs_reg_mr {
258   __aligned_u64 response;
259   __aligned_u64 start;
260   __aligned_u64 length;
261   __aligned_u64 hca_va;
262   __u32 pd_handle;
263   __u32 access_flags;
264   __aligned_u64 driver_data[];
265 };
266 struct ib_uverbs_reg_mr_resp {
267   __u32 mr_handle;
268   __u32 lkey;
269   __u32 rkey;
270   __u32 driver_data[];
271 };
272 struct ib_uverbs_rereg_mr {
273   __aligned_u64 response;
274   __u32 mr_handle;
275   __u32 flags;
276   __aligned_u64 start;
277   __aligned_u64 length;
278   __aligned_u64 hca_va;
279   __u32 pd_handle;
280   __u32 access_flags;
281   __aligned_u64 driver_data[];
282 };
283 struct ib_uverbs_rereg_mr_resp {
284   __u32 lkey;
285   __u32 rkey;
286   __aligned_u64 driver_data[];
287 };
288 struct ib_uverbs_dereg_mr {
289   __u32 mr_handle;
290 };
291 struct ib_uverbs_alloc_mw {
292   __aligned_u64 response;
293   __u32 pd_handle;
294   __u8 mw_type;
295   __u8 reserved[3];
296   __aligned_u64 driver_data[];
297 };
298 struct ib_uverbs_alloc_mw_resp {
299   __u32 mw_handle;
300   __u32 rkey;
301   __aligned_u64 driver_data[];
302 };
303 struct ib_uverbs_dealloc_mw {
304   __u32 mw_handle;
305 };
306 struct ib_uverbs_create_comp_channel {
307   __aligned_u64 response;
308 };
309 struct ib_uverbs_create_comp_channel_resp {
310   __u32 fd;
311 };
312 struct ib_uverbs_create_cq {
313   __aligned_u64 response;
314   __aligned_u64 user_handle;
315   __u32 cqe;
316   __u32 comp_vector;
317   __s32 comp_channel;
318   __u32 reserved;
319   __aligned_u64 driver_data[];
320 };
321 enum ib_uverbs_ex_create_cq_flags {
322   IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
323   IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
324 };
325 struct ib_uverbs_ex_create_cq {
326   __aligned_u64 user_handle;
327   __u32 cqe;
328   __u32 comp_vector;
329   __s32 comp_channel;
330   __u32 comp_mask;
331   __u32 flags;
332   __u32 reserved;
333 };
334 struct ib_uverbs_create_cq_resp {
335   __u32 cq_handle;
336   __u32 cqe;
337   __aligned_u64 driver_data[0];
338 };
339 struct ib_uverbs_ex_create_cq_resp {
340   struct ib_uverbs_create_cq_resp base;
341   __u32 comp_mask;
342   __u32 response_length;
343 };
344 struct ib_uverbs_resize_cq {
345   __aligned_u64 response;
346   __u32 cq_handle;
347   __u32 cqe;
348   __aligned_u64 driver_data[];
349 };
350 struct ib_uverbs_resize_cq_resp {
351   __u32 cqe;
352   __u32 reserved;
353   __aligned_u64 driver_data[];
354 };
355 struct ib_uverbs_poll_cq {
356   __aligned_u64 response;
357   __u32 cq_handle;
358   __u32 ne;
359 };
360 enum ib_uverbs_wc_opcode {
361   IB_UVERBS_WC_SEND = 0,
362   IB_UVERBS_WC_RDMA_WRITE = 1,
363   IB_UVERBS_WC_RDMA_READ = 2,
364   IB_UVERBS_WC_COMP_SWAP = 3,
365   IB_UVERBS_WC_FETCH_ADD = 4,
366   IB_UVERBS_WC_BIND_MW = 5,
367   IB_UVERBS_WC_LOCAL_INV = 6,
368   IB_UVERBS_WC_TSO = 7,
369   IB_UVERBS_WC_FLUSH = 8,
370   IB_UVERBS_WC_ATOMIC_WRITE = 9,
371 };
372 struct ib_uverbs_wc {
373   __aligned_u64 wr_id;
374   __u32 status;
375   __u32 opcode;
376   __u32 vendor_err;
377   __u32 byte_len;
378   union {
379     __be32 imm_data;
380     __u32 invalidate_rkey;
381   } ex;
382   __u32 qp_num;
383   __u32 src_qp;
384   __u32 wc_flags;
385   __u16 pkey_index;
386   __u16 slid;
387   __u8 sl;
388   __u8 dlid_path_bits;
389   __u8 port_num;
390   __u8 reserved;
391 };
392 struct ib_uverbs_poll_cq_resp {
393   __u32 count;
394   __u32 reserved;
395   struct ib_uverbs_wc wc[];
396 };
397 struct ib_uverbs_req_notify_cq {
398   __u32 cq_handle;
399   __u32 solicited_only;
400 };
401 struct ib_uverbs_destroy_cq {
402   __aligned_u64 response;
403   __u32 cq_handle;
404   __u32 reserved;
405 };
406 struct ib_uverbs_destroy_cq_resp {
407   __u32 comp_events_reported;
408   __u32 async_events_reported;
409 };
410 struct ib_uverbs_global_route {
411   __u8 dgid[16];
412   __u32 flow_label;
413   __u8 sgid_index;
414   __u8 hop_limit;
415   __u8 traffic_class;
416   __u8 reserved;
417 };
418 struct ib_uverbs_ah_attr {
419   struct ib_uverbs_global_route grh;
420   __u16 dlid;
421   __u8 sl;
422   __u8 src_path_bits;
423   __u8 static_rate;
424   __u8 is_global;
425   __u8 port_num;
426   __u8 reserved;
427 };
428 struct ib_uverbs_qp_attr {
429   __u32 qp_attr_mask;
430   __u32 qp_state;
431   __u32 cur_qp_state;
432   __u32 path_mtu;
433   __u32 path_mig_state;
434   __u32 qkey;
435   __u32 rq_psn;
436   __u32 sq_psn;
437   __u32 dest_qp_num;
438   __u32 qp_access_flags;
439   struct ib_uverbs_ah_attr ah_attr;
440   struct ib_uverbs_ah_attr alt_ah_attr;
441   __u32 max_send_wr;
442   __u32 max_recv_wr;
443   __u32 max_send_sge;
444   __u32 max_recv_sge;
445   __u32 max_inline_data;
446   __u16 pkey_index;
447   __u16 alt_pkey_index;
448   __u8 en_sqd_async_notify;
449   __u8 sq_draining;
450   __u8 max_rd_atomic;
451   __u8 max_dest_rd_atomic;
452   __u8 min_rnr_timer;
453   __u8 port_num;
454   __u8 timeout;
455   __u8 retry_cnt;
456   __u8 rnr_retry;
457   __u8 alt_port_num;
458   __u8 alt_timeout;
459   __u8 reserved[5];
460 };
461 struct ib_uverbs_create_qp {
462   __aligned_u64 response;
463   __aligned_u64 user_handle;
464   __u32 pd_handle;
465   __u32 send_cq_handle;
466   __u32 recv_cq_handle;
467   __u32 srq_handle;
468   __u32 max_send_wr;
469   __u32 max_recv_wr;
470   __u32 max_send_sge;
471   __u32 max_recv_sge;
472   __u32 max_inline_data;
473   __u8 sq_sig_all;
474   __u8 qp_type;
475   __u8 is_srq;
476   __u8 reserved;
477   __aligned_u64 driver_data[];
478 };
479 enum ib_uverbs_create_qp_mask {
480   IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
481 };
482 enum {
483   IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
484 };
485 struct ib_uverbs_ex_create_qp {
486   __aligned_u64 user_handle;
487   __u32 pd_handle;
488   __u32 send_cq_handle;
489   __u32 recv_cq_handle;
490   __u32 srq_handle;
491   __u32 max_send_wr;
492   __u32 max_recv_wr;
493   __u32 max_send_sge;
494   __u32 max_recv_sge;
495   __u32 max_inline_data;
496   __u8 sq_sig_all;
497   __u8 qp_type;
498   __u8 is_srq;
499   __u8 reserved;
500   __u32 comp_mask;
501   __u32 create_flags;
502   __u32 rwq_ind_tbl_handle;
503   __u32 source_qpn;
504 };
505 struct ib_uverbs_open_qp {
506   __aligned_u64 response;
507   __aligned_u64 user_handle;
508   __u32 pd_handle;
509   __u32 qpn;
510   __u8 qp_type;
511   __u8 reserved[7];
512   __aligned_u64 driver_data[];
513 };
514 struct ib_uverbs_create_qp_resp {
515   __u32 qp_handle;
516   __u32 qpn;
517   __u32 max_send_wr;
518   __u32 max_recv_wr;
519   __u32 max_send_sge;
520   __u32 max_recv_sge;
521   __u32 max_inline_data;
522   __u32 reserved;
523   __u32 driver_data[0];
524 };
525 struct ib_uverbs_ex_create_qp_resp {
526   struct ib_uverbs_create_qp_resp base;
527   __u32 comp_mask;
528   __u32 response_length;
529 };
530 struct ib_uverbs_qp_dest {
531   __u8 dgid[16];
532   __u32 flow_label;
533   __u16 dlid;
534   __u16 reserved;
535   __u8 sgid_index;
536   __u8 hop_limit;
537   __u8 traffic_class;
538   __u8 sl;
539   __u8 src_path_bits;
540   __u8 static_rate;
541   __u8 is_global;
542   __u8 port_num;
543 };
544 struct ib_uverbs_query_qp {
545   __aligned_u64 response;
546   __u32 qp_handle;
547   __u32 attr_mask;
548   __aligned_u64 driver_data[];
549 };
550 struct ib_uverbs_query_qp_resp {
551   struct ib_uverbs_qp_dest dest;
552   struct ib_uverbs_qp_dest alt_dest;
553   __u32 max_send_wr;
554   __u32 max_recv_wr;
555   __u32 max_send_sge;
556   __u32 max_recv_sge;
557   __u32 max_inline_data;
558   __u32 qkey;
559   __u32 rq_psn;
560   __u32 sq_psn;
561   __u32 dest_qp_num;
562   __u32 qp_access_flags;
563   __u16 pkey_index;
564   __u16 alt_pkey_index;
565   __u8 qp_state;
566   __u8 cur_qp_state;
567   __u8 path_mtu;
568   __u8 path_mig_state;
569   __u8 sq_draining;
570   __u8 max_rd_atomic;
571   __u8 max_dest_rd_atomic;
572   __u8 min_rnr_timer;
573   __u8 port_num;
574   __u8 timeout;
575   __u8 retry_cnt;
576   __u8 rnr_retry;
577   __u8 alt_port_num;
578   __u8 alt_timeout;
579   __u8 sq_sig_all;
580   __u8 reserved[5];
581   __aligned_u64 driver_data[];
582 };
583 struct ib_uverbs_modify_qp {
584   struct ib_uverbs_qp_dest dest;
585   struct ib_uverbs_qp_dest alt_dest;
586   __u32 qp_handle;
587   __u32 attr_mask;
588   __u32 qkey;
589   __u32 rq_psn;
590   __u32 sq_psn;
591   __u32 dest_qp_num;
592   __u32 qp_access_flags;
593   __u16 pkey_index;
594   __u16 alt_pkey_index;
595   __u8 qp_state;
596   __u8 cur_qp_state;
597   __u8 path_mtu;
598   __u8 path_mig_state;
599   __u8 en_sqd_async_notify;
600   __u8 max_rd_atomic;
601   __u8 max_dest_rd_atomic;
602   __u8 min_rnr_timer;
603   __u8 port_num;
604   __u8 timeout;
605   __u8 retry_cnt;
606   __u8 rnr_retry;
607   __u8 alt_port_num;
608   __u8 alt_timeout;
609   __u8 reserved[2];
610   __aligned_u64 driver_data[0];
611 };
612 struct ib_uverbs_ex_modify_qp {
613   struct ib_uverbs_modify_qp base;
614   __u32 rate_limit;
615   __u32 reserved;
616 };
617 struct ib_uverbs_ex_modify_qp_resp {
618   __u32 comp_mask;
619   __u32 response_length;
620 };
621 struct ib_uverbs_destroy_qp {
622   __aligned_u64 response;
623   __u32 qp_handle;
624   __u32 reserved;
625 };
626 struct ib_uverbs_destroy_qp_resp {
627   __u32 events_reported;
628 };
629 struct ib_uverbs_sge {
630   __aligned_u64 addr;
631   __u32 length;
632   __u32 lkey;
633 };
634 enum ib_uverbs_wr_opcode {
635   IB_UVERBS_WR_RDMA_WRITE = 0,
636   IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
637   IB_UVERBS_WR_SEND = 2,
638   IB_UVERBS_WR_SEND_WITH_IMM = 3,
639   IB_UVERBS_WR_RDMA_READ = 4,
640   IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
641   IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
642   IB_UVERBS_WR_LOCAL_INV = 7,
643   IB_UVERBS_WR_BIND_MW = 8,
644   IB_UVERBS_WR_SEND_WITH_INV = 9,
645   IB_UVERBS_WR_TSO = 10,
646   IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
647   IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
648   IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
649   IB_UVERBS_WR_FLUSH = 14,
650   IB_UVERBS_WR_ATOMIC_WRITE = 15,
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[];
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[];
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[];
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[];
727 };
728 struct ib_uverbs_create_ah_resp {
729   __u32 ah_handle;
730   __u32 driver_data[];
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[];
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[];
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[];
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[];
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[];
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[];
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[];
997 };
998 struct ib_uverbs_query_srq {
999   __aligned_u64 response;
1000   __u32 srq_handle;
1001   __u32 reserved;
1002   __aligned_u64 driver_data[];
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[];
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 enum ib_uverbs_device_cap_flags {
1083   IB_UVERBS_DEVICE_RESIZE_MAX_WR = 1 << 0,
1084   IB_UVERBS_DEVICE_BAD_PKEY_CNTR = 1 << 1,
1085   IB_UVERBS_DEVICE_BAD_QKEY_CNTR = 1 << 2,
1086   IB_UVERBS_DEVICE_RAW_MULTI = 1 << 3,
1087   IB_UVERBS_DEVICE_AUTO_PATH_MIG = 1 << 4,
1088   IB_UVERBS_DEVICE_CHANGE_PHY_PORT = 1 << 5,
1089   IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = 1 << 6,
1090   IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = 1 << 7,
1091   IB_UVERBS_DEVICE_SHUTDOWN_PORT = 1 << 8,
1092   IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = 1 << 10,
1093   IB_UVERBS_DEVICE_SYS_IMAGE_GUID = 1 << 11,
1094   IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = 1 << 12,
1095   IB_UVERBS_DEVICE_SRQ_RESIZE = 1 << 13,
1096   IB_UVERBS_DEVICE_N_NOTIFY_CQ = 1 << 14,
1097   IB_UVERBS_DEVICE_MEM_WINDOW = 1 << 17,
1098   IB_UVERBS_DEVICE_UD_IP_CSUM = 1 << 18,
1099   IB_UVERBS_DEVICE_XRC = 1 << 20,
1100   IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = 1 << 21,
1101   IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = 1 << 23,
1102   IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = 1 << 24,
1103   IB_UVERBS_DEVICE_RC_IP_CSUM = 1 << 25,
1104   IB_UVERBS_DEVICE_RAW_IP_CSUM = 1 << 26,
1105   IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = 1 << 29,
1106   IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
1107   IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
1108   IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38,
1109   IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39,
1110   IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
1111 };
1112 enum ib_uverbs_raw_packet_caps {
1113   IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
1114   IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
1115   IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
1116   IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
1117 };
1118 #endif
1119