Home | History | Annotate | Download | only in rdma
      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 };
    205 struct ib_uverbs_query_port {
    206   __aligned_u64 response;
    207   __u8 port_num;
    208   __u8 reserved[7];
    209   __aligned_u64 driver_data[0];
    210 };
    211 struct ib_uverbs_query_port_resp {
    212   __u32 port_cap_flags;
    213   __u32 max_msg_sz;
    214   __u32 bad_pkey_cntr;
    215   __u32 qkey_viol_cntr;
    216   __u32 gid_tbl_len;
    217   __u16 pkey_tbl_len;
    218   __u16 lid;
    219   __u16 sm_lid;
    220   __u8 state;
    221   __u8 max_mtu;
    222   __u8 active_mtu;
    223   __u8 lmc;
    224   __u8 max_vl_num;
    225   __u8 sm_sl;
    226   __u8 subnet_timeout;
    227   __u8 init_type_reply;
    228   __u8 active_width;
    229   __u8 active_speed;
    230   __u8 phys_state;
    231   __u8 link_layer;
    232   __u8 flags;
    233   __u8 reserved;
    234 };
    235 struct ib_uverbs_alloc_pd {
    236   __aligned_u64 response;
    237   __aligned_u64 driver_data[0];
    238 };
    239 struct ib_uverbs_alloc_pd_resp {
    240   __u32 pd_handle;
    241   __u32 driver_data[0];
    242 };
    243 struct ib_uverbs_dealloc_pd {
    244   __u32 pd_handle;
    245 };
    246 struct ib_uverbs_open_xrcd {
    247   __aligned_u64 response;
    248   __u32 fd;
    249   __u32 oflags;
    250   __aligned_u64 driver_data[0];
    251 };
    252 struct ib_uverbs_open_xrcd_resp {
    253   __u32 xrcd_handle;
    254   __u32 driver_data[0];
    255 };
    256 struct ib_uverbs_close_xrcd {
    257   __u32 xrcd_handle;
    258 };
    259 struct ib_uverbs_reg_mr {
    260   __aligned_u64 response;
    261   __aligned_u64 start;
    262   __aligned_u64 length;
    263   __aligned_u64 hca_va;
    264   __u32 pd_handle;
    265   __u32 access_flags;
    266   __aligned_u64 driver_data[0];
    267 };
    268 struct ib_uverbs_reg_mr_resp {
    269   __u32 mr_handle;
    270   __u32 lkey;
    271   __u32 rkey;
    272   __u32 driver_data[0];
    273 };
    274 struct ib_uverbs_rereg_mr {
    275   __aligned_u64 response;
    276   __u32 mr_handle;
    277   __u32 flags;
    278   __aligned_u64 start;
    279   __aligned_u64 length;
    280   __aligned_u64 hca_va;
    281   __u32 pd_handle;
    282   __u32 access_flags;
    283   __aligned_u64 driver_data[0];
    284 };
    285 struct ib_uverbs_rereg_mr_resp {
    286   __u32 lkey;
    287   __u32 rkey;
    288   __aligned_u64 driver_data[0];
    289 };
    290 struct ib_uverbs_dereg_mr {
    291   __u32 mr_handle;
    292 };
    293 struct ib_uverbs_alloc_mw {
    294   __aligned_u64 response;
    295   __u32 pd_handle;
    296   __u8 mw_type;
    297   __u8 reserved[3];
    298   __aligned_u64 driver_data[0];
    299 };
    300 struct ib_uverbs_alloc_mw_resp {
    301   __u32 mw_handle;
    302   __u32 rkey;
    303   __aligned_u64 driver_data[0];
    304 };
    305 struct ib_uverbs_dealloc_mw {
    306   __u32 mw_handle;
    307 };
    308 struct ib_uverbs_create_comp_channel {
    309   __aligned_u64 response;
    310 };
    311 struct ib_uverbs_create_comp_channel_resp {
    312   __u32 fd;
    313 };
    314 struct ib_uverbs_create_cq {
    315   __aligned_u64 response;
    316   __aligned_u64 user_handle;
    317   __u32 cqe;
    318   __u32 comp_vector;
    319   __s32 comp_channel;
    320   __u32 reserved;
    321   __aligned_u64 driver_data[0];
    322 };
    323 enum ib_uverbs_ex_create_cq_flags {
    324   IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
    325   IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
    326 };
    327 struct ib_uverbs_ex_create_cq {
    328   __aligned_u64 user_handle;
    329   __u32 cqe;
    330   __u32 comp_vector;
    331   __s32 comp_channel;
    332   __u32 comp_mask;
    333   __u32 flags;
    334   __u32 reserved;
    335 };
    336 struct ib_uverbs_create_cq_resp {
    337   __u32 cq_handle;
    338   __u32 cqe;
    339   __aligned_u64 driver_data[0];
    340 };
    341 struct ib_uverbs_ex_create_cq_resp {
    342   struct ib_uverbs_create_cq_resp base;
    343   __u32 comp_mask;
    344   __u32 response_length;
    345 };
    346 struct ib_uverbs_resize_cq {
    347   __aligned_u64 response;
    348   __u32 cq_handle;
    349   __u32 cqe;
    350   __aligned_u64 driver_data[0];
    351 };
    352 struct ib_uverbs_resize_cq_resp {
    353   __u32 cqe;
    354   __u32 reserved;
    355   __aligned_u64 driver_data[0];
    356 };
    357 struct ib_uverbs_poll_cq {
    358   __aligned_u64 response;
    359   __u32 cq_handle;
    360   __u32 ne;
    361 };
    362 struct ib_uverbs_wc {
    363   __aligned_u64 wr_id;
    364   __u32 status;
    365   __u32 opcode;
    366   __u32 vendor_err;
    367   __u32 byte_len;
    368   union {
    369     __be32 imm_data;
    370     __u32 invalidate_rkey;
    371   } ex;
    372   __u32 qp_num;
    373   __u32 src_qp;
    374   __u32 wc_flags;
    375   __u16 pkey_index;
    376   __u16 slid;
    377   __u8 sl;
    378   __u8 dlid_path_bits;
    379   __u8 port_num;
    380   __u8 reserved;
    381 };
    382 struct ib_uverbs_poll_cq_resp {
    383   __u32 count;
    384   __u32 reserved;
    385   struct ib_uverbs_wc wc[0];
    386 };
    387 struct ib_uverbs_req_notify_cq {
    388   __u32 cq_handle;
    389   __u32 solicited_only;
    390 };
    391 struct ib_uverbs_destroy_cq {
    392   __aligned_u64 response;
    393   __u32 cq_handle;
    394   __u32 reserved;
    395 };
    396 struct ib_uverbs_destroy_cq_resp {
    397   __u32 comp_events_reported;
    398   __u32 async_events_reported;
    399 };
    400 struct ib_uverbs_global_route {
    401   __u8 dgid[16];
    402   __u32 flow_label;
    403   __u8 sgid_index;
    404   __u8 hop_limit;
    405   __u8 traffic_class;
    406   __u8 reserved;
    407 };
    408 struct ib_uverbs_ah_attr {
    409   struct ib_uverbs_global_route grh;
    410   __u16 dlid;
    411   __u8 sl;
    412   __u8 src_path_bits;
    413   __u8 static_rate;
    414   __u8 is_global;
    415   __u8 port_num;
    416   __u8 reserved;
    417 };
    418 struct ib_uverbs_qp_attr {
    419   __u32 qp_attr_mask;
    420   __u32 qp_state;
    421   __u32 cur_qp_state;
    422   __u32 path_mtu;
    423   __u32 path_mig_state;
    424   __u32 qkey;
    425   __u32 rq_psn;
    426   __u32 sq_psn;
    427   __u32 dest_qp_num;
    428   __u32 qp_access_flags;
    429   struct ib_uverbs_ah_attr ah_attr;
    430   struct ib_uverbs_ah_attr alt_ah_attr;
    431   __u32 max_send_wr;
    432   __u32 max_recv_wr;
    433   __u32 max_send_sge;
    434   __u32 max_recv_sge;
    435   __u32 max_inline_data;
    436   __u16 pkey_index;
    437   __u16 alt_pkey_index;
    438   __u8 en_sqd_async_notify;
    439   __u8 sq_draining;
    440   __u8 max_rd_atomic;
    441   __u8 max_dest_rd_atomic;
    442   __u8 min_rnr_timer;
    443   __u8 port_num;
    444   __u8 timeout;
    445   __u8 retry_cnt;
    446   __u8 rnr_retry;
    447   __u8 alt_port_num;
    448   __u8 alt_timeout;
    449   __u8 reserved[5];
    450 };
    451 struct ib_uverbs_create_qp {
    452   __aligned_u64 response;
    453   __aligned_u64 user_handle;
    454   __u32 pd_handle;
    455   __u32 send_cq_handle;
    456   __u32 recv_cq_handle;
    457   __u32 srq_handle;
    458   __u32 max_send_wr;
    459   __u32 max_recv_wr;
    460   __u32 max_send_sge;
    461   __u32 max_recv_sge;
    462   __u32 max_inline_data;
    463   __u8 sq_sig_all;
    464   __u8 qp_type;
    465   __u8 is_srq;
    466   __u8 reserved;
    467   __aligned_u64 driver_data[0];
    468 };
    469 enum ib_uverbs_create_qp_mask {
    470   IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
    471 };
    472 enum {
    473   IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
    474 };
    475 enum {
    476   IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
    477 };
    478 enum {
    479   IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
    480 };
    481 struct ib_uverbs_ex_create_qp {
    482   __aligned_u64 user_handle;
    483   __u32 pd_handle;
    484   __u32 send_cq_handle;
    485   __u32 recv_cq_handle;
    486   __u32 srq_handle;
    487   __u32 max_send_wr;
    488   __u32 max_recv_wr;
    489   __u32 max_send_sge;
    490   __u32 max_recv_sge;
    491   __u32 max_inline_data;
    492   __u8 sq_sig_all;
    493   __u8 qp_type;
    494   __u8 is_srq;
    495   __u8 reserved;
    496   __u32 comp_mask;
    497   __u32 create_flags;
    498   __u32 rwq_ind_tbl_handle;
    499   __u32 source_qpn;
    500 };
    501 struct ib_uverbs_open_qp {
    502   __aligned_u64 response;
    503   __aligned_u64 user_handle;
    504   __u32 pd_handle;
    505   __u32 qpn;
    506   __u8 qp_type;
    507   __u8 reserved[7];
    508   __aligned_u64 driver_data[0];
    509 };
    510 struct ib_uverbs_create_qp_resp {
    511   __u32 qp_handle;
    512   __u32 qpn;
    513   __u32 max_send_wr;
    514   __u32 max_recv_wr;
    515   __u32 max_send_sge;
    516   __u32 max_recv_sge;
    517   __u32 max_inline_data;
    518   __u32 reserved;
    519   __u32 driver_data[0];
    520 };
    521 struct ib_uverbs_ex_create_qp_resp {
    522   struct ib_uverbs_create_qp_resp base;
    523   __u32 comp_mask;
    524   __u32 response_length;
    525 };
    526 struct ib_uverbs_qp_dest {
    527   __u8 dgid[16];
    528   __u32 flow_label;
    529   __u16 dlid;
    530   __u16 reserved;
    531   __u8 sgid_index;
    532   __u8 hop_limit;
    533   __u8 traffic_class;
    534   __u8 sl;
    535   __u8 src_path_bits;
    536   __u8 static_rate;
    537   __u8 is_global;
    538   __u8 port_num;
    539 };
    540 struct ib_uverbs_query_qp {
    541   __aligned_u64 response;
    542   __u32 qp_handle;
    543   __u32 attr_mask;
    544   __aligned_u64 driver_data[0];
    545 };
    546 struct ib_uverbs_query_qp_resp {
    547   struct ib_uverbs_qp_dest dest;
    548   struct ib_uverbs_qp_dest alt_dest;
    549   __u32 max_send_wr;
    550   __u32 max_recv_wr;
    551   __u32 max_send_sge;
    552   __u32 max_recv_sge;
    553   __u32 max_inline_data;
    554   __u32 qkey;
    555   __u32 rq_psn;
    556   __u32 sq_psn;
    557   __u32 dest_qp_num;
    558   __u32 qp_access_flags;
    559   __u16 pkey_index;
    560   __u16 alt_pkey_index;
    561   __u8 qp_state;
    562   __u8 cur_qp_state;
    563   __u8 path_mtu;
    564   __u8 path_mig_state;
    565   __u8 sq_draining;
    566   __u8 max_rd_atomic;
    567   __u8 max_dest_rd_atomic;
    568   __u8 min_rnr_timer;
    569   __u8 port_num;
    570   __u8 timeout;
    571   __u8 retry_cnt;
    572   __u8 rnr_retry;
    573   __u8 alt_port_num;
    574   __u8 alt_timeout;
    575   __u8 sq_sig_all;
    576   __u8 reserved[5];
    577   __aligned_u64 driver_data[0];
    578 };
    579 struct ib_uverbs_modify_qp {
    580   struct ib_uverbs_qp_dest dest;
    581   struct ib_uverbs_qp_dest alt_dest;
    582   __u32 qp_handle;
    583   __u32 attr_mask;
    584   __u32 qkey;
    585   __u32 rq_psn;
    586   __u32 sq_psn;
    587   __u32 dest_qp_num;
    588   __u32 qp_access_flags;
    589   __u16 pkey_index;
    590   __u16 alt_pkey_index;
    591   __u8 qp_state;
    592   __u8 cur_qp_state;
    593   __u8 path_mtu;
    594   __u8 path_mig_state;
    595   __u8 en_sqd_async_notify;
    596   __u8 max_rd_atomic;
    597   __u8 max_dest_rd_atomic;
    598   __u8 min_rnr_timer;
    599   __u8 port_num;
    600   __u8 timeout;
    601   __u8 retry_cnt;
    602   __u8 rnr_retry;
    603   __u8 alt_port_num;
    604   __u8 alt_timeout;
    605   __u8 reserved[2];
    606   __aligned_u64 driver_data[0];
    607 };
    608 struct ib_uverbs_ex_modify_qp {
    609   struct ib_uverbs_modify_qp base;
    610   __u32 rate_limit;
    611   __u32 reserved;
    612 };
    613 struct ib_uverbs_ex_modify_qp_resp {
    614   __u32 comp_mask;
    615   __u32 response_length;
    616 };
    617 struct ib_uverbs_destroy_qp {
    618   __aligned_u64 response;
    619   __u32 qp_handle;
    620   __u32 reserved;
    621 };
    622 struct ib_uverbs_destroy_qp_resp {
    623   __u32 events_reported;
    624 };
    625 struct ib_uverbs_sge {
    626   __aligned_u64 addr;
    627   __u32 length;
    628   __u32 lkey;
    629 };
    630 enum ib_uverbs_wr_opcode {
    631   IB_UVERBS_WR_RDMA_WRITE = 0,
    632   IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
    633   IB_UVERBS_WR_SEND = 2,
    634   IB_UVERBS_WR_SEND_WITH_IMM = 3,
    635   IB_UVERBS_WR_RDMA_READ = 4,
    636   IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
    637   IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
    638   IB_UVERBS_WR_LOCAL_INV = 7,
    639   IB_UVERBS_WR_BIND_MW = 8,
    640   IB_UVERBS_WR_SEND_WITH_INV = 9,
    641   IB_UVERBS_WR_TSO = 10,
    642   IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
    643   IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
    644   IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
    645 };
    646 struct ib_uverbs_send_wr {
    647   __aligned_u64 wr_id;
    648   __u32 num_sge;
    649   __u32 opcode;
    650   __u32 send_flags;
    651   union {
    652     __be32 imm_data;
    653     __u32 invalidate_rkey;
    654   } ex;
    655   union {
    656     struct {
    657       __aligned_u64 remote_addr;
    658       __u32 rkey;
    659       __u32 reserved;
    660     } rdma;
    661     struct {
    662       __aligned_u64 remote_addr;
    663       __aligned_u64 compare_add;
    664       __aligned_u64 swap;
    665       __u32 rkey;
    666       __u32 reserved;
    667     } atomic;
    668     struct {
    669       __u32 ah;
    670       __u32 remote_qpn;
    671       __u32 remote_qkey;
    672       __u32 reserved;
    673     } ud;
    674   } wr;
    675 };
    676 struct ib_uverbs_post_send {
    677   __aligned_u64 response;
    678   __u32 qp_handle;
    679   __u32 wr_count;
    680   __u32 sge_count;
    681   __u32 wqe_size;
    682   struct ib_uverbs_send_wr send_wr[0];
    683 };
    684 struct ib_uverbs_post_send_resp {
    685   __u32 bad_wr;
    686 };
    687 struct ib_uverbs_recv_wr {
    688   __aligned_u64 wr_id;
    689   __u32 num_sge;
    690   __u32 reserved;
    691 };
    692 struct ib_uverbs_post_recv {
    693   __aligned_u64 response;
    694   __u32 qp_handle;
    695   __u32 wr_count;
    696   __u32 sge_count;
    697   __u32 wqe_size;
    698   struct ib_uverbs_recv_wr recv_wr[0];
    699 };
    700 struct ib_uverbs_post_recv_resp {
    701   __u32 bad_wr;
    702 };
    703 struct ib_uverbs_post_srq_recv {
    704   __aligned_u64 response;
    705   __u32 srq_handle;
    706   __u32 wr_count;
    707   __u32 sge_count;
    708   __u32 wqe_size;
    709   struct ib_uverbs_recv_wr recv[0];
    710 };
    711 struct ib_uverbs_post_srq_recv_resp {
    712   __u32 bad_wr;
    713 };
    714 struct ib_uverbs_create_ah {
    715   __aligned_u64 response;
    716   __aligned_u64 user_handle;
    717   __u32 pd_handle;
    718   __u32 reserved;
    719   struct ib_uverbs_ah_attr attr;
    720   __aligned_u64 driver_data[0];
    721 };
    722 struct ib_uverbs_create_ah_resp {
    723   __u32 ah_handle;
    724   __u32 driver_data[0];
    725 };
    726 struct ib_uverbs_destroy_ah {
    727   __u32 ah_handle;
    728 };
    729 struct ib_uverbs_attach_mcast {
    730   __u8 gid[16];
    731   __u32 qp_handle;
    732   __u16 mlid;
    733   __u16 reserved;
    734   __aligned_u64 driver_data[0];
    735 };
    736 struct ib_uverbs_detach_mcast {
    737   __u8 gid[16];
    738   __u32 qp_handle;
    739   __u16 mlid;
    740   __u16 reserved;
    741   __aligned_u64 driver_data[0];
    742 };
    743 struct ib_uverbs_flow_spec_hdr {
    744   __u32 type;
    745   __u16 size;
    746   __u16 reserved;
    747   __aligned_u64 flow_spec_data[0];
    748 };
    749 struct ib_uverbs_flow_eth_filter {
    750   __u8 dst_mac[6];
    751   __u8 src_mac[6];
    752   __be16 ether_type;
    753   __be16 vlan_tag;
    754 };
    755 struct ib_uverbs_flow_spec_eth {
    756   union {
    757     struct ib_uverbs_flow_spec_hdr hdr;
    758     struct {
    759       __u32 type;
    760       __u16 size;
    761       __u16 reserved;
    762     };
    763   };
    764   struct ib_uverbs_flow_eth_filter val;
    765   struct ib_uverbs_flow_eth_filter mask;
    766 };
    767 struct ib_uverbs_flow_ipv4_filter {
    768   __be32 src_ip;
    769   __be32 dst_ip;
    770   __u8 proto;
    771   __u8 tos;
    772   __u8 ttl;
    773   __u8 flags;
    774 };
    775 struct ib_uverbs_flow_spec_ipv4 {
    776   union {
    777     struct ib_uverbs_flow_spec_hdr hdr;
    778     struct {
    779       __u32 type;
    780       __u16 size;
    781       __u16 reserved;
    782     };
    783   };
    784   struct ib_uverbs_flow_ipv4_filter val;
    785   struct ib_uverbs_flow_ipv4_filter mask;
    786 };
    787 struct ib_uverbs_flow_tcp_udp_filter {
    788   __be16 dst_port;
    789   __be16 src_port;
    790 };
    791 struct ib_uverbs_flow_spec_tcp_udp {
    792   union {
    793     struct ib_uverbs_flow_spec_hdr hdr;
    794     struct {
    795       __u32 type;
    796       __u16 size;
    797       __u16 reserved;
    798     };
    799   };
    800   struct ib_uverbs_flow_tcp_udp_filter val;
    801   struct ib_uverbs_flow_tcp_udp_filter mask;
    802 };
    803 struct ib_uverbs_flow_ipv6_filter {
    804   __u8 src_ip[16];
    805   __u8 dst_ip[16];
    806   __be32 flow_label;
    807   __u8 next_hdr;
    808   __u8 traffic_class;
    809   __u8 hop_limit;
    810   __u8 reserved;
    811 };
    812 struct ib_uverbs_flow_spec_ipv6 {
    813   union {
    814     struct ib_uverbs_flow_spec_hdr hdr;
    815     struct {
    816       __u32 type;
    817       __u16 size;
    818       __u16 reserved;
    819     };
    820   };
    821   struct ib_uverbs_flow_ipv6_filter val;
    822   struct ib_uverbs_flow_ipv6_filter mask;
    823 };
    824 struct ib_uverbs_flow_spec_action_tag {
    825   union {
    826     struct ib_uverbs_flow_spec_hdr hdr;
    827     struct {
    828       __u32 type;
    829       __u16 size;
    830       __u16 reserved;
    831     };
    832   };
    833   __u32 tag_id;
    834   __u32 reserved1;
    835 };
    836 struct ib_uverbs_flow_spec_action_drop {
    837   union {
    838     struct ib_uverbs_flow_spec_hdr hdr;
    839     struct {
    840       __u32 type;
    841       __u16 size;
    842       __u16 reserved;
    843     };
    844   };
    845 };
    846 struct ib_uverbs_flow_spec_action_handle {
    847   union {
    848     struct ib_uverbs_flow_spec_hdr hdr;
    849     struct {
    850       __u32 type;
    851       __u16 size;
    852       __u16 reserved;
    853     };
    854   };
    855   __u32 handle;
    856   __u32 reserved1;
    857 };
    858 struct ib_uverbs_flow_spec_action_count {
    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_tunnel_filter {
    871   __be32 tunnel_id;
    872 };
    873 struct ib_uverbs_flow_spec_tunnel {
    874   union {
    875     struct ib_uverbs_flow_spec_hdr hdr;
    876     struct {
    877       __u32 type;
    878       __u16 size;
    879       __u16 reserved;
    880     };
    881   };
    882   struct ib_uverbs_flow_tunnel_filter val;
    883   struct ib_uverbs_flow_tunnel_filter mask;
    884 };
    885 struct ib_uverbs_flow_spec_esp_filter {
    886   __u32 spi;
    887   __u32 seq;
    888 };
    889 struct ib_uverbs_flow_spec_esp {
    890   union {
    891     struct ib_uverbs_flow_spec_hdr hdr;
    892     struct {
    893       __u32 type;
    894       __u16 size;
    895       __u16 reserved;
    896     };
    897   };
    898   struct ib_uverbs_flow_spec_esp_filter val;
    899   struct ib_uverbs_flow_spec_esp_filter mask;
    900 };
    901 struct ib_uverbs_flow_gre_filter {
    902   __be16 c_ks_res0_ver;
    903   __be16 protocol;
    904   __be32 key;
    905 };
    906 struct ib_uverbs_flow_spec_gre {
    907   union {
    908     struct ib_uverbs_flow_spec_hdr hdr;
    909     struct {
    910       __u32 type;
    911       __u16 size;
    912       __u16 reserved;
    913     };
    914   };
    915   struct ib_uverbs_flow_gre_filter val;
    916   struct ib_uverbs_flow_gre_filter mask;
    917 };
    918 struct ib_uverbs_flow_mpls_filter {
    919   __be32 label;
    920 };
    921 struct ib_uverbs_flow_spec_mpls {
    922   union {
    923     struct ib_uverbs_flow_spec_hdr hdr;
    924     struct {
    925       __u32 type;
    926       __u16 size;
    927       __u16 reserved;
    928     };
    929   };
    930   struct ib_uverbs_flow_mpls_filter val;
    931   struct ib_uverbs_flow_mpls_filter mask;
    932 };
    933 struct ib_uverbs_flow_attr {
    934   __u32 type;
    935   __u16 size;
    936   __u16 priority;
    937   __u8 num_of_specs;
    938   __u8 reserved[2];
    939   __u8 port;
    940   __u32 flags;
    941   struct ib_uverbs_flow_spec_hdr flow_specs[0];
    942 };
    943 struct ib_uverbs_create_flow {
    944   __u32 comp_mask;
    945   __u32 qp_handle;
    946   struct ib_uverbs_flow_attr flow_attr;
    947 };
    948 struct ib_uverbs_create_flow_resp {
    949   __u32 comp_mask;
    950   __u32 flow_handle;
    951 };
    952 struct ib_uverbs_destroy_flow {
    953   __u32 comp_mask;
    954   __u32 flow_handle;
    955 };
    956 struct ib_uverbs_create_srq {
    957   __aligned_u64 response;
    958   __aligned_u64 user_handle;
    959   __u32 pd_handle;
    960   __u32 max_wr;
    961   __u32 max_sge;
    962   __u32 srq_limit;
    963   __aligned_u64 driver_data[0];
    964 };
    965 struct ib_uverbs_create_xsrq {
    966   __aligned_u64 response;
    967   __aligned_u64 user_handle;
    968   __u32 srq_type;
    969   __u32 pd_handle;
    970   __u32 max_wr;
    971   __u32 max_sge;
    972   __u32 srq_limit;
    973   __u32 max_num_tags;
    974   __u32 xrcd_handle;
    975   __u32 cq_handle;
    976   __aligned_u64 driver_data[0];
    977 };
    978 struct ib_uverbs_create_srq_resp {
    979   __u32 srq_handle;
    980   __u32 max_wr;
    981   __u32 max_sge;
    982   __u32 srqn;
    983   __u32 driver_data[0];
    984 };
    985 struct ib_uverbs_modify_srq {
    986   __u32 srq_handle;
    987   __u32 attr_mask;
    988   __u32 max_wr;
    989   __u32 srq_limit;
    990   __aligned_u64 driver_data[0];
    991 };
    992 struct ib_uverbs_query_srq {
    993   __aligned_u64 response;
    994   __u32 srq_handle;
    995   __u32 reserved;
    996   __aligned_u64 driver_data[0];
    997 };
    998 struct ib_uverbs_query_srq_resp {
    999   __u32 max_wr;
   1000   __u32 max_sge;
   1001   __u32 srq_limit;
   1002   __u32 reserved;
   1003 };
   1004 struct ib_uverbs_destroy_srq {
   1005   __aligned_u64 response;
   1006   __u32 srq_handle;
   1007   __u32 reserved;
   1008 };
   1009 struct ib_uverbs_destroy_srq_resp {
   1010   __u32 events_reported;
   1011 };
   1012 struct ib_uverbs_ex_create_wq {
   1013   __u32 comp_mask;
   1014   __u32 wq_type;
   1015   __aligned_u64 user_handle;
   1016   __u32 pd_handle;
   1017   __u32 cq_handle;
   1018   __u32 max_wr;
   1019   __u32 max_sge;
   1020   __u32 create_flags;
   1021   __u32 reserved;
   1022 };
   1023 struct ib_uverbs_ex_create_wq_resp {
   1024   __u32 comp_mask;
   1025   __u32 response_length;
   1026   __u32 wq_handle;
   1027   __u32 max_wr;
   1028   __u32 max_sge;
   1029   __u32 wqn;
   1030 };
   1031 struct ib_uverbs_ex_destroy_wq {
   1032   __u32 comp_mask;
   1033   __u32 wq_handle;
   1034 };
   1035 struct ib_uverbs_ex_destroy_wq_resp {
   1036   __u32 comp_mask;
   1037   __u32 response_length;
   1038   __u32 events_reported;
   1039   __u32 reserved;
   1040 };
   1041 struct ib_uverbs_ex_modify_wq {
   1042   __u32 attr_mask;
   1043   __u32 wq_handle;
   1044   __u32 wq_state;
   1045   __u32 curr_wq_state;
   1046   __u32 flags;
   1047   __u32 flags_mask;
   1048 };
   1049 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
   1050 struct ib_uverbs_ex_create_rwq_ind_table {
   1051   __u32 comp_mask;
   1052   __u32 log_ind_tbl_size;
   1053   __u32 wq_handles[0];
   1054 };
   1055 struct ib_uverbs_ex_create_rwq_ind_table_resp {
   1056   __u32 comp_mask;
   1057   __u32 response_length;
   1058   __u32 ind_tbl_handle;
   1059   __u32 ind_tbl_num;
   1060 };
   1061 struct ib_uverbs_ex_destroy_rwq_ind_table {
   1062   __u32 comp_mask;
   1063   __u32 ind_tbl_handle;
   1064 };
   1065 struct ib_uverbs_cq_moderation {
   1066   __u16 cq_count;
   1067   __u16 cq_period;
   1068 };
   1069 struct ib_uverbs_ex_modify_cq {
   1070   __u32 cq_handle;
   1071   __u32 attr_mask;
   1072   struct ib_uverbs_cq_moderation attr;
   1073   __u32 reserved;
   1074 };
   1075 #define IB_DEVICE_NAME_MAX 64
   1076 #endif
   1077