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
35 * $Id: ib_user_verbs.h 4019 2005-11-11 00:33:09Z sean.hefty $
40 #ifndef IB_USER_VERBS_H
41 #define IB_USER_VERBS_H
43 #include <contrib/rdma/types.h>
47 * Increment this value if any changes that break userspace ABI
48 * compatibility are made.
50 #define IB_USER_VERBS_ABI_VERSION 6
53 IB_USER_VERBS_CMD_GET_CONTEXT,
54 IB_USER_VERBS_CMD_QUERY_DEVICE,
55 IB_USER_VERBS_CMD_QUERY_PORT,
56 IB_USER_VERBS_CMD_ALLOC_PD,
57 IB_USER_VERBS_CMD_DEALLOC_PD,
58 IB_USER_VERBS_CMD_CREATE_AH,
59 IB_USER_VERBS_CMD_MODIFY_AH,
60 IB_USER_VERBS_CMD_QUERY_AH,
61 IB_USER_VERBS_CMD_DESTROY_AH,
62 IB_USER_VERBS_CMD_REG_MR,
63 IB_USER_VERBS_CMD_REG_SMR,
64 IB_USER_VERBS_CMD_REREG_MR,
65 IB_USER_VERBS_CMD_QUERY_MR,
66 IB_USER_VERBS_CMD_DEREG_MR,
67 IB_USER_VERBS_CMD_ALLOC_MW,
68 IB_USER_VERBS_CMD_BIND_MW,
69 IB_USER_VERBS_CMD_DEALLOC_MW,
70 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
71 IB_USER_VERBS_CMD_CREATE_CQ,
72 IB_USER_VERBS_CMD_RESIZE_CQ,
73 IB_USER_VERBS_CMD_DESTROY_CQ,
74 IB_USER_VERBS_CMD_POLL_CQ,
75 IB_USER_VERBS_CMD_PEEK_CQ,
76 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
77 IB_USER_VERBS_CMD_CREATE_QP,
78 IB_USER_VERBS_CMD_QUERY_QP,
79 IB_USER_VERBS_CMD_MODIFY_QP,
80 IB_USER_VERBS_CMD_DESTROY_QP,
81 IB_USER_VERBS_CMD_POST_SEND,
82 IB_USER_VERBS_CMD_POST_RECV,
83 IB_USER_VERBS_CMD_ATTACH_MCAST,
84 IB_USER_VERBS_CMD_DETACH_MCAST,
85 IB_USER_VERBS_CMD_CREATE_SRQ,
86 IB_USER_VERBS_CMD_MODIFY_SRQ,
87 IB_USER_VERBS_CMD_QUERY_SRQ,
88 IB_USER_VERBS_CMD_DESTROY_SRQ,
89 IB_USER_VERBS_CMD_POST_SRQ_RECV
93 * Make sure that all structs defined in this file remain laid out so
94 * that they pack the same way on 32-bit and 64-bit architectures (to
95 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
97 * - Do not use pointer types -- pass pointers in __u64 instead.
98 * - Make sure that any structure larger than 4 bytes is padded to a
99 * multiple of 8 bytes. Otherwise the structure size will be
100 * different between 32-bit and 64-bit architectures.
103 struct ib_uverbs_async_event_desc {
105 __u32 event_type; /* enum ib_event_type */
109 struct ib_uverbs_comp_event_desc {
114 * All commands from userspace should start with a __u32 command field
115 * followed by __u16 in_words and out_words fields (which give the
116 * length of the command block and response buffer if any in 32-bit
117 * words). The kernel driver will read these fields first and read
118 * the rest of the command struct based on these value.
121 struct ib_uverbs_cmd_hdr {
127 struct ib_uverbs_get_context {
129 __u64 driver_data[0];
132 struct ib_uverbs_get_context_resp {
134 __u32 num_comp_vectors;
137 struct ib_uverbs_query_device {
139 __u64 driver_data[0];
142 struct ib_uverbs_query_device_resp {
145 __be64 sys_image_guid;
149 __u32 vendor_part_id;
153 __u32 device_cap_flags;
160 __u32 max_qp_rd_atom;
161 __u32 max_ee_rd_atom;
162 __u32 max_res_rd_atom;
163 __u32 max_qp_init_rd_atom;
164 __u32 max_ee_init_rd_atom;
169 __u32 max_raw_ipv6_qp;
170 __u32 max_raw_ethy_qp;
172 __u32 max_mcast_qp_attach;
173 __u32 max_total_mcast_qp_attach;
176 __u32 max_map_per_fmr;
181 __u8 local_ca_ack_delay;
186 struct ib_uverbs_query_port {
190 __u64 driver_data[0];
193 struct ib_uverbs_query_port_resp {
194 __u32 port_cap_flags;
197 __u32 qkey_viol_cntr;
209 __u8 init_type_reply;
216 struct ib_uverbs_alloc_pd {
218 __u64 driver_data[0];
221 struct ib_uverbs_alloc_pd_resp {
225 struct ib_uverbs_dealloc_pd {
229 struct ib_uverbs_reg_mr {
236 __u64 driver_data[0];
239 struct ib_uverbs_reg_mr_resp {
245 struct ib_uverbs_dereg_mr {
249 struct ib_uverbs_create_comp_channel {
253 struct ib_uverbs_create_comp_channel_resp {
257 struct ib_uverbs_create_cq {
264 __u64 driver_data[0];
267 struct ib_uverbs_create_cq_resp {
272 struct ib_uverbs_resize_cq {
276 __u64 driver_data[0];
279 struct ib_uverbs_resize_cq_resp {
282 __u64 driver_data[0];
285 struct ib_uverbs_poll_cq {
291 struct ib_uverbs_wc {
309 struct ib_uverbs_poll_cq_resp {
312 struct ib_uverbs_wc wc[0];
315 struct ib_uverbs_req_notify_cq {
317 __u32 solicited_only;
320 struct ib_uverbs_destroy_cq {
326 struct ib_uverbs_destroy_cq_resp {
327 __u32 comp_events_reported;
328 __u32 async_events_reported;
331 struct ib_uverbs_global_route {
340 struct ib_uverbs_ah_attr {
341 struct ib_uverbs_global_route grh;
351 struct ib_uverbs_qp_attr {
356 __u32 path_mig_state;
361 __u32 qp_access_flags;
363 struct ib_uverbs_ah_attr ah_attr;
364 struct ib_uverbs_ah_attr alt_ah_attr;
371 __u32 max_inline_data;
374 __u16 alt_pkey_index;
375 __u8 en_sqd_async_notify;
378 __u8 max_dest_rd_atomic;
389 struct ib_uverbs_create_qp {
393 __u32 send_cq_handle;
394 __u32 recv_cq_handle;
400 __u32 max_inline_data;
405 __u64 driver_data[0];
408 struct ib_uverbs_create_qp_resp {
415 __u32 max_inline_data;
420 * This struct needs to remain a multiple of 8 bytes to keep the
421 * alignment of the modify QP parameters.
423 struct ib_uverbs_qp_dest {
438 struct ib_uverbs_query_qp {
442 __u64 driver_data[0];
445 struct ib_uverbs_query_qp_resp {
446 struct ib_uverbs_qp_dest dest;
447 struct ib_uverbs_qp_dest alt_dest;
452 __u32 max_inline_data;
457 __u32 qp_access_flags;
459 __u16 alt_pkey_index;
466 __u8 max_dest_rd_atomic;
476 __u64 driver_data[0];
479 struct ib_uverbs_modify_qp {
480 struct ib_uverbs_qp_dest dest;
481 struct ib_uverbs_qp_dest alt_dest;
488 __u32 qp_access_flags;
490 __u16 alt_pkey_index;
495 __u8 en_sqd_async_notify;
497 __u8 max_dest_rd_atomic;
506 __u64 driver_data[0];
509 struct ib_uverbs_modify_qp_resp {
512 struct ib_uverbs_destroy_qp {
518 struct ib_uverbs_destroy_qp_resp {
519 __u32 events_reported;
523 * The ib_uverbs_sge structure isn't used anywhere, since we assume
524 * the ib_sge structure is packed the same way on 32-bit and 64-bit
525 * architectures in both kernel and user space. It's just here to
528 struct ib_uverbs_sge {
534 struct ib_uverbs_send_wr {
562 struct ib_uverbs_post_send {
568 struct ib_uverbs_send_wr send_wr[0];
571 struct ib_uverbs_post_send_resp {
575 struct ib_uverbs_recv_wr {
581 struct ib_uverbs_post_recv {
587 struct ib_uverbs_recv_wr recv_wr[0];
590 struct ib_uverbs_post_recv_resp {
594 struct ib_uverbs_post_srq_recv {
600 struct ib_uverbs_recv_wr recv[0];
603 struct ib_uverbs_post_srq_recv_resp {
607 struct ib_uverbs_create_ah {
612 struct ib_uverbs_ah_attr attr;
615 struct ib_uverbs_create_ah_resp {
619 struct ib_uverbs_destroy_ah {
623 struct ib_uverbs_attach_mcast {
628 __u64 driver_data[0];
631 struct ib_uverbs_detach_mcast {
636 __u64 driver_data[0];
639 struct ib_uverbs_create_srq {
646 __u64 driver_data[0];
649 struct ib_uverbs_create_srq_resp {
656 struct ib_uverbs_modify_srq {
661 __u64 driver_data[0];
664 struct ib_uverbs_query_srq {
668 __u64 driver_data[0];
671 struct ib_uverbs_query_srq_resp {
678 struct ib_uverbs_destroy_srq {
684 struct ib_uverbs_destroy_srq_resp {
685 __u32 events_reported;
688 #endif /* IB_USER_VERBS_H */