1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef IB_USER_VERBS_H 7 #define IB_USER_VERBS_H 8 #include <linux/types.h> 9 #define IB_USER_VERBS_ABI_VERSION 6 10 #define IB_USER_VERBS_CMD_THRESHOLD 50 11 enum { 12 IB_USER_VERBS_CMD_GET_CONTEXT, 13 IB_USER_VERBS_CMD_QUERY_DEVICE, 14 IB_USER_VERBS_CMD_QUERY_PORT, 15 IB_USER_VERBS_CMD_ALLOC_PD, 16 IB_USER_VERBS_CMD_DEALLOC_PD, 17 IB_USER_VERBS_CMD_CREATE_AH, 18 IB_USER_VERBS_CMD_MODIFY_AH, 19 IB_USER_VERBS_CMD_QUERY_AH, 20 IB_USER_VERBS_CMD_DESTROY_AH, 21 IB_USER_VERBS_CMD_REG_MR, 22 IB_USER_VERBS_CMD_REG_SMR, 23 IB_USER_VERBS_CMD_REREG_MR, 24 IB_USER_VERBS_CMD_QUERY_MR, 25 IB_USER_VERBS_CMD_DEREG_MR, 26 IB_USER_VERBS_CMD_ALLOC_MW, 27 IB_USER_VERBS_CMD_BIND_MW, 28 IB_USER_VERBS_CMD_DEALLOC_MW, 29 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, 30 IB_USER_VERBS_CMD_CREATE_CQ, 31 IB_USER_VERBS_CMD_RESIZE_CQ, 32 IB_USER_VERBS_CMD_DESTROY_CQ, 33 IB_USER_VERBS_CMD_POLL_CQ, 34 IB_USER_VERBS_CMD_PEEK_CQ, 35 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ, 36 IB_USER_VERBS_CMD_CREATE_QP, 37 IB_USER_VERBS_CMD_QUERY_QP, 38 IB_USER_VERBS_CMD_MODIFY_QP, 39 IB_USER_VERBS_CMD_DESTROY_QP, 40 IB_USER_VERBS_CMD_POST_SEND, 41 IB_USER_VERBS_CMD_POST_RECV, 42 IB_USER_VERBS_CMD_ATTACH_MCAST, 43 IB_USER_VERBS_CMD_DETACH_MCAST, 44 IB_USER_VERBS_CMD_CREATE_SRQ, 45 IB_USER_VERBS_CMD_MODIFY_SRQ, 46 IB_USER_VERBS_CMD_QUERY_SRQ, 47 IB_USER_VERBS_CMD_DESTROY_SRQ, 48 IB_USER_VERBS_CMD_POST_SRQ_RECV, 49 IB_USER_VERBS_CMD_OPEN_XRCD, 50 IB_USER_VERBS_CMD_CLOSE_XRCD, 51 IB_USER_VERBS_CMD_CREATE_XSRQ, 52 IB_USER_VERBS_CMD_OPEN_QP, 53 }; 54 enum { 55 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE, 56 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ, 57 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP, 58 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP, 59 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, 60 IB_USER_VERBS_EX_CMD_DESTROY_FLOW, 61 IB_USER_VERBS_EX_CMD_CREATE_WQ, 62 IB_USER_VERBS_EX_CMD_MODIFY_WQ, 63 IB_USER_VERBS_EX_CMD_DESTROY_WQ, 64 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL, 65 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL, 66 IB_USER_VERBS_EX_CMD_MODIFY_CQ 67 }; 68 struct ib_uverbs_async_event_desc { 69 __aligned_u64 element; 70 __u32 event_type; 71 __u32 reserved; 72 }; 73 struct ib_uverbs_comp_event_desc { 74 __aligned_u64 cq_handle; 75 }; 76 struct ib_uverbs_cq_moderation_caps { 77 __u16 max_cq_moderation_count; 78 __u16 max_cq_moderation_period; 79 __u32 reserved; 80 }; 81 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff 82 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u 83 struct ib_uverbs_cmd_hdr { 84 __u32 command; 85 __u16 in_words; 86 __u16 out_words; 87 }; 88 struct ib_uverbs_ex_cmd_hdr { 89 __aligned_u64 response; 90 __u16 provider_in_words; 91 __u16 provider_out_words; 92 __u32 cmd_hdr_reserved; 93 }; 94 struct ib_uverbs_get_context { 95 __aligned_u64 response; 96 __aligned_u64 driver_data[0]; 97 }; 98 struct ib_uverbs_get_context_resp { 99 __u32 async_fd; 100 __u32 num_comp_vectors; 101 }; 102 struct ib_uverbs_query_device { 103 __aligned_u64 response; 104 __aligned_u64 driver_data[0]; 105 }; 106 struct ib_uverbs_query_device_resp { 107 __aligned_u64 fw_ver; 108 __be64 node_guid; 109 __be64 sys_image_guid; 110 __aligned_u64 max_mr_size; 111 __aligned_u64 page_size_cap; 112 __u32 vendor_id; 113 __u32 vendor_part_id; 114 __u32 hw_ver; 115 __u32 max_qp; 116 __u32 max_qp_wr; 117 __u32 device_cap_flags; 118 __u32 max_sge; 119 __u32 max_sge_rd; 120 __u32 max_cq; 121 __u32 max_cqe; 122 __u32 max_mr; 123 __u32 max_pd; 124 __u32 max_qp_rd_atom; 125 __u32 max_ee_rd_atom; 126 __u32 max_res_rd_atom; 127 __u32 max_qp_init_rd_atom; 128 __u32 max_ee_init_rd_atom; 129 __u32 atomic_cap; 130 __u32 max_ee; 131 __u32 max_rdd; 132 __u32 max_mw; 133 __u32 max_raw_ipv6_qp; 134 __u32 max_raw_ethy_qp; 135 __u32 max_mcast_grp; 136 __u32 max_mcast_qp_attach; 137 __u32 max_total_mcast_qp_attach; 138 __u32 max_ah; 139 __u32 max_fmr; 140 __u32 max_map_per_fmr; 141 __u32 max_srq; 142 __u32 max_srq_wr; 143 __u32 max_srq_sge; 144 __u16 max_pkeys; 145 __u8 local_ca_ack_delay; 146 __u8 phys_port_cnt; 147 __u8 reserved[4]; 148 }; 149 struct ib_uverbs_ex_query_device { 150 __u32 comp_mask; 151 __u32 reserved; 152 }; 153 struct ib_uverbs_odp_caps { 154 __aligned_u64 general_caps; 155 struct { 156 __u32 rc_odp_caps; 157 __u32 uc_odp_caps; 158 __u32 ud_odp_caps; 159 } per_transport_caps; 160 __u32 reserved; 161 }; 162 struct ib_uverbs_rss_caps { 163 164 __u32 supported_qpts; 165 __u32 max_rwq_indirection_tables; 166 __u32 max_rwq_indirection_table_size; 167 __u32 reserved; 168 }; 169 struct ib_uverbs_tm_caps { 170 171 __u32 max_rndv_hdr_size; 172 173 __u32 max_num_tags; 174 175 __u32 flags; 176 177 __u32 max_ops; 178 179 __u32 max_sge; 180 __u32 reserved; 181 }; 182 struct ib_uverbs_ex_query_device_resp { 183 struct ib_uverbs_query_device_resp base; 184 __u32 comp_mask; 185 __u32 response_length; 186 struct ib_uverbs_odp_caps odp_caps; 187 __aligned_u64 timestamp_mask; 188 __aligned_u64 hca_core_clock; 189 __aligned_u64 device_cap_flags_ex; 190 struct ib_uverbs_rss_caps rss_caps; 191 __u32 max_wq_type_rq; 192 __u32 raw_packet_caps; 193 struct ib_uverbs_tm_caps tm_caps; 194 struct ib_uverbs_cq_moderation_caps cq_moderation_caps; 195 __aligned_u64 max_dm_size; 196 }; 197 struct ib_uverbs_query_port { 198 __aligned_u64 response; 199 __u8 port_num; 200 __u8 reserved[7]; 201 __aligned_u64 driver_data[0]; 202 }; 203 struct ib_uverbs_query_port_resp { 204 __u32 port_cap_flags; 205 __u32 max_msg_sz; 206 __u32 bad_pkey_cntr; 207 __u32 qkey_viol_cntr; 208 __u32 gid_tbl_len; 209 __u16 pkey_tbl_len; 210 __u16 lid; 211 __u16 sm_lid; 212 __u8 state; 213 __u8 max_mtu; 214 __u8 active_mtu; 215 __u8 lmc; 216 __u8 max_vl_num; 217 __u8 sm_sl; 218 __u8 subnet_timeout; 219 __u8 init_type_reply; 220 __u8 active_width; 221 __u8 active_speed; 222 __u8 phys_state; 223 __u8 link_layer; 224 __u8 flags; 225 __u8 reserved; 226 }; 227 struct ib_uverbs_alloc_pd { 228 __aligned_u64 response; 229 __aligned_u64 driver_data[0]; 230 }; 231 struct ib_uverbs_alloc_pd_resp { 232 __u32 pd_handle; 233 }; 234 struct ib_uverbs_dealloc_pd { 235 __u32 pd_handle; 236 }; 237 struct ib_uverbs_open_xrcd { 238 __aligned_u64 response; 239 __u32 fd; 240 __u32 oflags; 241 __aligned_u64 driver_data[0]; 242 }; 243 struct ib_uverbs_open_xrcd_resp { 244 __u32 xrcd_handle; 245 }; 246 struct ib_uverbs_close_xrcd { 247 __u32 xrcd_handle; 248 }; 249 struct ib_uverbs_reg_mr { 250 __aligned_u64 response; 251 __aligned_u64 start; 252 __aligned_u64 length; 253 __aligned_u64 hca_va; 254 __u32 pd_handle; 255 __u32 access_flags; 256 __aligned_u64 driver_data[0]; 257 }; 258 struct ib_uverbs_reg_mr_resp { 259 __u32 mr_handle; 260 __u32 lkey; 261 __u32 rkey; 262 }; 263 struct ib_uverbs_rereg_mr { 264 __aligned_u64 response; 265 __u32 mr_handle; 266 __u32 flags; 267 __aligned_u64 start; 268 __aligned_u64 length; 269 __aligned_u64 hca_va; 270 __u32 pd_handle; 271 __u32 access_flags; 272 }; 273 struct ib_uverbs_rereg_mr_resp { 274 __u32 lkey; 275 __u32 rkey; 276 }; 277 struct ib_uverbs_dereg_mr { 278 __u32 mr_handle; 279 }; 280 struct ib_uverbs_alloc_mw { 281 __aligned_u64 response; 282 __u32 pd_handle; 283 __u8 mw_type; 284 __u8 reserved[3]; 285 }; 286 struct ib_uverbs_alloc_mw_resp { 287 __u32 mw_handle; 288 __u32 rkey; 289 }; 290 struct ib_uverbs_dealloc_mw { 291 __u32 mw_handle; 292 }; 293 struct ib_uverbs_create_comp_channel { 294 __aligned_u64 response; 295 }; 296 struct ib_uverbs_create_comp_channel_resp { 297 __u32 fd; 298 }; 299 struct ib_uverbs_create_cq { 300 __aligned_u64 response; 301 __aligned_u64 user_handle; 302 __u32 cqe; 303 __u32 comp_vector; 304 __s32 comp_channel; 305 __u32 reserved; 306 __aligned_u64 driver_data[0]; 307 }; 308 enum ib_uverbs_ex_create_cq_flags { 309 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0, 310 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1, 311 }; 312 struct ib_uverbs_ex_create_cq { 313 __aligned_u64 user_handle; 314 __u32 cqe; 315 __u32 comp_vector; 316 __s32 comp_channel; 317 __u32 comp_mask; 318 __u32 flags; 319 __u32 reserved; 320 }; 321 struct ib_uverbs_create_cq_resp { 322 __u32 cq_handle; 323 __u32 cqe; 324 }; 325 struct ib_uverbs_ex_create_cq_resp { 326 struct ib_uverbs_create_cq_resp base; 327 __u32 comp_mask; 328 __u32 response_length; 329 }; 330 struct ib_uverbs_resize_cq { 331 __aligned_u64 response; 332 __u32 cq_handle; 333 __u32 cqe; 334 __aligned_u64 driver_data[0]; 335 }; 336 struct ib_uverbs_resize_cq_resp { 337 __u32 cqe; 338 __u32 reserved; 339 __aligned_u64 driver_data[0]; 340 }; 341 struct ib_uverbs_poll_cq { 342 __aligned_u64 response; 343 __u32 cq_handle; 344 __u32 ne; 345 }; 346 struct ib_uverbs_wc { 347 __aligned_u64 wr_id; 348 __u32 status; 349 __u32 opcode; 350 __u32 vendor_err; 351 __u32 byte_len; 352 union { 353 __be32 imm_data; 354 __u32 invalidate_rkey; 355 } ex; 356 __u32 qp_num; 357 __u32 src_qp; 358 __u32 wc_flags; 359 __u16 pkey_index; 360 __u16 slid; 361 __u8 sl; 362 __u8 dlid_path_bits; 363 __u8 port_num; 364 __u8 reserved; 365 }; 366 struct ib_uverbs_poll_cq_resp { 367 __u32 count; 368 __u32 reserved; 369 struct ib_uverbs_wc wc[0]; 370 }; 371 struct ib_uverbs_req_notify_cq { 372 __u32 cq_handle; 373 __u32 solicited_only; 374 }; 375 struct ib_uverbs_destroy_cq { 376 __aligned_u64 response; 377 __u32 cq_handle; 378 __u32 reserved; 379 }; 380 struct ib_uverbs_destroy_cq_resp { 381 __u32 comp_events_reported; 382 __u32 async_events_reported; 383 }; 384 struct ib_uverbs_global_route { 385 __u8 dgid[16]; 386 __u32 flow_label; 387 __u8 sgid_index; 388 __u8 hop_limit; 389 __u8 traffic_class; 390 __u8 reserved; 391 }; 392 struct ib_uverbs_ah_attr { 393 struct ib_uverbs_global_route grh; 394 __u16 dlid; 395 __u8 sl; 396 __u8 src_path_bits; 397 __u8 static_rate; 398 __u8 is_global; 399 __u8 port_num; 400 __u8 reserved; 401 }; 402 struct ib_uverbs_qp_attr { 403 __u32 qp_attr_mask; 404 __u32 qp_state; 405 __u32 cur_qp_state; 406 __u32 path_mtu; 407 __u32 path_mig_state; 408 __u32 qkey; 409 __u32 rq_psn; 410 __u32 sq_psn; 411 __u32 dest_qp_num; 412 __u32 qp_access_flags; 413 struct ib_uverbs_ah_attr ah_attr; 414 struct ib_uverbs_ah_attr alt_ah_attr; 415 416 __u32 max_send_wr; 417 __u32 max_recv_wr; 418 __u32 max_send_sge; 419 __u32 max_recv_sge; 420 __u32 max_inline_data; 421 __u16 pkey_index; 422 __u16 alt_pkey_index; 423 __u8 en_sqd_async_notify; 424 __u8 sq_draining; 425 __u8 max_rd_atomic; 426 __u8 max_dest_rd_atomic; 427 __u8 min_rnr_timer; 428 __u8 port_num; 429 __u8 timeout; 430 __u8 retry_cnt; 431 __u8 rnr_retry; 432 __u8 alt_port_num; 433 __u8 alt_timeout; 434 __u8 reserved[5]; 435 }; 436 struct ib_uverbs_create_qp { 437 __aligned_u64 response; 438 __aligned_u64 user_handle; 439 __u32 pd_handle; 440 __u32 send_cq_handle; 441 __u32 recv_cq_handle; 442 __u32 srq_handle; 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 __u8 sq_sig_all; 449 __u8 qp_type; 450 __u8 is_srq; 451 __u8 reserved; 452 __aligned_u64 driver_data[0]; 453 }; 454 enum ib_uverbs_create_qp_mask { 455 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0, 456 }; 457 enum { 458 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE, 459 }; 460 enum { 461 462 IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, 463 }; 464 enum { 465 466 IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, 467 }; 468 struct ib_uverbs_ex_create_qp { 469 __aligned_u64 user_handle; 470 __u32 pd_handle; 471 __u32 send_cq_handle; 472 __u32 recv_cq_handle; 473 __u32 srq_handle; 474 __u32 max_send_wr; 475 __u32 max_recv_wr; 476 __u32 max_send_sge; 477 __u32 max_recv_sge; 478 __u32 max_inline_data; 479 __u8 sq_sig_all; 480 __u8 qp_type; 481 __u8 is_srq; 482 __u8 reserved; 483 __u32 comp_mask; 484 __u32 create_flags; 485 __u32 rwq_ind_tbl_handle; 486 __u32 source_qpn; 487 }; 488 struct ib_uverbs_open_qp { 489 __aligned_u64 response; 490 __aligned_u64 user_handle; 491 __u32 pd_handle; 492 __u32 qpn; 493 __u8 qp_type; 494 __u8 reserved[7]; 495 __aligned_u64 driver_data[0]; 496 }; 497 struct ib_uverbs_create_qp_resp { 498 __u32 qp_handle; 499 __u32 qpn; 500 __u32 max_send_wr; 501 __u32 max_recv_wr; 502 __u32 max_send_sge; 503 __u32 max_recv_sge; 504 __u32 max_inline_data; 505 __u32 reserved; 506 }; 507 struct ib_uverbs_ex_create_qp_resp { 508 struct ib_uverbs_create_qp_resp base; 509 __u32 comp_mask; 510 __u32 response_length; 511 }; 512 struct ib_uverbs_qp_dest { 513 __u8 dgid[16]; 514 __u32 flow_label; 515 __u16 dlid; 516 __u16 reserved; 517 __u8 sgid_index; 518 __u8 hop_limit; 519 __u8 traffic_class; 520 __u8 sl; 521 __u8 src_path_bits; 522 __u8 static_rate; 523 __u8 is_global; 524 __u8 port_num; 525 }; 526 struct ib_uverbs_query_qp { 527 __aligned_u64 response; 528 __u32 qp_handle; 529 __u32 attr_mask; 530 __aligned_u64 driver_data[0]; 531 }; 532 struct ib_uverbs_query_qp_resp { 533 struct ib_uverbs_qp_dest dest; 534 struct ib_uverbs_qp_dest alt_dest; 535 __u32 max_send_wr; 536 __u32 max_recv_wr; 537 __u32 max_send_sge; 538 __u32 max_recv_sge; 539 __u32 max_inline_data; 540 __u32 qkey; 541 __u32 rq_psn; 542 __u32 sq_psn; 543 __u32 dest_qp_num; 544 __u32 qp_access_flags; 545 __u16 pkey_index; 546 __u16 alt_pkey_index; 547 __u8 qp_state; 548 __u8 cur_qp_state; 549 __u8 path_mtu; 550 __u8 path_mig_state; 551 __u8 sq_draining; 552 __u8 max_rd_atomic; 553 __u8 max_dest_rd_atomic; 554 __u8 min_rnr_timer; 555 __u8 port_num; 556 __u8 timeout; 557 __u8 retry_cnt; 558 __u8 rnr_retry; 559 __u8 alt_port_num; 560 __u8 alt_timeout; 561 __u8 sq_sig_all; 562 __u8 reserved[5]; 563 __aligned_u64 driver_data[0]; 564 }; 565 struct ib_uverbs_modify_qp { 566 struct ib_uverbs_qp_dest dest; 567 struct ib_uverbs_qp_dest alt_dest; 568 __u32 qp_handle; 569 __u32 attr_mask; 570 __u32 qkey; 571 __u32 rq_psn; 572 __u32 sq_psn; 573 __u32 dest_qp_num; 574 __u32 qp_access_flags; 575 __u16 pkey_index; 576 __u16 alt_pkey_index; 577 __u8 qp_state; 578 __u8 cur_qp_state; 579 __u8 path_mtu; 580 __u8 path_mig_state; 581 __u8 en_sqd_async_notify; 582 __u8 max_rd_atomic; 583 __u8 max_dest_rd_atomic; 584 __u8 min_rnr_timer; 585 __u8 port_num; 586 __u8 timeout; 587 __u8 retry_cnt; 588 __u8 rnr_retry; 589 __u8 alt_port_num; 590 __u8 alt_timeout; 591 __u8 reserved[2]; 592 __aligned_u64 driver_data[0]; 593 }; 594 struct ib_uverbs_ex_modify_qp { 595 struct ib_uverbs_modify_qp base; 596 __u32 rate_limit; 597 __u32 reserved; 598 }; 599 struct ib_uverbs_modify_qp_resp { 600 }; 601 struct ib_uverbs_ex_modify_qp_resp { 602 __u32 comp_mask; 603 __u32 response_length; 604 }; 605 struct ib_uverbs_destroy_qp { 606 __aligned_u64 response; 607 __u32 qp_handle; 608 __u32 reserved; 609 }; 610 struct ib_uverbs_destroy_qp_resp { 611 __u32 events_reported; 612 }; 613 struct ib_uverbs_sge { 614 __aligned_u64 addr; 615 __u32 length; 616 __u32 lkey; 617 }; 618 enum ib_uverbs_wr_opcode { 619 IB_UVERBS_WR_RDMA_WRITE = 0, 620 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1, 621 IB_UVERBS_WR_SEND = 2, 622 IB_UVERBS_WR_SEND_WITH_IMM = 3, 623 IB_UVERBS_WR_RDMA_READ = 4, 624 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5, 625 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6, 626 IB_UVERBS_WR_LOCAL_INV = 7, 627 IB_UVERBS_WR_BIND_MW = 8, 628 IB_UVERBS_WR_SEND_WITH_INV = 9, 629 IB_UVERBS_WR_TSO = 10, 630 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11, 631 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12, 632 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13, 633 634 }; 635 struct ib_uverbs_send_wr { 636 __aligned_u64 wr_id; 637 __u32 num_sge; 638 __u32 opcode; 639 __u32 send_flags; 640 union { 641 __be32 imm_data; 642 __u32 invalidate_rkey; 643 } ex; 644 union { 645 struct { 646 __aligned_u64 remote_addr; 647 __u32 rkey; 648 __u32 reserved; 649 } rdma; 650 struct { 651 __aligned_u64 remote_addr; 652 __aligned_u64 compare_add; 653 __aligned_u64 swap; 654 __u32 rkey; 655 __u32 reserved; 656 } atomic; 657 struct { 658 __u32 ah; 659 __u32 remote_qpn; 660 __u32 remote_qkey; 661 __u32 reserved; 662 } ud; 663 } wr; 664 }; 665 struct ib_uverbs_post_send { 666 __aligned_u64 response; 667 __u32 qp_handle; 668 __u32 wr_count; 669 __u32 sge_count; 670 __u32 wqe_size; 671 struct ib_uverbs_send_wr send_wr[0]; 672 }; 673 struct ib_uverbs_post_send_resp { 674 __u32 bad_wr; 675 }; 676 struct ib_uverbs_recv_wr { 677 __aligned_u64 wr_id; 678 __u32 num_sge; 679 __u32 reserved; 680 }; 681 struct ib_uverbs_post_recv { 682 __aligned_u64 response; 683 __u32 qp_handle; 684 __u32 wr_count; 685 __u32 sge_count; 686 __u32 wqe_size; 687 struct ib_uverbs_recv_wr recv_wr[0]; 688 }; 689 struct ib_uverbs_post_recv_resp { 690 __u32 bad_wr; 691 }; 692 struct ib_uverbs_post_srq_recv { 693 __aligned_u64 response; 694 __u32 srq_handle; 695 __u32 wr_count; 696 __u32 sge_count; 697 __u32 wqe_size; 698 struct ib_uverbs_recv_wr recv[0]; 699 }; 700 struct ib_uverbs_post_srq_recv_resp { 701 __u32 bad_wr; 702 }; 703 struct ib_uverbs_create_ah { 704 __aligned_u64 response; 705 __aligned_u64 user_handle; 706 __u32 pd_handle; 707 __u32 reserved; 708 struct ib_uverbs_ah_attr attr; 709 }; 710 struct ib_uverbs_create_ah_resp { 711 __u32 ah_handle; 712 }; 713 struct ib_uverbs_destroy_ah { 714 __u32 ah_handle; 715 }; 716 struct ib_uverbs_attach_mcast { 717 __u8 gid[16]; 718 __u32 qp_handle; 719 __u16 mlid; 720 __u16 reserved; 721 __aligned_u64 driver_data[0]; 722 }; 723 struct ib_uverbs_detach_mcast { 724 __u8 gid[16]; 725 __u32 qp_handle; 726 __u16 mlid; 727 __u16 reserved; 728 __aligned_u64 driver_data[0]; 729 }; 730 struct ib_uverbs_flow_spec_hdr { 731 __u32 type; 732 __u16 size; 733 __u16 reserved; 734 735 __aligned_u64 flow_spec_data[0]; 736 }; 737 struct ib_uverbs_flow_eth_filter { 738 __u8 dst_mac[6]; 739 __u8 src_mac[6]; 740 __be16 ether_type; 741 __be16 vlan_tag; 742 }; 743 struct ib_uverbs_flow_spec_eth { 744 union { 745 struct ib_uverbs_flow_spec_hdr hdr; 746 struct { 747 __u32 type; 748 __u16 size; 749 __u16 reserved; 750 }; 751 }; 752 struct ib_uverbs_flow_eth_filter val; 753 struct ib_uverbs_flow_eth_filter mask; 754 }; 755 struct ib_uverbs_flow_ipv4_filter { 756 __be32 src_ip; 757 __be32 dst_ip; 758 __u8 proto; 759 __u8 tos; 760 __u8 ttl; 761 __u8 flags; 762 }; 763 struct ib_uverbs_flow_spec_ipv4 { 764 union { 765 struct ib_uverbs_flow_spec_hdr hdr; 766 struct { 767 __u32 type; 768 __u16 size; 769 __u16 reserved; 770 }; 771 }; 772 struct ib_uverbs_flow_ipv4_filter val; 773 struct ib_uverbs_flow_ipv4_filter mask; 774 }; 775 struct ib_uverbs_flow_tcp_udp_filter { 776 __be16 dst_port; 777 __be16 src_port; 778 }; 779 struct ib_uverbs_flow_spec_tcp_udp { 780 union { 781 struct ib_uverbs_flow_spec_hdr hdr; 782 struct { 783 __u32 type; 784 __u16 size; 785 __u16 reserved; 786 }; 787 }; 788 struct ib_uverbs_flow_tcp_udp_filter val; 789 struct ib_uverbs_flow_tcp_udp_filter mask; 790 }; 791 struct ib_uverbs_flow_ipv6_filter { 792 __u8 src_ip[16]; 793 __u8 dst_ip[16]; 794 __be32 flow_label; 795 __u8 next_hdr; 796 __u8 traffic_class; 797 __u8 hop_limit; 798 __u8 reserved; 799 }; 800 struct ib_uverbs_flow_spec_ipv6 { 801 union { 802 struct ib_uverbs_flow_spec_hdr hdr; 803 struct { 804 __u32 type; 805 __u16 size; 806 __u16 reserved; 807 }; 808 }; 809 struct ib_uverbs_flow_ipv6_filter val; 810 struct ib_uverbs_flow_ipv6_filter mask; 811 }; 812 struct ib_uverbs_flow_spec_action_tag { 813 union { 814 struct ib_uverbs_flow_spec_hdr hdr; 815 struct { 816 __u32 type; 817 __u16 size; 818 __u16 reserved; 819 }; 820 }; 821 __u32 tag_id; 822 __u32 reserved1; 823 }; 824 struct ib_uverbs_flow_spec_action_drop { 825 union { 826 struct ib_uverbs_flow_spec_hdr hdr; 827 struct { 828 __u32 type; 829 __u16 size; 830 __u16 reserved; 831 }; 832 }; 833 }; 834 struct ib_uverbs_flow_spec_action_handle { 835 union { 836 struct ib_uverbs_flow_spec_hdr hdr; 837 struct { 838 __u32 type; 839 __u16 size; 840 __u16 reserved; 841 }; 842 }; 843 __u32 handle; 844 __u32 reserved1; 845 }; 846 struct ib_uverbs_flow_spec_action_count { 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_tunnel_filter { 859 __be32 tunnel_id; 860 }; 861 struct ib_uverbs_flow_spec_tunnel { 862 union { 863 struct ib_uverbs_flow_spec_hdr hdr; 864 struct { 865 __u32 type; 866 __u16 size; 867 __u16 reserved; 868 }; 869 }; 870 struct ib_uverbs_flow_tunnel_filter val; 871 struct ib_uverbs_flow_tunnel_filter mask; 872 }; 873 struct ib_uverbs_flow_spec_esp_filter { 874 __u32 spi; 875 __u32 seq; 876 }; 877 struct ib_uverbs_flow_spec_esp { 878 union { 879 struct ib_uverbs_flow_spec_hdr hdr; 880 struct { 881 __u32 type; 882 __u16 size; 883 __u16 reserved; 884 }; 885 }; 886 struct ib_uverbs_flow_spec_esp_filter val; 887 struct ib_uverbs_flow_spec_esp_filter mask; 888 }; 889 struct ib_uverbs_flow_gre_filter { 890 891 __be16 c_ks_res0_ver; 892 __be16 protocol; 893 __be32 key; 894 }; 895 struct ib_uverbs_flow_spec_gre { 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_gre_filter val; 905 struct ib_uverbs_flow_gre_filter mask; 906 }; 907 struct ib_uverbs_flow_mpls_filter { 908 909 __be32 label; 910 }; 911 struct ib_uverbs_flow_spec_mpls { 912 union { 913 struct ib_uverbs_flow_spec_hdr hdr; 914 struct { 915 __u32 type; 916 __u16 size; 917 __u16 reserved; 918 }; 919 }; 920 struct ib_uverbs_flow_mpls_filter val; 921 struct ib_uverbs_flow_mpls_filter mask; 922 }; 923 struct ib_uverbs_flow_attr { 924 __u32 type; 925 __u16 size; 926 __u16 priority; 927 __u8 num_of_specs; 928 __u8 reserved[2]; 929 __u8 port; 930 __u32 flags; 931 932 struct ib_uverbs_flow_spec_hdr flow_specs[0]; 933 }; 934 struct ib_uverbs_create_flow { 935 __u32 comp_mask; 936 __u32 qp_handle; 937 struct ib_uverbs_flow_attr flow_attr; 938 }; 939 struct ib_uverbs_create_flow_resp { 940 __u32 comp_mask; 941 __u32 flow_handle; 942 }; 943 struct ib_uverbs_destroy_flow { 944 __u32 comp_mask; 945 __u32 flow_handle; 946 }; 947 struct ib_uverbs_create_srq { 948 __aligned_u64 response; 949 __aligned_u64 user_handle; 950 __u32 pd_handle; 951 __u32 max_wr; 952 __u32 max_sge; 953 __u32 srq_limit; 954 __aligned_u64 driver_data[0]; 955 }; 956 struct ib_uverbs_create_xsrq { 957 __aligned_u64 response; 958 __aligned_u64 user_handle; 959 __u32 srq_type; 960 __u32 pd_handle; 961 __u32 max_wr; 962 __u32 max_sge; 963 __u32 srq_limit; 964 __u32 max_num_tags; 965 __u32 xrcd_handle; 966 __u32 cq_handle; 967 __aligned_u64 driver_data[0]; 968 }; 969 struct ib_uverbs_create_srq_resp { 970 __u32 srq_handle; 971 __u32 max_wr; 972 __u32 max_sge; 973 __u32 srqn; 974 }; 975 struct ib_uverbs_modify_srq { 976 __u32 srq_handle; 977 __u32 attr_mask; 978 __u32 max_wr; 979 __u32 srq_limit; 980 __aligned_u64 driver_data[0]; 981 }; 982 struct ib_uverbs_query_srq { 983 __aligned_u64 response; 984 __u32 srq_handle; 985 __u32 reserved; 986 __aligned_u64 driver_data[0]; 987 }; 988 struct ib_uverbs_query_srq_resp { 989 __u32 max_wr; 990 __u32 max_sge; 991 __u32 srq_limit; 992 __u32 reserved; 993 }; 994 struct ib_uverbs_destroy_srq { 995 __aligned_u64 response; 996 __u32 srq_handle; 997 __u32 reserved; 998 }; 999 struct ib_uverbs_destroy_srq_resp { 1000 __u32 events_reported; 1001 }; 1002 struct ib_uverbs_ex_create_wq { 1003 __u32 comp_mask; 1004 __u32 wq_type; 1005 __aligned_u64 user_handle; 1006 __u32 pd_handle; 1007 __u32 cq_handle; 1008 __u32 max_wr; 1009 __u32 max_sge; 1010 __u32 create_flags; 1011 __u32 reserved; 1012 }; 1013 struct ib_uverbs_ex_create_wq_resp { 1014 __u32 comp_mask; 1015 __u32 response_length; 1016 __u32 wq_handle; 1017 __u32 max_wr; 1018 __u32 max_sge; 1019 __u32 wqn; 1020 }; 1021 struct ib_uverbs_ex_destroy_wq { 1022 __u32 comp_mask; 1023 __u32 wq_handle; 1024 }; 1025 struct ib_uverbs_ex_destroy_wq_resp { 1026 __u32 comp_mask; 1027 __u32 response_length; 1028 __u32 events_reported; 1029 __u32 reserved; 1030 }; 1031 struct ib_uverbs_ex_modify_wq { 1032 __u32 attr_mask; 1033 __u32 wq_handle; 1034 __u32 wq_state; 1035 __u32 curr_wq_state; 1036 __u32 flags; 1037 __u32 flags_mask; 1038 }; 1039 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d 1040 struct ib_uverbs_ex_create_rwq_ind_table { 1041 __u32 comp_mask; 1042 __u32 log_ind_tbl_size; 1043 1044 __u32 wq_handles[0]; 1045 }; 1046 struct ib_uverbs_ex_create_rwq_ind_table_resp { 1047 __u32 comp_mask; 1048 __u32 response_length; 1049 __u32 ind_tbl_handle; 1050 __u32 ind_tbl_num; 1051 }; 1052 struct ib_uverbs_ex_destroy_rwq_ind_table { 1053 __u32 comp_mask; 1054 __u32 ind_tbl_handle; 1055 }; 1056 struct ib_uverbs_cq_moderation { 1057 __u16 cq_count; 1058 __u16 cq_period; 1059 }; 1060 struct ib_uverbs_ex_modify_cq { 1061 __u32 cq_handle; 1062 __u32 attr_mask; 1063 struct ib_uverbs_cq_moderation attr; 1064 __u32 reserved; 1065 }; 1066 #define IB_DEVICE_NAME_MAX 64 1067 #endif 1068