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.
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:
13 * Redistribution and use in source and binary forms, with or
14 * without modification, are permitted provided that the following
17 * - Redistributions of source code must retain the above
18 * copyright notice, this list of conditions and the following
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.
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
36 #ifndef IB_USER_VERBS_H
37 #define IB_USER_VERBS_H
39 #include <linux/types.h>
42 * Increment this value if any changes that break userspace ABI
43 * compatibility are made.
45 #define IB_USER_VERBS_ABI_VERSION 6
48 IB_USER_VERBS_CMD_GET_CONTEXT,
49 IB_USER_VERBS_CMD_QUERY_DEVICE,
50 IB_USER_VERBS_CMD_QUERY_PORT,
51 IB_USER_VERBS_CMD_ALLOC_PD,
52 IB_USER_VERBS_CMD_DEALLOC_PD,
53 IB_USER_VERBS_CMD_CREATE_AH,
54 IB_USER_VERBS_CMD_MODIFY_AH,
55 IB_USER_VERBS_CMD_QUERY_AH,
56 IB_USER_VERBS_CMD_DESTROY_AH,
57 IB_USER_VERBS_CMD_REG_MR,
58 IB_USER_VERBS_CMD_REG_SMR,
59 IB_USER_VERBS_CMD_REREG_MR,
60 IB_USER_VERBS_CMD_QUERY_MR,
61 IB_USER_VERBS_CMD_DEREG_MR,
62 IB_USER_VERBS_CMD_ALLOC_MW,
63 IB_USER_VERBS_CMD_BIND_MW,
64 IB_USER_VERBS_CMD_DEALLOC_MW,
65 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
66 IB_USER_VERBS_CMD_CREATE_CQ,
67 IB_USER_VERBS_CMD_RESIZE_CQ,
68 IB_USER_VERBS_CMD_DESTROY_CQ,
69 IB_USER_VERBS_CMD_POLL_CQ,
70 IB_USER_VERBS_CMD_PEEK_CQ,
71 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
72 IB_USER_VERBS_CMD_CREATE_QP,
73 IB_USER_VERBS_CMD_QUERY_QP,
74 IB_USER_VERBS_CMD_MODIFY_QP,
75 IB_USER_VERBS_CMD_DESTROY_QP,
76 IB_USER_VERBS_CMD_POST_SEND,
77 IB_USER_VERBS_CMD_POST_RECV,
78 IB_USER_VERBS_CMD_ATTACH_MCAST,
79 IB_USER_VERBS_CMD_DETACH_MCAST,
80 IB_USER_VERBS_CMD_CREATE_SRQ,
81 IB_USER_VERBS_CMD_MODIFY_SRQ,
82 IB_USER_VERBS_CMD_QUERY_SRQ,
83 IB_USER_VERBS_CMD_DESTROY_SRQ,
84 IB_USER_VERBS_CMD_POST_SRQ_RECV,
85 IB_USER_VERBS_CMD_CREATE_XRC_SRQ,
86 IB_USER_VERBS_CMD_OPEN_XRC_DOMAIN,
87 IB_USER_VERBS_CMD_CLOSE_XRC_DOMAIN,
88 IB_USER_VERBS_CMD_CREATE_XRC_RCV_QP,
89 IB_USER_VERBS_CMD_MODIFY_XRC_RCV_QP,
90 IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP,
91 IB_USER_VERBS_CMD_REG_XRC_RCV_QP,
92 IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP,
96 * Make sure that all structs defined in this file remain laid out so
97 * that they pack the same way on 32-bit and 64-bit architectures (to
98 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
100 * - Do not use pointer types -- pass pointers in __u64 instead.
101 * - Make sure that any structure larger than 4 bytes is padded to a
102 * multiple of 8 bytes. Otherwise the structure size will be
103 * different between 32-bit and 64-bit architectures.
106 struct ib_uverbs_async_event_desc {
108 __u32 event_type; /* enum ib_event_type */
112 struct ib_uverbs_comp_event_desc {
117 * All commands from userspace should start with a __u32 command field
118 * followed by __u16 in_words and out_words fields (which give the
119 * length of the command block and response buffer if any in 32-bit
120 * words). The kernel driver will read these fields first and read
121 * the rest of the command struct based on these value.
124 struct ib_uverbs_cmd_hdr {
130 struct ib_uverbs_get_context {
132 __u64 driver_data[0];
135 struct ib_uverbs_get_context_resp {
137 __u32 num_comp_vectors;
140 struct ib_uverbs_query_device {
142 __u64 driver_data[0];
145 struct ib_uverbs_query_device_resp {
148 __be64 sys_image_guid;
152 __u32 vendor_part_id;
156 __u32 device_cap_flags;
163 __u32 max_qp_rd_atom;
164 __u32 max_ee_rd_atom;
165 __u32 max_res_rd_atom;
166 __u32 max_qp_init_rd_atom;
167 __u32 max_ee_init_rd_atom;
172 __u32 max_raw_ipv6_qp;
173 __u32 max_raw_ethy_qp;
175 __u32 max_mcast_qp_attach;
176 __u32 max_total_mcast_qp_attach;
179 __u32 max_map_per_fmr;
184 __u8 local_ca_ack_delay;
189 struct ib_uverbs_query_port {
193 __u64 driver_data[0];
196 struct ib_uverbs_query_port_resp {
197 __u32 port_cap_flags;
200 __u32 qkey_viol_cntr;
212 __u8 init_type_reply;
220 struct ib_uverbs_alloc_pd {
222 __u64 driver_data[0];
225 struct ib_uverbs_alloc_pd_resp {
229 struct ib_uverbs_dealloc_pd {
233 struct ib_uverbs_reg_mr {
240 __u64 driver_data[0];
243 struct ib_uverbs_reg_mr_resp {
249 struct ib_uverbs_dereg_mr {
253 struct ib_uverbs_create_comp_channel {
257 struct ib_uverbs_create_comp_channel_resp {
261 struct ib_uverbs_create_cq {
268 __u64 driver_data[0];
271 struct ib_uverbs_create_cq_resp {
276 struct ib_uverbs_resize_cq {
280 __u64 driver_data[0];
283 struct ib_uverbs_resize_cq_resp {
286 __u64 driver_data[0];
289 struct ib_uverbs_poll_cq {
295 struct ib_uverbs_wc {
303 __u32 invalidate_rkey;
316 struct ib_uverbs_poll_cq_resp {
319 struct ib_uverbs_wc wc[0];
322 struct ib_uverbs_req_notify_cq {
324 __u32 solicited_only;
327 struct ib_uverbs_destroy_cq {
333 struct ib_uverbs_destroy_cq_resp {
334 __u32 comp_events_reported;
335 __u32 async_events_reported;
338 struct ib_uverbs_global_route {
347 struct ib_uverbs_ah_attr {
348 struct ib_uverbs_global_route grh;
358 struct ib_uverbs_qp_attr {
363 __u32 path_mig_state;
368 __u32 qp_access_flags;
370 struct ib_uverbs_ah_attr ah_attr;
371 struct ib_uverbs_ah_attr alt_ah_attr;
378 __u32 max_inline_data;
381 __u16 alt_pkey_index;
382 __u8 en_sqd_async_notify;
385 __u8 max_dest_rd_atomic;
396 struct ib_uverbs_create_qp {
400 __u32 send_cq_handle;
401 __u32 recv_cq_handle;
407 __u32 max_inline_data;
412 __u64 driver_data[0];
415 struct ib_uverbs_create_qp_resp {
422 __u32 max_inline_data;
427 * This struct needs to remain a multiple of 8 bytes to keep the
428 * alignment of the modify QP parameters.
430 struct ib_uverbs_qp_dest {
445 struct ib_uverbs_query_qp {
449 __u64 driver_data[0];
452 struct ib_uverbs_query_qp_resp {
453 struct ib_uverbs_qp_dest dest;
454 struct ib_uverbs_qp_dest alt_dest;
459 __u32 max_inline_data;
464 __u32 qp_access_flags;
466 __u16 alt_pkey_index;
473 __u8 max_dest_rd_atomic;
483 __u64 driver_data[0];
486 struct ib_uverbs_modify_qp {
487 struct ib_uverbs_qp_dest dest;
488 struct ib_uverbs_qp_dest alt_dest;
495 __u32 qp_access_flags;
497 __u16 alt_pkey_index;
502 __u8 en_sqd_async_notify;
504 __u8 max_dest_rd_atomic;
513 __u64 driver_data[0];
516 struct ib_uverbs_modify_qp_resp {
519 struct ib_uverbs_destroy_qp {
525 struct ib_uverbs_destroy_qp_resp {
526 __u32 events_reported;
530 * The ib_uverbs_sge structure isn't used anywhere, since we assume
531 * the ib_sge structure is packed the same way on 32-bit and 64-bit
532 * architectures in both kernel and user space. It's just here to
535 struct ib_uverbs_sge {
541 struct ib_uverbs_send_wr {
548 __u32 invalidate_rkey;
572 struct ib_uverbs_post_send {
578 struct ib_uverbs_send_wr send_wr[0];
581 struct ib_uverbs_post_send_resp {
585 struct ib_uverbs_recv_wr {
591 struct ib_uverbs_post_recv {
597 struct ib_uverbs_recv_wr recv_wr[0];
600 struct ib_uverbs_post_recv_resp {
604 struct ib_uverbs_post_srq_recv {
610 struct ib_uverbs_recv_wr recv[0];
613 struct ib_uverbs_post_srq_recv_resp {
617 struct ib_uverbs_create_ah {
622 struct ib_uverbs_ah_attr attr;
625 struct ib_uverbs_create_ah_resp {
629 struct ib_uverbs_destroy_ah {
633 struct ib_uverbs_attach_mcast {
638 __u64 driver_data[0];
641 struct ib_uverbs_detach_mcast {
646 __u64 driver_data[0];
649 struct ib_uverbs_create_srq {
656 __u64 driver_data[0];
659 struct ib_uverbs_create_xrc_srq {
668 __u64 driver_data[0];
671 struct ib_uverbs_create_srq_resp {
678 struct ib_uverbs_modify_srq {
683 __u64 driver_data[0];
686 struct ib_uverbs_query_srq {
690 __u64 driver_data[0];
693 struct ib_uverbs_query_srq_resp {
700 struct ib_uverbs_destroy_srq {
706 struct ib_uverbs_destroy_srq_resp {
707 __u32 events_reported;
710 struct ib_uverbs_open_xrc_domain {
714 __u64 driver_data[0];
717 struct ib_uverbs_open_xrc_domain_resp {
721 struct ib_uverbs_close_xrc_domain {
725 __u64 driver_data[0];
728 struct ib_uverbs_create_xrc_rcv_qp {
731 __u32 xrc_domain_handle;
736 __u32 max_inline_data;
740 __u64 driver_data[0];
743 struct ib_uverbs_create_xrc_rcv_qp_resp {
748 struct ib_uverbs_modify_xrc_rcv_qp {
749 __u32 xrc_domain_handle;
751 struct ib_uverbs_qp_dest dest;
752 struct ib_uverbs_qp_dest alt_dest;
758 __u32 qp_access_flags;
760 __u16 alt_pkey_index;
765 __u8 en_sqd_async_notify;
767 __u8 max_dest_rd_atomic;
776 __u64 driver_data[0];
779 struct ib_uverbs_query_xrc_rcv_qp {
781 __u32 xrc_domain_handle;
785 __u64 driver_data[0];
788 struct ib_uverbs_reg_xrc_rcv_qp {
789 __u32 xrc_domain_handle;
791 __u64 driver_data[0];
794 struct ib_uverbs_unreg_xrc_rcv_qp {
795 __u32 xrc_domain_handle;
797 __u64 driver_data[0];
801 #endif /* IB_USER_VERBS_H */