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.
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38 #include <infiniband/types.h>
41 * This file must be kept in sync with the kernel's version of
42 * drivers/infiniband/include/ib_user_verbs.h
46 * The minimum and maximum kernel ABI that we can handle.
48 #define IB_USER_VERBS_MIN_ABI_VERSION 1
49 #define IB_USER_VERBS_MAX_ABI_VERSION 6
52 IB_USER_VERBS_CMD_GET_CONTEXT,
53 IB_USER_VERBS_CMD_QUERY_DEVICE,
54 IB_USER_VERBS_CMD_QUERY_PORT,
55 IB_USER_VERBS_CMD_ALLOC_PD,
56 IB_USER_VERBS_CMD_DEALLOC_PD,
57 IB_USER_VERBS_CMD_CREATE_AH,
58 IB_USER_VERBS_CMD_MODIFY_AH,
59 IB_USER_VERBS_CMD_QUERY_AH,
60 IB_USER_VERBS_CMD_DESTROY_AH,
61 IB_USER_VERBS_CMD_REG_MR,
62 IB_USER_VERBS_CMD_REG_SMR,
63 IB_USER_VERBS_CMD_REREG_MR,
64 IB_USER_VERBS_CMD_QUERY_MR,
65 IB_USER_VERBS_CMD_DEREG_MR,
66 IB_USER_VERBS_CMD_ALLOC_MW,
67 IB_USER_VERBS_CMD_BIND_MW,
68 IB_USER_VERBS_CMD_DEALLOC_MW,
69 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
70 IB_USER_VERBS_CMD_CREATE_CQ,
71 IB_USER_VERBS_CMD_RESIZE_CQ,
72 IB_USER_VERBS_CMD_DESTROY_CQ,
73 IB_USER_VERBS_CMD_POLL_CQ,
74 IB_USER_VERBS_CMD_PEEK_CQ,
75 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
76 IB_USER_VERBS_CMD_CREATE_QP,
77 IB_USER_VERBS_CMD_QUERY_QP,
78 IB_USER_VERBS_CMD_MODIFY_QP,
79 IB_USER_VERBS_CMD_DESTROY_QP,
80 IB_USER_VERBS_CMD_POST_SEND,
81 IB_USER_VERBS_CMD_POST_RECV,
82 IB_USER_VERBS_CMD_ATTACH_MCAST,
83 IB_USER_VERBS_CMD_DETACH_MCAST,
84 IB_USER_VERBS_CMD_CREATE_SRQ,
85 IB_USER_VERBS_CMD_MODIFY_SRQ,
86 IB_USER_VERBS_CMD_QUERY_SRQ,
87 IB_USER_VERBS_CMD_DESTROY_SRQ,
88 IB_USER_VERBS_CMD_POST_SRQ_RECV,
89 IB_USER_VERBS_CMD_CREATE_XRC_SRQ,
90 IB_USER_VERBS_CMD_OPEN_XRC_DOMAIN,
91 IB_USER_VERBS_CMD_CLOSE_XRC_DOMAIN,
92 IB_USER_VERBS_CMD_CREATE_XRC_RCV_QP,
93 IB_USER_VERBS_CMD_MODIFY_XRC_RCV_QP,
94 IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP,
95 IB_USER_VERBS_CMD_REG_XRC_RCV_QP,
96 IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP,
100 * Make sure that all structs defined in this file remain laid out so
101 * that they pack the same way on 32-bit and 64-bit architectures (to
102 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
104 * - Do not use pointer types -- pass pointers in __u64 instead.
105 * - Make sure that any structure larger than 4 bytes is padded to a
106 * multiple of 8 bytes. Otherwise the structure size will be
107 * different between 32-bit and 64-bit architectures.
110 struct ibv_kern_async_event {
116 struct ibv_comp_event {
121 * All commands from userspace should start with a __u32 command field
122 * followed by __u16 in_words and out_words fields (which give the
123 * length of the command block and response buffer if any in 32-bit
124 * words). The kernel driver will read these fields first and read
125 * the rest of the command struct based on these value.
128 struct ibv_query_params {
135 struct ibv_query_params_resp {
139 struct ibv_get_context {
144 __u64 driver_data[0];
147 struct ibv_get_context_resp {
149 __u32 num_comp_vectors;
152 struct ibv_query_device {
157 __u64 driver_data[0];
160 struct ibv_query_device_resp {
163 __u64 sys_image_guid;
167 __u32 vendor_part_id;
171 __u32 device_cap_flags;
178 __u32 max_qp_rd_atom;
179 __u32 max_ee_rd_atom;
180 __u32 max_res_rd_atom;
181 __u32 max_qp_init_rd_atom;
182 __u32 max_ee_init_rd_atom;
187 __u32 max_raw_ipv6_qp;
188 __u32 max_raw_ethy_qp;
190 __u32 max_mcast_qp_attach;
191 __u32 max_total_mcast_qp_attach;
194 __u32 max_map_per_fmr;
199 __u8 local_ca_ack_delay;
204 struct ibv_query_port {
211 __u64 driver_data[0];
214 struct ibv_query_port_resp {
215 __u32 port_cap_flags;
218 __u32 qkey_viol_cntr;
230 __u8 init_type_reply;
238 struct ibv_alloc_pd {
243 __u64 driver_data[0];
246 struct ibv_alloc_pd_resp {
250 struct ibv_dealloc_pd {
267 __u64 driver_data[0];
270 struct ibv_reg_mr_resp {
276 struct ibv_dereg_mr {
283 struct ibv_create_comp_channel {
290 struct ibv_create_comp_channel_resp {
294 struct ibv_create_cq {
304 __u64 driver_data[0];
307 struct ibv_create_cq_resp {
339 struct ibv_poll_cq_resp {
342 struct ibv_kern_wc wc[0];
345 struct ibv_req_notify_cq {
353 struct ibv_resize_cq {
360 __u64 driver_data[0];
363 struct ibv_resize_cq_resp {
366 __u64 driver_data[0];
369 struct ibv_destroy_cq {
378 struct ibv_destroy_cq_resp {
379 __u32 comp_events_reported;
380 __u32 async_events_reported;
383 struct ibv_kern_global_route {
392 struct ibv_kern_ah_attr {
393 struct ibv_kern_global_route grh;
403 struct ibv_kern_qp_attr {
408 __u32 path_mig_state;
413 __u32 qp_access_flags;
415 struct ibv_kern_ah_attr ah_attr;
416 struct ibv_kern_ah_attr alt_ah_attr;
423 __u32 max_inline_data;
426 __u16 alt_pkey_index;
427 __u8 en_sqd_async_notify;
430 __u8 max_dest_rd_atomic;
441 struct ibv_create_qp {
448 __u32 send_cq_handle;
449 __u32 recv_cq_handle;
455 __u32 max_inline_data;
460 __u64 driver_data[0];
463 struct ibv_create_qp_resp {
470 __u32 max_inline_data;
489 struct ibv_query_qp {
496 __u64 driver_data[0];
499 struct ibv_query_qp_resp {
500 struct ibv_qp_dest dest;
501 struct ibv_qp_dest alt_dest;
506 __u32 max_inline_data;
511 __u32 qp_access_flags;
513 __u16 alt_pkey_index;
520 __u8 max_dest_rd_atomic;
530 __u64 driver_data[0];
533 struct ibv_modify_qp {
537 struct ibv_qp_dest dest;
538 struct ibv_qp_dest alt_dest;
545 __u32 qp_access_flags;
547 __u16 alt_pkey_index;
552 __u8 en_sqd_async_notify;
554 __u8 max_dest_rd_atomic;
563 __u64 driver_data[0];
566 struct ibv_destroy_qp {
575 struct ibv_destroy_qp_resp {
576 __u32 events_reported;
579 struct ibv_create_xrc_rcv_qp {
585 __u32 xrc_domain_handle;
590 __u32 max_inline_data;
594 __u64 driver_data[0];
597 struct ibv_create_xrc_rcv_qp_resp {
602 struct ibv_modify_xrc_rcv_qp {
606 __u32 xrc_domain_handle;
608 struct ibv_qp_dest dest;
609 struct ibv_qp_dest alt_dest;
615 __u32 qp_access_flags;
617 __u16 alt_pkey_index;
622 __u8 en_sqd_async_notify;
624 __u8 max_dest_rd_atomic;
633 __u64 driver_data[0];
636 struct ibv_query_xrc_rcv_qp {
641 __u32 xrc_domain_handle;
645 __u64 driver_data[0];
648 struct ibv_reg_xrc_rcv_qp {
652 __u32 xrc_domain_handle;
654 __u64 driver_data[0];
657 struct ibv_unreg_xrc_rcv_qp {
661 __u32 xrc_domain_handle;
663 __u64 driver_data[0];
666 struct ibv_kern_send_wr {
694 struct ibv_post_send {
703 struct ibv_kern_send_wr send_wr[0];
706 struct ibv_post_send_resp {
710 struct ibv_kern_recv_wr {
716 struct ibv_post_recv {
725 struct ibv_kern_recv_wr recv_wr[0];
728 struct ibv_post_recv_resp {
732 struct ibv_post_srq_recv {
741 struct ibv_kern_recv_wr recv_wr[0];
744 struct ibv_post_srq_recv_resp {
748 struct ibv_create_ah {
756 struct ibv_kern_ah_attr attr;
759 struct ibv_create_ah_resp {
763 struct ibv_destroy_ah {
770 struct ibv_attach_mcast {
778 __u64 driver_data[0];
781 struct ibv_detach_mcast {
789 __u64 driver_data[0];
792 struct ibv_create_srq {
802 __u64 driver_data[0];
805 struct ibv_create_xrc_srq {
817 __u64 driver_data[0];
820 struct ibv_create_srq_resp {
827 struct ibv_modify_srq {
835 __u64 driver_data[0];
838 struct ibv_query_srq {
845 __u64 driver_data[0];
848 struct ibv_query_srq_resp {
855 struct ibv_destroy_srq {
864 struct ibv_destroy_srq_resp {
865 __u32 events_reported;
868 struct ibv_open_xrc_domain {
875 __u64 driver_data[0];
878 struct ibv_open_xrc_domain_resp {
882 struct ibv_close_xrc_domain {
889 __u64 driver_data[0];
893 * Compatibility with older ABI versions
897 IB_USER_VERBS_CMD_QUERY_PARAMS_V2,
898 IB_USER_VERBS_CMD_GET_CONTEXT_V2,
899 IB_USER_VERBS_CMD_QUERY_DEVICE_V2,
900 IB_USER_VERBS_CMD_QUERY_PORT_V2,
901 IB_USER_VERBS_CMD_QUERY_GID_V2,
902 IB_USER_VERBS_CMD_QUERY_PKEY_V2,
903 IB_USER_VERBS_CMD_ALLOC_PD_V2,
904 IB_USER_VERBS_CMD_DEALLOC_PD_V2,
905 IB_USER_VERBS_CMD_CREATE_AH_V2,
906 IB_USER_VERBS_CMD_MODIFY_AH_V2,
907 IB_USER_VERBS_CMD_QUERY_AH_V2,
908 IB_USER_VERBS_CMD_DESTROY_AH_V2,
909 IB_USER_VERBS_CMD_REG_MR_V2,
910 IB_USER_VERBS_CMD_REG_SMR_V2,
911 IB_USER_VERBS_CMD_REREG_MR_V2,
912 IB_USER_VERBS_CMD_QUERY_MR_V2,
913 IB_USER_VERBS_CMD_DEREG_MR_V2,
914 IB_USER_VERBS_CMD_ALLOC_MW_V2,
915 IB_USER_VERBS_CMD_BIND_MW_V2,
916 IB_USER_VERBS_CMD_DEALLOC_MW_V2,
917 IB_USER_VERBS_CMD_CREATE_CQ_V2,
918 IB_USER_VERBS_CMD_RESIZE_CQ_V2,
919 IB_USER_VERBS_CMD_DESTROY_CQ_V2,
920 IB_USER_VERBS_CMD_POLL_CQ_V2,
921 IB_USER_VERBS_CMD_PEEK_CQ_V2,
922 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ_V2,
923 IB_USER_VERBS_CMD_CREATE_QP_V2,
924 IB_USER_VERBS_CMD_QUERY_QP_V2,
925 IB_USER_VERBS_CMD_MODIFY_QP_V2,
926 IB_USER_VERBS_CMD_DESTROY_QP_V2,
927 IB_USER_VERBS_CMD_POST_SEND_V2,
928 IB_USER_VERBS_CMD_POST_RECV_V2,
929 IB_USER_VERBS_CMD_ATTACH_MCAST_V2,
930 IB_USER_VERBS_CMD_DETACH_MCAST_V2,
931 IB_USER_VERBS_CMD_CREATE_SRQ_V2,
932 IB_USER_VERBS_CMD_MODIFY_SRQ_V2,
933 IB_USER_VERBS_CMD_QUERY_SRQ_V2,
934 IB_USER_VERBS_CMD_DESTROY_SRQ_V2,
935 IB_USER_VERBS_CMD_POST_SRQ_RECV_V2,
937 * Set commands that didn't exist to -1 so our compile-time
938 * trick opcodes in IBV_INIT_CMD() doesn't break.
940 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL_V2 = -1,
941 IB_USER_VERBS_CMD_CREATE_XRC_SRQ_V2 = -1,
942 IB_USER_VERBS_CMD_OPEN_XRC_DOMAIN_V2 = -1,
943 IB_USER_VERBS_CMD_CLOSE_XRC_DOMAIN_V2 = -1,
944 IB_USER_VERBS_CMD_CREATE_XRC_RCV_QP_V2 = -1,
945 IB_USER_VERBS_CMD_MODIFY_XRC_RCV_QP_V2 = -1,
946 IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP_V2 = -1,
947 IB_USER_VERBS_CMD_REG_XRC_RCV_QP_V2 = -1,
948 IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP_V2 = -1,
951 struct ibv_destroy_cq_v1 {
958 struct ibv_destroy_qp_v1 {
965 struct ibv_destroy_srq_v1 {
972 struct ibv_get_context_v2 {
978 __u64 driver_data[0];
981 struct ibv_create_cq_v2 {
989 __u64 driver_data[0];
992 struct ibv_modify_srq_v3 {
1002 __u64 driver_data[0];
1005 struct ibv_create_qp_resp_v3 {
1010 struct ibv_create_qp_resp_v4 {
1017 __u32 max_inline_data;
1020 struct ibv_create_srq_resp_v5 {
1024 #endif /* KERN_ABI_H */