0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef IB_USER_VERBS_H
0038 #define IB_USER_VERBS_H
0039
0040 #include <linux/types.h>
0041
0042
0043
0044
0045
0046 #define IB_USER_VERBS_ABI_VERSION 6
0047 #define IB_USER_VERBS_CMD_THRESHOLD 50
0048
0049 enum ib_uverbs_write_cmds {
0050 IB_USER_VERBS_CMD_GET_CONTEXT,
0051 IB_USER_VERBS_CMD_QUERY_DEVICE,
0052 IB_USER_VERBS_CMD_QUERY_PORT,
0053 IB_USER_VERBS_CMD_ALLOC_PD,
0054 IB_USER_VERBS_CMD_DEALLOC_PD,
0055 IB_USER_VERBS_CMD_CREATE_AH,
0056 IB_USER_VERBS_CMD_MODIFY_AH,
0057 IB_USER_VERBS_CMD_QUERY_AH,
0058 IB_USER_VERBS_CMD_DESTROY_AH,
0059 IB_USER_VERBS_CMD_REG_MR,
0060 IB_USER_VERBS_CMD_REG_SMR,
0061 IB_USER_VERBS_CMD_REREG_MR,
0062 IB_USER_VERBS_CMD_QUERY_MR,
0063 IB_USER_VERBS_CMD_DEREG_MR,
0064 IB_USER_VERBS_CMD_ALLOC_MW,
0065 IB_USER_VERBS_CMD_BIND_MW,
0066 IB_USER_VERBS_CMD_DEALLOC_MW,
0067 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
0068 IB_USER_VERBS_CMD_CREATE_CQ,
0069 IB_USER_VERBS_CMD_RESIZE_CQ,
0070 IB_USER_VERBS_CMD_DESTROY_CQ,
0071 IB_USER_VERBS_CMD_POLL_CQ,
0072 IB_USER_VERBS_CMD_PEEK_CQ,
0073 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
0074 IB_USER_VERBS_CMD_CREATE_QP,
0075 IB_USER_VERBS_CMD_QUERY_QP,
0076 IB_USER_VERBS_CMD_MODIFY_QP,
0077 IB_USER_VERBS_CMD_DESTROY_QP,
0078 IB_USER_VERBS_CMD_POST_SEND,
0079 IB_USER_VERBS_CMD_POST_RECV,
0080 IB_USER_VERBS_CMD_ATTACH_MCAST,
0081 IB_USER_VERBS_CMD_DETACH_MCAST,
0082 IB_USER_VERBS_CMD_CREATE_SRQ,
0083 IB_USER_VERBS_CMD_MODIFY_SRQ,
0084 IB_USER_VERBS_CMD_QUERY_SRQ,
0085 IB_USER_VERBS_CMD_DESTROY_SRQ,
0086 IB_USER_VERBS_CMD_POST_SRQ_RECV,
0087 IB_USER_VERBS_CMD_OPEN_XRCD,
0088 IB_USER_VERBS_CMD_CLOSE_XRCD,
0089 IB_USER_VERBS_CMD_CREATE_XSRQ,
0090 IB_USER_VERBS_CMD_OPEN_QP,
0091 };
0092
0093 enum {
0094 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
0095 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
0096 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
0097 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
0098 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
0099 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
0100 IB_USER_VERBS_EX_CMD_CREATE_WQ,
0101 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
0102 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
0103 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
0104 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
0105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
0106 };
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119 struct ib_uverbs_async_event_desc {
0120 __aligned_u64 element;
0121 __u32 event_type;
0122 __u32 reserved;
0123 };
0124
0125 struct ib_uverbs_comp_event_desc {
0126 __aligned_u64 cq_handle;
0127 };
0128
0129 struct ib_uverbs_cq_moderation_caps {
0130 __u16 max_cq_moderation_count;
0131 __u16 max_cq_moderation_period;
0132 __u32 reserved;
0133 };
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
0144 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
0145
0146 struct ib_uverbs_cmd_hdr {
0147 __u32 command;
0148 __u16 in_words;
0149 __u16 out_words;
0150 };
0151
0152 struct ib_uverbs_ex_cmd_hdr {
0153 __aligned_u64 response;
0154 __u16 provider_in_words;
0155 __u16 provider_out_words;
0156 __u32 cmd_hdr_reserved;
0157 };
0158
0159 struct ib_uverbs_get_context {
0160 __aligned_u64 response;
0161 __aligned_u64 driver_data[];
0162 };
0163
0164 struct ib_uverbs_get_context_resp {
0165 __u32 async_fd;
0166 __u32 num_comp_vectors;
0167 __aligned_u64 driver_data[];
0168 };
0169
0170 struct ib_uverbs_query_device {
0171 __aligned_u64 response;
0172 __aligned_u64 driver_data[];
0173 };
0174
0175 struct ib_uverbs_query_device_resp {
0176 __aligned_u64 fw_ver;
0177 __be64 node_guid;
0178 __be64 sys_image_guid;
0179 __aligned_u64 max_mr_size;
0180 __aligned_u64 page_size_cap;
0181 __u32 vendor_id;
0182 __u32 vendor_part_id;
0183 __u32 hw_ver;
0184 __u32 max_qp;
0185 __u32 max_qp_wr;
0186 __u32 device_cap_flags;
0187 __u32 max_sge;
0188 __u32 max_sge_rd;
0189 __u32 max_cq;
0190 __u32 max_cqe;
0191 __u32 max_mr;
0192 __u32 max_pd;
0193 __u32 max_qp_rd_atom;
0194 __u32 max_ee_rd_atom;
0195 __u32 max_res_rd_atom;
0196 __u32 max_qp_init_rd_atom;
0197 __u32 max_ee_init_rd_atom;
0198 __u32 atomic_cap;
0199 __u32 max_ee;
0200 __u32 max_rdd;
0201 __u32 max_mw;
0202 __u32 max_raw_ipv6_qp;
0203 __u32 max_raw_ethy_qp;
0204 __u32 max_mcast_grp;
0205 __u32 max_mcast_qp_attach;
0206 __u32 max_total_mcast_qp_attach;
0207 __u32 max_ah;
0208 __u32 max_fmr;
0209 __u32 max_map_per_fmr;
0210 __u32 max_srq;
0211 __u32 max_srq_wr;
0212 __u32 max_srq_sge;
0213 __u16 max_pkeys;
0214 __u8 local_ca_ack_delay;
0215 __u8 phys_port_cnt;
0216 __u8 reserved[4];
0217 };
0218
0219 struct ib_uverbs_ex_query_device {
0220 __u32 comp_mask;
0221 __u32 reserved;
0222 };
0223
0224 struct ib_uverbs_odp_caps {
0225 __aligned_u64 general_caps;
0226 struct {
0227 __u32 rc_odp_caps;
0228 __u32 uc_odp_caps;
0229 __u32 ud_odp_caps;
0230 } per_transport_caps;
0231 __u32 reserved;
0232 };
0233
0234 struct ib_uverbs_rss_caps {
0235
0236
0237
0238
0239 __u32 supported_qpts;
0240 __u32 max_rwq_indirection_tables;
0241 __u32 max_rwq_indirection_table_size;
0242 __u32 reserved;
0243 };
0244
0245 struct ib_uverbs_tm_caps {
0246
0247 __u32 max_rndv_hdr_size;
0248
0249 __u32 max_num_tags;
0250
0251 __u32 flags;
0252
0253 __u32 max_ops;
0254
0255 __u32 max_sge;
0256 __u32 reserved;
0257 };
0258
0259 struct ib_uverbs_ex_query_device_resp {
0260 struct ib_uverbs_query_device_resp base;
0261 __u32 comp_mask;
0262 __u32 response_length;
0263 struct ib_uverbs_odp_caps odp_caps;
0264 __aligned_u64 timestamp_mask;
0265 __aligned_u64 hca_core_clock;
0266 __aligned_u64 device_cap_flags_ex;
0267 struct ib_uverbs_rss_caps rss_caps;
0268 __u32 max_wq_type_rq;
0269 __u32 raw_packet_caps;
0270 struct ib_uverbs_tm_caps tm_caps;
0271 struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
0272 __aligned_u64 max_dm_size;
0273 __u32 xrc_odp_caps;
0274 __u32 reserved;
0275 };
0276
0277 struct ib_uverbs_query_port {
0278 __aligned_u64 response;
0279 __u8 port_num;
0280 __u8 reserved[7];
0281 __aligned_u64 driver_data[];
0282 };
0283
0284 struct ib_uverbs_query_port_resp {
0285 __u32 port_cap_flags;
0286 __u32 max_msg_sz;
0287 __u32 bad_pkey_cntr;
0288 __u32 qkey_viol_cntr;
0289 __u32 gid_tbl_len;
0290 __u16 pkey_tbl_len;
0291 __u16 lid;
0292 __u16 sm_lid;
0293 __u8 state;
0294 __u8 max_mtu;
0295 __u8 active_mtu;
0296 __u8 lmc;
0297 __u8 max_vl_num;
0298 __u8 sm_sl;
0299 __u8 subnet_timeout;
0300 __u8 init_type_reply;
0301 __u8 active_width;
0302 __u8 active_speed;
0303 __u8 phys_state;
0304 __u8 link_layer;
0305 __u8 flags;
0306 __u8 reserved;
0307 };
0308
0309 struct ib_uverbs_alloc_pd {
0310 __aligned_u64 response;
0311 __aligned_u64 driver_data[];
0312 };
0313
0314 struct ib_uverbs_alloc_pd_resp {
0315 __u32 pd_handle;
0316 __u32 driver_data[];
0317 };
0318
0319 struct ib_uverbs_dealloc_pd {
0320 __u32 pd_handle;
0321 };
0322
0323 struct ib_uverbs_open_xrcd {
0324 __aligned_u64 response;
0325 __u32 fd;
0326 __u32 oflags;
0327 __aligned_u64 driver_data[];
0328 };
0329
0330 struct ib_uverbs_open_xrcd_resp {
0331 __u32 xrcd_handle;
0332 __u32 driver_data[];
0333 };
0334
0335 struct ib_uverbs_close_xrcd {
0336 __u32 xrcd_handle;
0337 };
0338
0339 struct ib_uverbs_reg_mr {
0340 __aligned_u64 response;
0341 __aligned_u64 start;
0342 __aligned_u64 length;
0343 __aligned_u64 hca_va;
0344 __u32 pd_handle;
0345 __u32 access_flags;
0346 __aligned_u64 driver_data[];
0347 };
0348
0349 struct ib_uverbs_reg_mr_resp {
0350 __u32 mr_handle;
0351 __u32 lkey;
0352 __u32 rkey;
0353 __u32 driver_data[];
0354 };
0355
0356 struct ib_uverbs_rereg_mr {
0357 __aligned_u64 response;
0358 __u32 mr_handle;
0359 __u32 flags;
0360 __aligned_u64 start;
0361 __aligned_u64 length;
0362 __aligned_u64 hca_va;
0363 __u32 pd_handle;
0364 __u32 access_flags;
0365 __aligned_u64 driver_data[];
0366 };
0367
0368 struct ib_uverbs_rereg_mr_resp {
0369 __u32 lkey;
0370 __u32 rkey;
0371 __aligned_u64 driver_data[];
0372 };
0373
0374 struct ib_uverbs_dereg_mr {
0375 __u32 mr_handle;
0376 };
0377
0378 struct ib_uverbs_alloc_mw {
0379 __aligned_u64 response;
0380 __u32 pd_handle;
0381 __u8 mw_type;
0382 __u8 reserved[3];
0383 __aligned_u64 driver_data[];
0384 };
0385
0386 struct ib_uverbs_alloc_mw_resp {
0387 __u32 mw_handle;
0388 __u32 rkey;
0389 __aligned_u64 driver_data[];
0390 };
0391
0392 struct ib_uverbs_dealloc_mw {
0393 __u32 mw_handle;
0394 };
0395
0396 struct ib_uverbs_create_comp_channel {
0397 __aligned_u64 response;
0398 };
0399
0400 struct ib_uverbs_create_comp_channel_resp {
0401 __u32 fd;
0402 };
0403
0404 struct ib_uverbs_create_cq {
0405 __aligned_u64 response;
0406 __aligned_u64 user_handle;
0407 __u32 cqe;
0408 __u32 comp_vector;
0409 __s32 comp_channel;
0410 __u32 reserved;
0411 __aligned_u64 driver_data[];
0412 };
0413
0414 enum ib_uverbs_ex_create_cq_flags {
0415 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
0416 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
0417 };
0418
0419 struct ib_uverbs_ex_create_cq {
0420 __aligned_u64 user_handle;
0421 __u32 cqe;
0422 __u32 comp_vector;
0423 __s32 comp_channel;
0424 __u32 comp_mask;
0425 __u32 flags;
0426 __u32 reserved;
0427 };
0428
0429 struct ib_uverbs_create_cq_resp {
0430 __u32 cq_handle;
0431 __u32 cqe;
0432 __aligned_u64 driver_data[0];
0433 };
0434
0435 struct ib_uverbs_ex_create_cq_resp {
0436 struct ib_uverbs_create_cq_resp base;
0437 __u32 comp_mask;
0438 __u32 response_length;
0439 };
0440
0441 struct ib_uverbs_resize_cq {
0442 __aligned_u64 response;
0443 __u32 cq_handle;
0444 __u32 cqe;
0445 __aligned_u64 driver_data[];
0446 };
0447
0448 struct ib_uverbs_resize_cq_resp {
0449 __u32 cqe;
0450 __u32 reserved;
0451 __aligned_u64 driver_data[];
0452 };
0453
0454 struct ib_uverbs_poll_cq {
0455 __aligned_u64 response;
0456 __u32 cq_handle;
0457 __u32 ne;
0458 };
0459
0460 enum ib_uverbs_wc_opcode {
0461 IB_UVERBS_WC_SEND = 0,
0462 IB_UVERBS_WC_RDMA_WRITE = 1,
0463 IB_UVERBS_WC_RDMA_READ = 2,
0464 IB_UVERBS_WC_COMP_SWAP = 3,
0465 IB_UVERBS_WC_FETCH_ADD = 4,
0466 IB_UVERBS_WC_BIND_MW = 5,
0467 IB_UVERBS_WC_LOCAL_INV = 6,
0468 IB_UVERBS_WC_TSO = 7,
0469 };
0470
0471 struct ib_uverbs_wc {
0472 __aligned_u64 wr_id;
0473 __u32 status;
0474 __u32 opcode;
0475 __u32 vendor_err;
0476 __u32 byte_len;
0477 union {
0478 __be32 imm_data;
0479 __u32 invalidate_rkey;
0480 } ex;
0481 __u32 qp_num;
0482 __u32 src_qp;
0483 __u32 wc_flags;
0484 __u16 pkey_index;
0485 __u16 slid;
0486 __u8 sl;
0487 __u8 dlid_path_bits;
0488 __u8 port_num;
0489 __u8 reserved;
0490 };
0491
0492 struct ib_uverbs_poll_cq_resp {
0493 __u32 count;
0494 __u32 reserved;
0495 struct ib_uverbs_wc wc[];
0496 };
0497
0498 struct ib_uverbs_req_notify_cq {
0499 __u32 cq_handle;
0500 __u32 solicited_only;
0501 };
0502
0503 struct ib_uverbs_destroy_cq {
0504 __aligned_u64 response;
0505 __u32 cq_handle;
0506 __u32 reserved;
0507 };
0508
0509 struct ib_uverbs_destroy_cq_resp {
0510 __u32 comp_events_reported;
0511 __u32 async_events_reported;
0512 };
0513
0514 struct ib_uverbs_global_route {
0515 __u8 dgid[16];
0516 __u32 flow_label;
0517 __u8 sgid_index;
0518 __u8 hop_limit;
0519 __u8 traffic_class;
0520 __u8 reserved;
0521 };
0522
0523 struct ib_uverbs_ah_attr {
0524 struct ib_uverbs_global_route grh;
0525 __u16 dlid;
0526 __u8 sl;
0527 __u8 src_path_bits;
0528 __u8 static_rate;
0529 __u8 is_global;
0530 __u8 port_num;
0531 __u8 reserved;
0532 };
0533
0534 struct ib_uverbs_qp_attr {
0535 __u32 qp_attr_mask;
0536 __u32 qp_state;
0537 __u32 cur_qp_state;
0538 __u32 path_mtu;
0539 __u32 path_mig_state;
0540 __u32 qkey;
0541 __u32 rq_psn;
0542 __u32 sq_psn;
0543 __u32 dest_qp_num;
0544 __u32 qp_access_flags;
0545
0546 struct ib_uverbs_ah_attr ah_attr;
0547 struct ib_uverbs_ah_attr alt_ah_attr;
0548
0549
0550 __u32 max_send_wr;
0551 __u32 max_recv_wr;
0552 __u32 max_send_sge;
0553 __u32 max_recv_sge;
0554 __u32 max_inline_data;
0555
0556 __u16 pkey_index;
0557 __u16 alt_pkey_index;
0558 __u8 en_sqd_async_notify;
0559 __u8 sq_draining;
0560 __u8 max_rd_atomic;
0561 __u8 max_dest_rd_atomic;
0562 __u8 min_rnr_timer;
0563 __u8 port_num;
0564 __u8 timeout;
0565 __u8 retry_cnt;
0566 __u8 rnr_retry;
0567 __u8 alt_port_num;
0568 __u8 alt_timeout;
0569 __u8 reserved[5];
0570 };
0571
0572 struct ib_uverbs_create_qp {
0573 __aligned_u64 response;
0574 __aligned_u64 user_handle;
0575 __u32 pd_handle;
0576 __u32 send_cq_handle;
0577 __u32 recv_cq_handle;
0578 __u32 srq_handle;
0579 __u32 max_send_wr;
0580 __u32 max_recv_wr;
0581 __u32 max_send_sge;
0582 __u32 max_recv_sge;
0583 __u32 max_inline_data;
0584 __u8 sq_sig_all;
0585 __u8 qp_type;
0586 __u8 is_srq;
0587 __u8 reserved;
0588 __aligned_u64 driver_data[];
0589 };
0590
0591 enum ib_uverbs_create_qp_mask {
0592 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
0593 };
0594
0595 enum {
0596 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
0597 };
0598
0599 struct ib_uverbs_ex_create_qp {
0600 __aligned_u64 user_handle;
0601 __u32 pd_handle;
0602 __u32 send_cq_handle;
0603 __u32 recv_cq_handle;
0604 __u32 srq_handle;
0605 __u32 max_send_wr;
0606 __u32 max_recv_wr;
0607 __u32 max_send_sge;
0608 __u32 max_recv_sge;
0609 __u32 max_inline_data;
0610 __u8 sq_sig_all;
0611 __u8 qp_type;
0612 __u8 is_srq;
0613 __u8 reserved;
0614 __u32 comp_mask;
0615 __u32 create_flags;
0616 __u32 rwq_ind_tbl_handle;
0617 __u32 source_qpn;
0618 };
0619
0620 struct ib_uverbs_open_qp {
0621 __aligned_u64 response;
0622 __aligned_u64 user_handle;
0623 __u32 pd_handle;
0624 __u32 qpn;
0625 __u8 qp_type;
0626 __u8 reserved[7];
0627 __aligned_u64 driver_data[];
0628 };
0629
0630
0631 struct ib_uverbs_create_qp_resp {
0632 __u32 qp_handle;
0633 __u32 qpn;
0634 __u32 max_send_wr;
0635 __u32 max_recv_wr;
0636 __u32 max_send_sge;
0637 __u32 max_recv_sge;
0638 __u32 max_inline_data;
0639 __u32 reserved;
0640 __u32 driver_data[0];
0641 };
0642
0643 struct ib_uverbs_ex_create_qp_resp {
0644 struct ib_uverbs_create_qp_resp base;
0645 __u32 comp_mask;
0646 __u32 response_length;
0647 };
0648
0649
0650
0651
0652
0653 struct ib_uverbs_qp_dest {
0654 __u8 dgid[16];
0655 __u32 flow_label;
0656 __u16 dlid;
0657 __u16 reserved;
0658 __u8 sgid_index;
0659 __u8 hop_limit;
0660 __u8 traffic_class;
0661 __u8 sl;
0662 __u8 src_path_bits;
0663 __u8 static_rate;
0664 __u8 is_global;
0665 __u8 port_num;
0666 };
0667
0668 struct ib_uverbs_query_qp {
0669 __aligned_u64 response;
0670 __u32 qp_handle;
0671 __u32 attr_mask;
0672 __aligned_u64 driver_data[];
0673 };
0674
0675 struct ib_uverbs_query_qp_resp {
0676 struct ib_uverbs_qp_dest dest;
0677 struct ib_uverbs_qp_dest alt_dest;
0678 __u32 max_send_wr;
0679 __u32 max_recv_wr;
0680 __u32 max_send_sge;
0681 __u32 max_recv_sge;
0682 __u32 max_inline_data;
0683 __u32 qkey;
0684 __u32 rq_psn;
0685 __u32 sq_psn;
0686 __u32 dest_qp_num;
0687 __u32 qp_access_flags;
0688 __u16 pkey_index;
0689 __u16 alt_pkey_index;
0690 __u8 qp_state;
0691 __u8 cur_qp_state;
0692 __u8 path_mtu;
0693 __u8 path_mig_state;
0694 __u8 sq_draining;
0695 __u8 max_rd_atomic;
0696 __u8 max_dest_rd_atomic;
0697 __u8 min_rnr_timer;
0698 __u8 port_num;
0699 __u8 timeout;
0700 __u8 retry_cnt;
0701 __u8 rnr_retry;
0702 __u8 alt_port_num;
0703 __u8 alt_timeout;
0704 __u8 sq_sig_all;
0705 __u8 reserved[5];
0706 __aligned_u64 driver_data[];
0707 };
0708
0709 struct ib_uverbs_modify_qp {
0710 struct ib_uverbs_qp_dest dest;
0711 struct ib_uverbs_qp_dest alt_dest;
0712 __u32 qp_handle;
0713 __u32 attr_mask;
0714 __u32 qkey;
0715 __u32 rq_psn;
0716 __u32 sq_psn;
0717 __u32 dest_qp_num;
0718 __u32 qp_access_flags;
0719 __u16 pkey_index;
0720 __u16 alt_pkey_index;
0721 __u8 qp_state;
0722 __u8 cur_qp_state;
0723 __u8 path_mtu;
0724 __u8 path_mig_state;
0725 __u8 en_sqd_async_notify;
0726 __u8 max_rd_atomic;
0727 __u8 max_dest_rd_atomic;
0728 __u8 min_rnr_timer;
0729 __u8 port_num;
0730 __u8 timeout;
0731 __u8 retry_cnt;
0732 __u8 rnr_retry;
0733 __u8 alt_port_num;
0734 __u8 alt_timeout;
0735 __u8 reserved[2];
0736 __aligned_u64 driver_data[0];
0737 };
0738
0739 struct ib_uverbs_ex_modify_qp {
0740 struct ib_uverbs_modify_qp base;
0741 __u32 rate_limit;
0742 __u32 reserved;
0743 };
0744
0745 struct ib_uverbs_ex_modify_qp_resp {
0746 __u32 comp_mask;
0747 __u32 response_length;
0748 };
0749
0750 struct ib_uverbs_destroy_qp {
0751 __aligned_u64 response;
0752 __u32 qp_handle;
0753 __u32 reserved;
0754 };
0755
0756 struct ib_uverbs_destroy_qp_resp {
0757 __u32 events_reported;
0758 };
0759
0760
0761
0762
0763
0764
0765
0766 struct ib_uverbs_sge {
0767 __aligned_u64 addr;
0768 __u32 length;
0769 __u32 lkey;
0770 };
0771
0772 enum ib_uverbs_wr_opcode {
0773 IB_UVERBS_WR_RDMA_WRITE = 0,
0774 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
0775 IB_UVERBS_WR_SEND = 2,
0776 IB_UVERBS_WR_SEND_WITH_IMM = 3,
0777 IB_UVERBS_WR_RDMA_READ = 4,
0778 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
0779 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
0780 IB_UVERBS_WR_LOCAL_INV = 7,
0781 IB_UVERBS_WR_BIND_MW = 8,
0782 IB_UVERBS_WR_SEND_WITH_INV = 9,
0783 IB_UVERBS_WR_TSO = 10,
0784 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
0785 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
0786 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
0787
0788 };
0789
0790 struct ib_uverbs_send_wr {
0791 __aligned_u64 wr_id;
0792 __u32 num_sge;
0793 __u32 opcode;
0794 __u32 send_flags;
0795 union {
0796 __be32 imm_data;
0797 __u32 invalidate_rkey;
0798 } ex;
0799 union {
0800 struct {
0801 __aligned_u64 remote_addr;
0802 __u32 rkey;
0803 __u32 reserved;
0804 } rdma;
0805 struct {
0806 __aligned_u64 remote_addr;
0807 __aligned_u64 compare_add;
0808 __aligned_u64 swap;
0809 __u32 rkey;
0810 __u32 reserved;
0811 } atomic;
0812 struct {
0813 __u32 ah;
0814 __u32 remote_qpn;
0815 __u32 remote_qkey;
0816 __u32 reserved;
0817 } ud;
0818 } wr;
0819 };
0820
0821 struct ib_uverbs_post_send {
0822 __aligned_u64 response;
0823 __u32 qp_handle;
0824 __u32 wr_count;
0825 __u32 sge_count;
0826 __u32 wqe_size;
0827 struct ib_uverbs_send_wr send_wr[];
0828 };
0829
0830 struct ib_uverbs_post_send_resp {
0831 __u32 bad_wr;
0832 };
0833
0834 struct ib_uverbs_recv_wr {
0835 __aligned_u64 wr_id;
0836 __u32 num_sge;
0837 __u32 reserved;
0838 };
0839
0840 struct ib_uverbs_post_recv {
0841 __aligned_u64 response;
0842 __u32 qp_handle;
0843 __u32 wr_count;
0844 __u32 sge_count;
0845 __u32 wqe_size;
0846 struct ib_uverbs_recv_wr recv_wr[];
0847 };
0848
0849 struct ib_uverbs_post_recv_resp {
0850 __u32 bad_wr;
0851 };
0852
0853 struct ib_uverbs_post_srq_recv {
0854 __aligned_u64 response;
0855 __u32 srq_handle;
0856 __u32 wr_count;
0857 __u32 sge_count;
0858 __u32 wqe_size;
0859 struct ib_uverbs_recv_wr recv[];
0860 };
0861
0862 struct ib_uverbs_post_srq_recv_resp {
0863 __u32 bad_wr;
0864 };
0865
0866 struct ib_uverbs_create_ah {
0867 __aligned_u64 response;
0868 __aligned_u64 user_handle;
0869 __u32 pd_handle;
0870 __u32 reserved;
0871 struct ib_uverbs_ah_attr attr;
0872 __aligned_u64 driver_data[];
0873 };
0874
0875 struct ib_uverbs_create_ah_resp {
0876 __u32 ah_handle;
0877 __u32 driver_data[];
0878 };
0879
0880 struct ib_uverbs_destroy_ah {
0881 __u32 ah_handle;
0882 };
0883
0884 struct ib_uverbs_attach_mcast {
0885 __u8 gid[16];
0886 __u32 qp_handle;
0887 __u16 mlid;
0888 __u16 reserved;
0889 __aligned_u64 driver_data[];
0890 };
0891
0892 struct ib_uverbs_detach_mcast {
0893 __u8 gid[16];
0894 __u32 qp_handle;
0895 __u16 mlid;
0896 __u16 reserved;
0897 __aligned_u64 driver_data[];
0898 };
0899
0900 struct ib_uverbs_flow_spec_hdr {
0901 __u32 type;
0902 __u16 size;
0903 __u16 reserved;
0904
0905 __aligned_u64 flow_spec_data[0];
0906 };
0907
0908 struct ib_uverbs_flow_eth_filter {
0909 __u8 dst_mac[6];
0910 __u8 src_mac[6];
0911 __be16 ether_type;
0912 __be16 vlan_tag;
0913 };
0914
0915 struct ib_uverbs_flow_spec_eth {
0916 union {
0917 struct ib_uverbs_flow_spec_hdr hdr;
0918 struct {
0919 __u32 type;
0920 __u16 size;
0921 __u16 reserved;
0922 };
0923 };
0924 struct ib_uverbs_flow_eth_filter val;
0925 struct ib_uverbs_flow_eth_filter mask;
0926 };
0927
0928 struct ib_uverbs_flow_ipv4_filter {
0929 __be32 src_ip;
0930 __be32 dst_ip;
0931 __u8 proto;
0932 __u8 tos;
0933 __u8 ttl;
0934 __u8 flags;
0935 };
0936
0937 struct ib_uverbs_flow_spec_ipv4 {
0938 union {
0939 struct ib_uverbs_flow_spec_hdr hdr;
0940 struct {
0941 __u32 type;
0942 __u16 size;
0943 __u16 reserved;
0944 };
0945 };
0946 struct ib_uverbs_flow_ipv4_filter val;
0947 struct ib_uverbs_flow_ipv4_filter mask;
0948 };
0949
0950 struct ib_uverbs_flow_tcp_udp_filter {
0951 __be16 dst_port;
0952 __be16 src_port;
0953 };
0954
0955 struct ib_uverbs_flow_spec_tcp_udp {
0956 union {
0957 struct ib_uverbs_flow_spec_hdr hdr;
0958 struct {
0959 __u32 type;
0960 __u16 size;
0961 __u16 reserved;
0962 };
0963 };
0964 struct ib_uverbs_flow_tcp_udp_filter val;
0965 struct ib_uverbs_flow_tcp_udp_filter mask;
0966 };
0967
0968 struct ib_uverbs_flow_ipv6_filter {
0969 __u8 src_ip[16];
0970 __u8 dst_ip[16];
0971 __be32 flow_label;
0972 __u8 next_hdr;
0973 __u8 traffic_class;
0974 __u8 hop_limit;
0975 __u8 reserved;
0976 };
0977
0978 struct ib_uverbs_flow_spec_ipv6 {
0979 union {
0980 struct ib_uverbs_flow_spec_hdr hdr;
0981 struct {
0982 __u32 type;
0983 __u16 size;
0984 __u16 reserved;
0985 };
0986 };
0987 struct ib_uverbs_flow_ipv6_filter val;
0988 struct ib_uverbs_flow_ipv6_filter mask;
0989 };
0990
0991 struct ib_uverbs_flow_spec_action_tag {
0992 union {
0993 struct ib_uverbs_flow_spec_hdr hdr;
0994 struct {
0995 __u32 type;
0996 __u16 size;
0997 __u16 reserved;
0998 };
0999 };
1000 __u32 tag_id;
1001 __u32 reserved1;
1002 };
1003
1004 struct ib_uverbs_flow_spec_action_drop {
1005 union {
1006 struct ib_uverbs_flow_spec_hdr hdr;
1007 struct {
1008 __u32 type;
1009 __u16 size;
1010 __u16 reserved;
1011 };
1012 };
1013 };
1014
1015 struct ib_uverbs_flow_spec_action_handle {
1016 union {
1017 struct ib_uverbs_flow_spec_hdr hdr;
1018 struct {
1019 __u32 type;
1020 __u16 size;
1021 __u16 reserved;
1022 };
1023 };
1024 __u32 handle;
1025 __u32 reserved1;
1026 };
1027
1028 struct ib_uverbs_flow_spec_action_count {
1029 union {
1030 struct ib_uverbs_flow_spec_hdr hdr;
1031 struct {
1032 __u32 type;
1033 __u16 size;
1034 __u16 reserved;
1035 };
1036 };
1037 __u32 handle;
1038 __u32 reserved1;
1039 };
1040
1041 struct ib_uverbs_flow_tunnel_filter {
1042 __be32 tunnel_id;
1043 };
1044
1045 struct ib_uverbs_flow_spec_tunnel {
1046 union {
1047 struct ib_uverbs_flow_spec_hdr hdr;
1048 struct {
1049 __u32 type;
1050 __u16 size;
1051 __u16 reserved;
1052 };
1053 };
1054 struct ib_uverbs_flow_tunnel_filter val;
1055 struct ib_uverbs_flow_tunnel_filter mask;
1056 };
1057
1058 struct ib_uverbs_flow_spec_esp_filter {
1059 __u32 spi;
1060 __u32 seq;
1061 };
1062
1063 struct ib_uverbs_flow_spec_esp {
1064 union {
1065 struct ib_uverbs_flow_spec_hdr hdr;
1066 struct {
1067 __u32 type;
1068 __u16 size;
1069 __u16 reserved;
1070 };
1071 };
1072 struct ib_uverbs_flow_spec_esp_filter val;
1073 struct ib_uverbs_flow_spec_esp_filter mask;
1074 };
1075
1076 struct ib_uverbs_flow_gre_filter {
1077
1078
1079
1080
1081
1082
1083
1084
1085 __be16 c_ks_res0_ver;
1086 __be16 protocol;
1087 __be32 key;
1088 };
1089
1090 struct ib_uverbs_flow_spec_gre {
1091 union {
1092 struct ib_uverbs_flow_spec_hdr hdr;
1093 struct {
1094 __u32 type;
1095 __u16 size;
1096 __u16 reserved;
1097 };
1098 };
1099 struct ib_uverbs_flow_gre_filter val;
1100 struct ib_uverbs_flow_gre_filter mask;
1101 };
1102
1103 struct ib_uverbs_flow_mpls_filter {
1104
1105
1106
1107
1108
1109
1110 __be32 label;
1111 };
1112
1113 struct ib_uverbs_flow_spec_mpls {
1114 union {
1115 struct ib_uverbs_flow_spec_hdr hdr;
1116 struct {
1117 __u32 type;
1118 __u16 size;
1119 __u16 reserved;
1120 };
1121 };
1122 struct ib_uverbs_flow_mpls_filter val;
1123 struct ib_uverbs_flow_mpls_filter mask;
1124 };
1125
1126 struct ib_uverbs_flow_attr {
1127 __u32 type;
1128 __u16 size;
1129 __u16 priority;
1130 __u8 num_of_specs;
1131 __u8 reserved[2];
1132 __u8 port;
1133 __u32 flags;
1134
1135
1136
1137
1138 struct ib_uverbs_flow_spec_hdr flow_specs[];
1139 };
1140
1141 struct ib_uverbs_create_flow {
1142 __u32 comp_mask;
1143 __u32 qp_handle;
1144 struct ib_uverbs_flow_attr flow_attr;
1145 };
1146
1147 struct ib_uverbs_create_flow_resp {
1148 __u32 comp_mask;
1149 __u32 flow_handle;
1150 };
1151
1152 struct ib_uverbs_destroy_flow {
1153 __u32 comp_mask;
1154 __u32 flow_handle;
1155 };
1156
1157 struct ib_uverbs_create_srq {
1158 __aligned_u64 response;
1159 __aligned_u64 user_handle;
1160 __u32 pd_handle;
1161 __u32 max_wr;
1162 __u32 max_sge;
1163 __u32 srq_limit;
1164 __aligned_u64 driver_data[];
1165 };
1166
1167 struct ib_uverbs_create_xsrq {
1168 __aligned_u64 response;
1169 __aligned_u64 user_handle;
1170 __u32 srq_type;
1171 __u32 pd_handle;
1172 __u32 max_wr;
1173 __u32 max_sge;
1174 __u32 srq_limit;
1175 __u32 max_num_tags;
1176 __u32 xrcd_handle;
1177 __u32 cq_handle;
1178 __aligned_u64 driver_data[];
1179 };
1180
1181 struct ib_uverbs_create_srq_resp {
1182 __u32 srq_handle;
1183 __u32 max_wr;
1184 __u32 max_sge;
1185 __u32 srqn;
1186 __u32 driver_data[];
1187 };
1188
1189 struct ib_uverbs_modify_srq {
1190 __u32 srq_handle;
1191 __u32 attr_mask;
1192 __u32 max_wr;
1193 __u32 srq_limit;
1194 __aligned_u64 driver_data[];
1195 };
1196
1197 struct ib_uverbs_query_srq {
1198 __aligned_u64 response;
1199 __u32 srq_handle;
1200 __u32 reserved;
1201 __aligned_u64 driver_data[];
1202 };
1203
1204 struct ib_uverbs_query_srq_resp {
1205 __u32 max_wr;
1206 __u32 max_sge;
1207 __u32 srq_limit;
1208 __u32 reserved;
1209 };
1210
1211 struct ib_uverbs_destroy_srq {
1212 __aligned_u64 response;
1213 __u32 srq_handle;
1214 __u32 reserved;
1215 };
1216
1217 struct ib_uverbs_destroy_srq_resp {
1218 __u32 events_reported;
1219 };
1220
1221 struct ib_uverbs_ex_create_wq {
1222 __u32 comp_mask;
1223 __u32 wq_type;
1224 __aligned_u64 user_handle;
1225 __u32 pd_handle;
1226 __u32 cq_handle;
1227 __u32 max_wr;
1228 __u32 max_sge;
1229 __u32 create_flags;
1230 __u32 reserved;
1231 };
1232
1233 struct ib_uverbs_ex_create_wq_resp {
1234 __u32 comp_mask;
1235 __u32 response_length;
1236 __u32 wq_handle;
1237 __u32 max_wr;
1238 __u32 max_sge;
1239 __u32 wqn;
1240 };
1241
1242 struct ib_uverbs_ex_destroy_wq {
1243 __u32 comp_mask;
1244 __u32 wq_handle;
1245 };
1246
1247 struct ib_uverbs_ex_destroy_wq_resp {
1248 __u32 comp_mask;
1249 __u32 response_length;
1250 __u32 events_reported;
1251 __u32 reserved;
1252 };
1253
1254 struct ib_uverbs_ex_modify_wq {
1255 __u32 attr_mask;
1256 __u32 wq_handle;
1257 __u32 wq_state;
1258 __u32 curr_wq_state;
1259 __u32 flags;
1260 __u32 flags_mask;
1261 };
1262
1263
1264 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1265 struct ib_uverbs_ex_create_rwq_ind_table {
1266 __u32 comp_mask;
1267 __u32 log_ind_tbl_size;
1268
1269
1270
1271
1272 __u32 wq_handles[];
1273 };
1274
1275 struct ib_uverbs_ex_create_rwq_ind_table_resp {
1276 __u32 comp_mask;
1277 __u32 response_length;
1278 __u32 ind_tbl_handle;
1279 __u32 ind_tbl_num;
1280 };
1281
1282 struct ib_uverbs_ex_destroy_rwq_ind_table {
1283 __u32 comp_mask;
1284 __u32 ind_tbl_handle;
1285 };
1286
1287 struct ib_uverbs_cq_moderation {
1288 __u16 cq_count;
1289 __u16 cq_period;
1290 };
1291
1292 struct ib_uverbs_ex_modify_cq {
1293 __u32 cq_handle;
1294 __u32 attr_mask;
1295 struct ib_uverbs_cq_moderation attr;
1296 __u32 reserved;
1297 };
1298
1299 #define IB_DEVICE_NAME_MAX 64
1300
1301
1302
1303
1304
1305 enum ib_uverbs_device_cap_flags {
1306 IB_UVERBS_DEVICE_RESIZE_MAX_WR = 1 << 0,
1307 IB_UVERBS_DEVICE_BAD_PKEY_CNTR = 1 << 1,
1308 IB_UVERBS_DEVICE_BAD_QKEY_CNTR = 1 << 2,
1309 IB_UVERBS_DEVICE_RAW_MULTI = 1 << 3,
1310 IB_UVERBS_DEVICE_AUTO_PATH_MIG = 1 << 4,
1311 IB_UVERBS_DEVICE_CHANGE_PHY_PORT = 1 << 5,
1312 IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = 1 << 6,
1313 IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = 1 << 7,
1314 IB_UVERBS_DEVICE_SHUTDOWN_PORT = 1 << 8,
1315
1316 IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = 1 << 10,
1317 IB_UVERBS_DEVICE_SYS_IMAGE_GUID = 1 << 11,
1318 IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = 1 << 12,
1319 IB_UVERBS_DEVICE_SRQ_RESIZE = 1 << 13,
1320 IB_UVERBS_DEVICE_N_NOTIFY_CQ = 1 << 14,
1321 IB_UVERBS_DEVICE_MEM_WINDOW = 1 << 17,
1322 IB_UVERBS_DEVICE_UD_IP_CSUM = 1 << 18,
1323 IB_UVERBS_DEVICE_XRC = 1 << 20,
1324 IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = 1 << 21,
1325 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = 1 << 23,
1326 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = 1 << 24,
1327 IB_UVERBS_DEVICE_RC_IP_CSUM = 1 << 25,
1328
1329 IB_UVERBS_DEVICE_RAW_IP_CSUM = 1 << 26,
1330 IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = 1 << 29,
1331
1332 IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
1333 IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
1334 };
1335
1336 enum ib_uverbs_raw_packet_caps {
1337 IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
1338 IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
1339 IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
1340 IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
1341 };
1342
1343 #endif