1 /* 2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 3 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 4 * Copyright (c) 2005 PathScale, Inc. All rights reserved. 5 * Copyright (c) 2006 Mellanox Technologies. All rights reserved. 6 * 7 * This software is available to you under a choice of one of two 8 * licenses. You may choose to be licensed under the terms of the GNU 9 * General Public License (GPL) Version 2, available from the file 10 * COPYING in the main directory of this source tree, or the 11 * OpenIB.org BSD license below: 12 * 13 * Redistribution and use in source and binary forms, with or 14 * without modification, are permitted provided that the following 15 * conditions are met: 16 * 17 * - Redistributions of source code must retain the above 18 * copyright notice, this list of conditions and the following 19 * disclaimer. 20 * 21 * - Redistributions in binary form must reproduce the above 22 * copyright notice, this list of conditions and the following 23 * disclaimer in the documentation and/or other materials 24 * provided with the distribution. 25 * 26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 29 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 30 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 31 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 33 * SOFTWARE. 34 */ 35 36 #ifndef IB_USER_VERBS_H 37 #define IB_USER_VERBS_H 38 39 #include <linux/types.h> 40 41 /* 42 * Increment this value if any changes that break userspace ABI 43 * compatibility are made. 44 */ 45 #define IB_USER_VERBS_ABI_VERSION 6 46 #define IB_USER_VERBS_CMD_THRESHOLD 50 47 48 enum { 49 IB_USER_VERBS_CMD_GET_CONTEXT, 50 IB_USER_VERBS_CMD_QUERY_DEVICE, 51 IB_USER_VERBS_CMD_QUERY_PORT, 52 IB_USER_VERBS_CMD_ALLOC_PD, 53 IB_USER_VERBS_CMD_DEALLOC_PD, 54 IB_USER_VERBS_CMD_CREATE_AH, 55 IB_USER_VERBS_CMD_MODIFY_AH, 56 IB_USER_VERBS_CMD_QUERY_AH, 57 IB_USER_VERBS_CMD_DESTROY_AH, 58 IB_USER_VERBS_CMD_REG_MR, 59 IB_USER_VERBS_CMD_REG_SMR, 60 IB_USER_VERBS_CMD_REREG_MR, 61 IB_USER_VERBS_CMD_QUERY_MR, 62 IB_USER_VERBS_CMD_DEREG_MR, 63 IB_USER_VERBS_CMD_ALLOC_MW, 64 IB_USER_VERBS_CMD_BIND_MW, 65 IB_USER_VERBS_CMD_DEALLOC_MW, 66 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, 67 IB_USER_VERBS_CMD_CREATE_CQ, 68 IB_USER_VERBS_CMD_RESIZE_CQ, 69 IB_USER_VERBS_CMD_DESTROY_CQ, 70 IB_USER_VERBS_CMD_POLL_CQ, 71 IB_USER_VERBS_CMD_PEEK_CQ, 72 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ, 73 IB_USER_VERBS_CMD_CREATE_QP, 74 IB_USER_VERBS_CMD_QUERY_QP, 75 IB_USER_VERBS_CMD_MODIFY_QP, 76 IB_USER_VERBS_CMD_DESTROY_QP, 77 IB_USER_VERBS_CMD_POST_SEND, 78 IB_USER_VERBS_CMD_POST_RECV, 79 IB_USER_VERBS_CMD_ATTACH_MCAST, 80 IB_USER_VERBS_CMD_DETACH_MCAST, 81 IB_USER_VERBS_CMD_CREATE_SRQ, 82 IB_USER_VERBS_CMD_MODIFY_SRQ, 83 IB_USER_VERBS_CMD_QUERY_SRQ, 84 IB_USER_VERBS_CMD_DESTROY_SRQ, 85 IB_USER_VERBS_CMD_POST_SRQ_RECV, 86 IB_USER_VERBS_CMD_OPEN_XRCD, 87 IB_USER_VERBS_CMD_CLOSE_XRCD, 88 IB_USER_VERBS_CMD_CREATE_XSRQ, 89 IB_USER_VERBS_CMD_OPEN_QP, 90 }; 91 92 enum { 93 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE, 94 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ, 95 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP, 96 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, 97 IB_USER_VERBS_EX_CMD_DESTROY_FLOW, 98 IB_USER_VERBS_EX_CMD_CREATE_WQ, 99 IB_USER_VERBS_EX_CMD_MODIFY_WQ, 100 IB_USER_VERBS_EX_CMD_DESTROY_WQ, 101 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL, 102 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL 103 }; 104 105 /* 106 * Make sure that all structs defined in this file remain laid out so 107 * that they pack the same way on 32-bit and 64-bit architectures (to 108 * avoid incompatibility between 32-bit userspace and 64-bit kernels). 109 * Specifically: 110 * - Do not use pointer types -- pass pointers in __u64 instead. 111 * - Make sure that any structure larger than 4 bytes is padded to a 112 * multiple of 8 bytes. Otherwise the structure size will be 113 * different between 32-bit and 64-bit architectures. 114 */ 115 116 struct ib_uverbs_async_event_desc { 117 __u64 element; 118 __u32 event_type; /* enum ib_event_type */ 119 __u32 reserved; 120 }; 121 122 struct ib_uverbs_comp_event_desc { 123 __u64 cq_handle; 124 }; 125 126 /* 127 * All commands from userspace should start with a __u32 command field 128 * followed by __u16 in_words and out_words fields (which give the 129 * length of the command block and response buffer if any in 32-bit 130 * words). The kernel driver will read these fields first and read 131 * the rest of the command struct based on these value. 132 */ 133 134 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff 135 #define IB_USER_VERBS_CMD_FLAGS_MASK 0xff000000u 136 #define IB_USER_VERBS_CMD_FLAGS_SHIFT 24 137 138 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80 139 140 struct ib_uverbs_cmd_hdr { 141 __u32 command; 142 __u16 in_words; 143 __u16 out_words; 144 }; 145 146 struct ib_uverbs_ex_cmd_hdr { 147 __u64 response; 148 __u16 provider_in_words; 149 __u16 provider_out_words; 150 __u32 cmd_hdr_reserved; 151 }; 152 153 struct ib_uverbs_get_context { 154 __u64 response; 155 __u64 driver_data[0]; 156 }; 157 158 struct ib_uverbs_get_context_resp { 159 __u32 async_fd; 160 __u32 num_comp_vectors; 161 }; 162 163 struct ib_uverbs_query_device { 164 __u64 response; 165 __u64 driver_data[0]; 166 }; 167 168 struct ib_uverbs_query_device_resp { 169 __u64 fw_ver; 170 __be64 node_guid; 171 __be64 sys_image_guid; 172 __u64 max_mr_size; 173 __u64 page_size_cap; 174 __u32 vendor_id; 175 __u32 vendor_part_id; 176 __u32 hw_ver; 177 __u32 max_qp; 178 __u32 max_qp_wr; 179 __u32 device_cap_flags; 180 __u32 max_sge; 181 __u32 max_sge_rd; 182 __u32 max_cq; 183 __u32 max_cqe; 184 __u32 max_mr; 185 __u32 max_pd; 186 __u32 max_qp_rd_atom; 187 __u32 max_ee_rd_atom; 188 __u32 max_res_rd_atom; 189 __u32 max_qp_init_rd_atom; 190 __u32 max_ee_init_rd_atom; 191 __u32 atomic_cap; 192 __u32 max_ee; 193 __u32 max_rdd; 194 __u32 max_mw; 195 __u32 max_raw_ipv6_qp; 196 __u32 max_raw_ethy_qp; 197 __u32 max_mcast_grp; 198 __u32 max_mcast_qp_attach; 199 __u32 max_total_mcast_qp_attach; 200 __u32 max_ah; 201 __u32 max_fmr; 202 __u32 max_map_per_fmr; 203 __u32 max_srq; 204 __u32 max_srq_wr; 205 __u32 max_srq_sge; 206 __u16 max_pkeys; 207 __u8 local_ca_ack_delay; 208 __u8 phys_port_cnt; 209 __u8 reserved[4]; 210 }; 211 212 struct ib_uverbs_ex_query_device { 213 __u32 comp_mask; 214 __u32 reserved; 215 }; 216 217 struct ib_uverbs_odp_caps { 218 __u64 general_caps; 219 struct { 220 __u32 rc_odp_caps; 221 __u32 uc_odp_caps; 222 __u32 ud_odp_caps; 223 } per_transport_caps; 224 __u32 reserved; 225 }; 226 227 struct ib_uverbs_rss_caps { 228 /* Corresponding bit will be set if qp type from 229 * 'enum ib_qp_type' is supported, e.g. 230 * supported_qpts |= 1 << IB_QPT_UD 231 */ 232 __u32 supported_qpts; 233 __u32 max_rwq_indirection_tables; 234 __u32 max_rwq_indirection_table_size; 235 __u32 reserved; 236 }; 237 238 struct ib_uverbs_ex_query_device_resp { 239 struct ib_uverbs_query_device_resp base; 240 __u32 comp_mask; 241 __u32 response_length; 242 struct ib_uverbs_odp_caps odp_caps; 243 __u64 timestamp_mask; 244 __u64 hca_core_clock; /* in KHZ */ 245 __u64 device_cap_flags_ex; 246 struct ib_uverbs_rss_caps rss_caps; 247 __u32 max_wq_type_rq; 248 __u32 reserved; 249 }; 250 251 struct ib_uverbs_query_port { 252 __u64 response; 253 __u8 port_num; 254 __u8 reserved[7]; 255 __u64 driver_data[0]; 256 }; 257 258 struct ib_uverbs_query_port_resp { 259 __u32 port_cap_flags; 260 __u32 max_msg_sz; 261 __u32 bad_pkey_cntr; 262 __u32 qkey_viol_cntr; 263 __u32 gid_tbl_len; 264 __u16 pkey_tbl_len; 265 __u16 lid; 266 __u16 sm_lid; 267 __u8 state; 268 __u8 max_mtu; 269 __u8 active_mtu; 270 __u8 lmc; 271 __u8 max_vl_num; 272 __u8 sm_sl; 273 __u8 subnet_timeout; 274 __u8 init_type_reply; 275 __u8 active_width; 276 __u8 active_speed; 277 __u8 phys_state; 278 __u8 link_layer; 279 __u8 reserved[2]; 280 }; 281 282 struct ib_uverbs_alloc_pd { 283 __u64 response; 284 __u64 driver_data[0]; 285 }; 286 287 struct ib_uverbs_alloc_pd_resp { 288 __u32 pd_handle; 289 }; 290 291 struct ib_uverbs_dealloc_pd { 292 __u32 pd_handle; 293 }; 294 295 struct ib_uverbs_open_xrcd { 296 __u64 response; 297 __u32 fd; 298 __u32 oflags; 299 __u64 driver_data[0]; 300 }; 301 302 struct ib_uverbs_open_xrcd_resp { 303 __u32 xrcd_handle; 304 }; 305 306 struct ib_uverbs_close_xrcd { 307 __u32 xrcd_handle; 308 }; 309 310 struct ib_uverbs_reg_mr { 311 __u64 response; 312 __u64 start; 313 __u64 length; 314 __u64 hca_va; 315 __u32 pd_handle; 316 __u32 access_flags; 317 __u64 driver_data[0]; 318 }; 319 320 struct ib_uverbs_reg_mr_resp { 321 __u32 mr_handle; 322 __u32 lkey; 323 __u32 rkey; 324 }; 325 326 struct ib_uverbs_rereg_mr { 327 __u64 response; 328 __u32 mr_handle; 329 __u32 flags; 330 __u64 start; 331 __u64 length; 332 __u64 hca_va; 333 __u32 pd_handle; 334 __u32 access_flags; 335 }; 336 337 struct ib_uverbs_rereg_mr_resp { 338 __u32 lkey; 339 __u32 rkey; 340 }; 341 342 struct ib_uverbs_dereg_mr { 343 __u32 mr_handle; 344 }; 345 346 struct ib_uverbs_alloc_mw { 347 __u64 response; 348 __u32 pd_handle; 349 __u8 mw_type; 350 __u8 reserved[3]; 351 }; 352 353 struct ib_uverbs_alloc_mw_resp { 354 __u32 mw_handle; 355 __u32 rkey; 356 }; 357 358 struct ib_uverbs_dealloc_mw { 359 __u32 mw_handle; 360 }; 361 362 struct ib_uverbs_create_comp_channel { 363 __u64 response; 364 }; 365 366 struct ib_uverbs_create_comp_channel_resp { 367 __u32 fd; 368 }; 369 370 struct ib_uverbs_create_cq { 371 __u64 response; 372 __u64 user_handle; 373 __u32 cqe; 374 __u32 comp_vector; 375 __s32 comp_channel; 376 __u32 reserved; 377 __u64 driver_data[0]; 378 }; 379 380 struct ib_uverbs_ex_create_cq { 381 __u64 user_handle; 382 __u32 cqe; 383 __u32 comp_vector; 384 __s32 comp_channel; 385 __u32 comp_mask; 386 __u32 flags; 387 __u32 reserved; 388 }; 389 390 struct ib_uverbs_create_cq_resp { 391 __u32 cq_handle; 392 __u32 cqe; 393 }; 394 395 struct ib_uverbs_ex_create_cq_resp { 396 struct ib_uverbs_create_cq_resp base; 397 __u32 comp_mask; 398 __u32 response_length; 399 }; 400 401 struct ib_uverbs_resize_cq { 402 __u64 response; 403 __u32 cq_handle; 404 __u32 cqe; 405 __u64 driver_data[0]; 406 }; 407 408 struct ib_uverbs_resize_cq_resp { 409 __u32 cqe; 410 __u32 reserved; 411 __u64 driver_data[0]; 412 }; 413 414 struct ib_uverbs_poll_cq { 415 __u64 response; 416 __u32 cq_handle; 417 __u32 ne; 418 }; 419 420 struct ib_uverbs_wc { 421 __u64 wr_id; 422 __u32 status; 423 __u32 opcode; 424 __u32 vendor_err; 425 __u32 byte_len; 426 union { 427 __u32 imm_data; 428 __u32 invalidate_rkey; 429 } ex; 430 __u32 qp_num; 431 __u32 src_qp; 432 __u32 wc_flags; 433 __u16 pkey_index; 434 __u16 slid; 435 __u8 sl; 436 __u8 dlid_path_bits; 437 __u8 port_num; 438 __u8 reserved; 439 }; 440 441 struct ib_uverbs_poll_cq_resp { 442 __u32 count; 443 __u32 reserved; 444 struct ib_uverbs_wc wc[0]; 445 }; 446 447 struct ib_uverbs_req_notify_cq { 448 __u32 cq_handle; 449 __u32 solicited_only; 450 }; 451 452 struct ib_uverbs_destroy_cq { 453 __u64 response; 454 __u32 cq_handle; 455 __u32 reserved; 456 }; 457 458 struct ib_uverbs_destroy_cq_resp { 459 __u32 comp_events_reported; 460 __u32 async_events_reported; 461 }; 462 463 struct ib_uverbs_global_route { 464 __u8 dgid[16]; 465 __u32 flow_label; 466 __u8 sgid_index; 467 __u8 hop_limit; 468 __u8 traffic_class; 469 __u8 reserved; 470 }; 471 472 struct ib_uverbs_ah_attr { 473 struct ib_uverbs_global_route grh; 474 __u16 dlid; 475 __u8 sl; 476 __u8 src_path_bits; 477 __u8 static_rate; 478 __u8 is_global; 479 __u8 port_num; 480 __u8 reserved; 481 }; 482 483 struct ib_uverbs_qp_attr { 484 __u32 qp_attr_mask; 485 __u32 qp_state; 486 __u32 cur_qp_state; 487 __u32 path_mtu; 488 __u32 path_mig_state; 489 __u32 qkey; 490 __u32 rq_psn; 491 __u32 sq_psn; 492 __u32 dest_qp_num; 493 __u32 qp_access_flags; 494 495 struct ib_uverbs_ah_attr ah_attr; 496 struct ib_uverbs_ah_attr alt_ah_attr; 497 498 /* ib_qp_cap */ 499 __u32 max_send_wr; 500 __u32 max_recv_wr; 501 __u32 max_send_sge; 502 __u32 max_recv_sge; 503 __u32 max_inline_data; 504 505 __u16 pkey_index; 506 __u16 alt_pkey_index; 507 __u8 en_sqd_async_notify; 508 __u8 sq_draining; 509 __u8 max_rd_atomic; 510 __u8 max_dest_rd_atomic; 511 __u8 min_rnr_timer; 512 __u8 port_num; 513 __u8 timeout; 514 __u8 retry_cnt; 515 __u8 rnr_retry; 516 __u8 alt_port_num; 517 __u8 alt_timeout; 518 __u8 reserved[5]; 519 }; 520 521 struct ib_uverbs_create_qp { 522 __u64 response; 523 __u64 user_handle; 524 __u32 pd_handle; 525 __u32 send_cq_handle; 526 __u32 recv_cq_handle; 527 __u32 srq_handle; 528 __u32 max_send_wr; 529 __u32 max_recv_wr; 530 __u32 max_send_sge; 531 __u32 max_recv_sge; 532 __u32 max_inline_data; 533 __u8 sq_sig_all; 534 __u8 qp_type; 535 __u8 is_srq; 536 __u8 reserved; 537 __u64 driver_data[0]; 538 }; 539 540 enum ib_uverbs_create_qp_mask { 541 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0, 542 }; 543 544 enum { 545 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE, 546 }; 547 548 struct ib_uverbs_ex_create_qp { 549 __u64 user_handle; 550 __u32 pd_handle; 551 __u32 send_cq_handle; 552 __u32 recv_cq_handle; 553 __u32 srq_handle; 554 __u32 max_send_wr; 555 __u32 max_recv_wr; 556 __u32 max_send_sge; 557 __u32 max_recv_sge; 558 __u32 max_inline_data; 559 __u8 sq_sig_all; 560 __u8 qp_type; 561 __u8 is_srq; 562 __u8 reserved; 563 __u32 comp_mask; 564 __u32 create_flags; 565 __u32 rwq_ind_tbl_handle; 566 __u32 reserved1; 567 }; 568 569 struct ib_uverbs_open_qp { 570 __u64 response; 571 __u64 user_handle; 572 __u32 pd_handle; 573 __u32 qpn; 574 __u8 qp_type; 575 __u8 reserved[7]; 576 __u64 driver_data[0]; 577 }; 578 579 /* also used for open response */ 580 struct ib_uverbs_create_qp_resp { 581 __u32 qp_handle; 582 __u32 qpn; 583 __u32 max_send_wr; 584 __u32 max_recv_wr; 585 __u32 max_send_sge; 586 __u32 max_recv_sge; 587 __u32 max_inline_data; 588 __u32 reserved; 589 }; 590 591 struct ib_uverbs_ex_create_qp_resp { 592 struct ib_uverbs_create_qp_resp base; 593 __u32 comp_mask; 594 __u32 response_length; 595 }; 596 597 /* 598 * This struct needs to remain a multiple of 8 bytes to keep the 599 * alignment of the modify QP parameters. 600 */ 601 struct ib_uverbs_qp_dest { 602 __u8 dgid[16]; 603 __u32 flow_label; 604 __u16 dlid; 605 __u16 reserved; 606 __u8 sgid_index; 607 __u8 hop_limit; 608 __u8 traffic_class; 609 __u8 sl; 610 __u8 src_path_bits; 611 __u8 static_rate; 612 __u8 is_global; 613 __u8 port_num; 614 }; 615 616 struct ib_uverbs_query_qp { 617 __u64 response; 618 __u32 qp_handle; 619 __u32 attr_mask; 620 __u64 driver_data[0]; 621 }; 622 623 struct ib_uverbs_query_qp_resp { 624 struct ib_uverbs_qp_dest dest; 625 struct ib_uverbs_qp_dest alt_dest; 626 __u32 max_send_wr; 627 __u32 max_recv_wr; 628 __u32 max_send_sge; 629 __u32 max_recv_sge; 630 __u32 max_inline_data; 631 __u32 qkey; 632 __u32 rq_psn; 633 __u32 sq_psn; 634 __u32 dest_qp_num; 635 __u32 qp_access_flags; 636 __u16 pkey_index; 637 __u16 alt_pkey_index; 638 __u8 qp_state; 639 __u8 cur_qp_state; 640 __u8 path_mtu; 641 __u8 path_mig_state; 642 __u8 sq_draining; 643 __u8 max_rd_atomic; 644 __u8 max_dest_rd_atomic; 645 __u8 min_rnr_timer; 646 __u8 port_num; 647 __u8 timeout; 648 __u8 retry_cnt; 649 __u8 rnr_retry; 650 __u8 alt_port_num; 651 __u8 alt_timeout; 652 __u8 sq_sig_all; 653 __u8 reserved[5]; 654 __u64 driver_data[0]; 655 }; 656 657 struct ib_uverbs_modify_qp { 658 struct ib_uverbs_qp_dest dest; 659 struct ib_uverbs_qp_dest alt_dest; 660 __u32 qp_handle; 661 __u32 attr_mask; 662 __u32 qkey; 663 __u32 rq_psn; 664 __u32 sq_psn; 665 __u32 dest_qp_num; 666 __u32 qp_access_flags; 667 __u16 pkey_index; 668 __u16 alt_pkey_index; 669 __u8 qp_state; 670 __u8 cur_qp_state; 671 __u8 path_mtu; 672 __u8 path_mig_state; 673 __u8 en_sqd_async_notify; 674 __u8 max_rd_atomic; 675 __u8 max_dest_rd_atomic; 676 __u8 min_rnr_timer; 677 __u8 port_num; 678 __u8 timeout; 679 __u8 retry_cnt; 680 __u8 rnr_retry; 681 __u8 alt_port_num; 682 __u8 alt_timeout; 683 __u8 reserved[2]; 684 __u64 driver_data[0]; 685 }; 686 687 struct ib_uverbs_modify_qp_resp { 688 }; 689 690 struct ib_uverbs_destroy_qp { 691 __u64 response; 692 __u32 qp_handle; 693 __u32 reserved; 694 }; 695 696 struct ib_uverbs_destroy_qp_resp { 697 __u32 events_reported; 698 }; 699 700 /* 701 * The ib_uverbs_sge structure isn't used anywhere, since we assume 702 * the ib_sge structure is packed the same way on 32-bit and 64-bit 703 * architectures in both kernel and user space. It's just here to 704 * document the ABI. 705 */ 706 struct ib_uverbs_sge { 707 __u64 addr; 708 __u32 length; 709 __u32 lkey; 710 }; 711 712 struct ib_uverbs_send_wr { 713 __u64 wr_id; 714 __u32 num_sge; 715 __u32 opcode; 716 __u32 send_flags; 717 union { 718 __u32 imm_data; 719 __u32 invalidate_rkey; 720 } ex; 721 union { 722 struct { 723 __u64 remote_addr; 724 __u32 rkey; 725 __u32 reserved; 726 } rdma; 727 struct { 728 __u64 remote_addr; 729 __u64 compare_add; 730 __u64 swap; 731 __u32 rkey; 732 __u32 reserved; 733 } atomic; 734 struct { 735 __u32 ah; 736 __u32 remote_qpn; 737 __u32 remote_qkey; 738 __u32 reserved; 739 } ud; 740 } wr; 741 }; 742 743 struct ib_uverbs_post_send { 744 __u64 response; 745 __u32 qp_handle; 746 __u32 wr_count; 747 __u32 sge_count; 748 __u32 wqe_size; 749 struct ib_uverbs_send_wr send_wr[0]; 750 }; 751 752 struct ib_uverbs_post_send_resp { 753 __u32 bad_wr; 754 }; 755 756 struct ib_uverbs_recv_wr { 757 __u64 wr_id; 758 __u32 num_sge; 759 __u32 reserved; 760 }; 761 762 struct ib_uverbs_post_recv { 763 __u64 response; 764 __u32 qp_handle; 765 __u32 wr_count; 766 __u32 sge_count; 767 __u32 wqe_size; 768 struct ib_uverbs_recv_wr recv_wr[0]; 769 }; 770 771 struct ib_uverbs_post_recv_resp { 772 __u32 bad_wr; 773 }; 774 775 struct ib_uverbs_post_srq_recv { 776 __u64 response; 777 __u32 srq_handle; 778 __u32 wr_count; 779 __u32 sge_count; 780 __u32 wqe_size; 781 struct ib_uverbs_recv_wr recv[0]; 782 }; 783 784 struct ib_uverbs_post_srq_recv_resp { 785 __u32 bad_wr; 786 }; 787 788 struct ib_uverbs_create_ah { 789 __u64 response; 790 __u64 user_handle; 791 __u32 pd_handle; 792 __u32 reserved; 793 struct ib_uverbs_ah_attr attr; 794 }; 795 796 struct ib_uverbs_create_ah_resp { 797 __u32 ah_handle; 798 }; 799 800 struct ib_uverbs_destroy_ah { 801 __u32 ah_handle; 802 }; 803 804 struct ib_uverbs_attach_mcast { 805 __u8 gid[16]; 806 __u32 qp_handle; 807 __u16 mlid; 808 __u16 reserved; 809 __u64 driver_data[0]; 810 }; 811 812 struct ib_uverbs_detach_mcast { 813 __u8 gid[16]; 814 __u32 qp_handle; 815 __u16 mlid; 816 __u16 reserved; 817 __u64 driver_data[0]; 818 }; 819 820 struct ib_uverbs_flow_spec_hdr { 821 __u32 type; 822 __u16 size; 823 __u16 reserved; 824 /* followed by flow_spec */ 825 __u64 flow_spec_data[0]; 826 }; 827 828 struct ib_uverbs_flow_eth_filter { 829 __u8 dst_mac[6]; 830 __u8 src_mac[6]; 831 __be16 ether_type; 832 __be16 vlan_tag; 833 }; 834 835 struct ib_uverbs_flow_spec_eth { 836 union { 837 struct ib_uverbs_flow_spec_hdr hdr; 838 struct { 839 __u32 type; 840 __u16 size; 841 __u16 reserved; 842 }; 843 }; 844 struct ib_uverbs_flow_eth_filter val; 845 struct ib_uverbs_flow_eth_filter mask; 846 }; 847 848 struct ib_uverbs_flow_ipv4_filter { 849 __be32 src_ip; 850 __be32 dst_ip; 851 __u8 proto; 852 __u8 tos; 853 __u8 ttl; 854 __u8 flags; 855 }; 856 857 struct ib_uverbs_flow_spec_ipv4 { 858 union { 859 struct ib_uverbs_flow_spec_hdr hdr; 860 struct { 861 __u32 type; 862 __u16 size; 863 __u16 reserved; 864 }; 865 }; 866 struct ib_uverbs_flow_ipv4_filter val; 867 struct ib_uverbs_flow_ipv4_filter mask; 868 }; 869 870 struct ib_uverbs_flow_tcp_udp_filter { 871 __be16 dst_port; 872 __be16 src_port; 873 }; 874 875 struct ib_uverbs_flow_spec_tcp_udp { 876 union { 877 struct ib_uverbs_flow_spec_hdr hdr; 878 struct { 879 __u32 type; 880 __u16 size; 881 __u16 reserved; 882 }; 883 }; 884 struct ib_uverbs_flow_tcp_udp_filter val; 885 struct ib_uverbs_flow_tcp_udp_filter mask; 886 }; 887 888 struct ib_uverbs_flow_ipv6_filter { 889 __u8 src_ip[16]; 890 __u8 dst_ip[16]; 891 __be32 flow_label; 892 __u8 next_hdr; 893 __u8 traffic_class; 894 __u8 hop_limit; 895 __u8 reserved; 896 }; 897 898 struct ib_uverbs_flow_spec_ipv6 { 899 union { 900 struct ib_uverbs_flow_spec_hdr hdr; 901 struct { 902 __u32 type; 903 __u16 size; 904 __u16 reserved; 905 }; 906 }; 907 struct ib_uverbs_flow_ipv6_filter val; 908 struct ib_uverbs_flow_ipv6_filter mask; 909 }; 910 911 struct ib_uverbs_flow_attr { 912 __u32 type; 913 __u16 size; 914 __u16 priority; 915 __u8 num_of_specs; 916 __u8 reserved[2]; 917 __u8 port; 918 __u32 flags; 919 /* Following are the optional layers according to user request 920 * struct ib_flow_spec_xxx 921 * struct ib_flow_spec_yyy 922 */ 923 struct ib_uverbs_flow_spec_hdr flow_specs[0]; 924 }; 925 926 struct ib_uverbs_create_flow { 927 __u32 comp_mask; 928 __u32 qp_handle; 929 struct ib_uverbs_flow_attr flow_attr; 930 }; 931 932 struct ib_uverbs_create_flow_resp { 933 __u32 comp_mask; 934 __u32 flow_handle; 935 }; 936 937 struct ib_uverbs_destroy_flow { 938 __u32 comp_mask; 939 __u32 flow_handle; 940 }; 941 942 struct ib_uverbs_create_srq { 943 __u64 response; 944 __u64 user_handle; 945 __u32 pd_handle; 946 __u32 max_wr; 947 __u32 max_sge; 948 __u32 srq_limit; 949 __u64 driver_data[0]; 950 }; 951 952 struct ib_uverbs_create_xsrq { 953 __u64 response; 954 __u64 user_handle; 955 __u32 srq_type; 956 __u32 pd_handle; 957 __u32 max_wr; 958 __u32 max_sge; 959 __u32 srq_limit; 960 __u32 reserved; 961 __u32 xrcd_handle; 962 __u32 cq_handle; 963 __u64 driver_data[0]; 964 }; 965 966 struct ib_uverbs_create_srq_resp { 967 __u32 srq_handle; 968 __u32 max_wr; 969 __u32 max_sge; 970 __u32 srqn; 971 }; 972 973 struct ib_uverbs_modify_srq { 974 __u32 srq_handle; 975 __u32 attr_mask; 976 __u32 max_wr; 977 __u32 srq_limit; 978 __u64 driver_data[0]; 979 }; 980 981 struct ib_uverbs_query_srq { 982 __u64 response; 983 __u32 srq_handle; 984 __u32 reserved; 985 __u64 driver_data[0]; 986 }; 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 995 struct ib_uverbs_destroy_srq { 996 __u64 response; 997 __u32 srq_handle; 998 __u32 reserved; 999 }; 1000 1001 struct ib_uverbs_destroy_srq_resp { 1002 __u32 events_reported; 1003 }; 1004 1005 struct ib_uverbs_ex_create_wq { 1006 __u32 comp_mask; 1007 __u32 wq_type; 1008 __u64 user_handle; 1009 __u32 pd_handle; 1010 __u32 cq_handle; 1011 __u32 max_wr; 1012 __u32 max_sge; 1013 }; 1014 1015 struct ib_uverbs_ex_create_wq_resp { 1016 __u32 comp_mask; 1017 __u32 response_length; 1018 __u32 wq_handle; 1019 __u32 max_wr; 1020 __u32 max_sge; 1021 __u32 wqn; 1022 }; 1023 1024 struct ib_uverbs_ex_destroy_wq { 1025 __u32 comp_mask; 1026 __u32 wq_handle; 1027 }; 1028 1029 struct ib_uverbs_ex_destroy_wq_resp { 1030 __u32 comp_mask; 1031 __u32 response_length; 1032 __u32 events_reported; 1033 __u32 reserved; 1034 }; 1035 1036 struct ib_uverbs_ex_modify_wq { 1037 __u32 attr_mask; 1038 __u32 wq_handle; 1039 __u32 wq_state; 1040 __u32 curr_wq_state; 1041 }; 1042 1043 /* Prevent memory allocation rather than max expected size */ 1044 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d 1045 struct ib_uverbs_ex_create_rwq_ind_table { 1046 __u32 comp_mask; 1047 __u32 log_ind_tbl_size; 1048 /* Following are the wq handles according to log_ind_tbl_size 1049 * wq_handle1 1050 * wq_handle2 1051 */ 1052 __u32 wq_handles[0]; 1053 }; 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 1062 struct ib_uverbs_ex_destroy_rwq_ind_table { 1063 __u32 comp_mask; 1064 __u32 ind_tbl_handle; 1065 }; 1066 1067 #endif /* IB_USER_VERBS_H */ 1068