2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 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
34 * $Id: ib_user_verbs.h 2708 2005-06-24 17:27:21Z roland $
37 #ifndef IB_USER_VERBS_H
38 #define IB_USER_VERBS_H
40 #include <linux/types.h>
43 * Increment this value if any changes that break userspace ABI
44 * compatibility are made.
46 #define IB_USER_VERBS_ABI_VERSION 3
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
89 * Make sure that all structs defined in this file remain laid out so
90 * that they pack the same way on 32-bit and 64-bit architectures (to
91 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
93 * - Do not use pointer types -- pass pointers in __u64 instead.
94 * - Make sure that any structure larger than 4 bytes is padded to a
95 * multiple of 8 bytes. Otherwise the structure size will be
96 * different between 32-bit and 64-bit architectures.
99 struct ib_uverbs_async_event_desc {
101 __u32 event_type; /* enum ib_event_type */
105 struct ib_uverbs_comp_event_desc {
110 * All commands from userspace should start with a __u32 command field
111 * followed by __u16 in_words and out_words fields (which give the
112 * length of the command block and response buffer if any in 32-bit
113 * words). The kernel driver will read these fields first and read
114 * the rest of the command struct based on these value.
117 struct ib_uverbs_cmd_hdr {
123 struct ib_uverbs_get_context {
125 __u64 driver_data[0];
128 struct ib_uverbs_get_context_resp {
130 __u32 num_comp_vectors;
133 struct ib_uverbs_query_device {
135 __u64 driver_data[0];
138 struct ib_uverbs_query_device_resp {
141 __be64 sys_image_guid;
145 __u32 vendor_part_id;
149 __u32 device_cap_flags;
156 __u32 max_qp_rd_atom;
157 __u32 max_ee_rd_atom;
158 __u32 max_res_rd_atom;
159 __u32 max_qp_init_rd_atom;
160 __u32 max_ee_init_rd_atom;
165 __u32 max_raw_ipv6_qp;
166 __u32 max_raw_ethy_qp;
168 __u32 max_mcast_qp_attach;
169 __u32 max_total_mcast_qp_attach;
172 __u32 max_map_per_fmr;
177 __u8 local_ca_ack_delay;
182 struct ib_uverbs_query_port {
186 __u64 driver_data[0];
189 struct ib_uverbs_query_port_resp {
190 __u32 port_cap_flags;
193 __u32 qkey_viol_cntr;
205 __u8 init_type_reply;
212 struct ib_uverbs_alloc_pd {
214 __u64 driver_data[0];
217 struct ib_uverbs_alloc_pd_resp {
221 struct ib_uverbs_dealloc_pd {
225 struct ib_uverbs_reg_mr {
232 __u64 driver_data[0];
235 struct ib_uverbs_reg_mr_resp {
241 struct ib_uverbs_dereg_mr {
245 struct ib_uverbs_create_comp_channel {
249 struct ib_uverbs_create_comp_channel_resp {
253 struct ib_uverbs_create_cq {
260 __u64 driver_data[0];
263 struct ib_uverbs_create_cq_resp {
268 struct ib_uverbs_poll_cq {
274 struct ib_uverbs_wc {
292 struct ib_uverbs_poll_cq_resp {
295 struct ib_uverbs_wc wc[0];
298 struct ib_uverbs_req_notify_cq {
300 __u32 solicited_only;
303 struct ib_uverbs_destroy_cq {
309 struct ib_uverbs_destroy_cq_resp {
310 __u32 comp_events_reported;
311 __u32 async_events_reported;
314 struct ib_uverbs_create_qp {
318 __u32 send_cq_handle;
319 __u32 recv_cq_handle;
325 __u32 max_inline_data;
330 __u64 driver_data[0];
333 struct ib_uverbs_create_qp_resp {
339 * This struct needs to remain a multiple of 8 bytes to keep the
340 * alignment of the modify QP parameters.
342 struct ib_uverbs_qp_dest {
357 struct ib_uverbs_modify_qp {
358 struct ib_uverbs_qp_dest dest;
359 struct ib_uverbs_qp_dest alt_dest;
366 __u32 qp_access_flags;
368 __u16 alt_pkey_index;
373 __u8 en_sqd_async_notify;
375 __u8 max_dest_rd_atomic;
384 __u64 driver_data[0];
387 struct ib_uverbs_modify_qp_resp {
390 struct ib_uverbs_destroy_qp {
396 struct ib_uverbs_destroy_qp_resp {
397 __u32 events_reported;
401 * The ib_uverbs_sge structure isn't used anywhere, since we assume
402 * the ib_sge structure is packed the same way on 32-bit and 64-bit
403 * architectures in both kernel and user space. It's just here to
406 struct ib_uverbs_sge {
412 struct ib_uverbs_send_wr {
440 struct ib_uverbs_post_send {
446 struct ib_uverbs_send_wr send_wr[0];
449 struct ib_uverbs_post_send_resp {
453 struct ib_uverbs_recv_wr {
459 struct ib_uverbs_post_recv {
465 struct ib_uverbs_recv_wr recv_wr[0];
468 struct ib_uverbs_post_recv_resp {
472 struct ib_uverbs_post_srq_recv {
478 struct ib_uverbs_recv_wr recv[0];
481 struct ib_uverbs_post_srq_recv_resp {
485 struct ib_uverbs_global_route {
494 struct ib_uverbs_ah_attr {
495 struct ib_uverbs_global_route grh;
505 struct ib_uverbs_create_ah {
510 struct ib_uverbs_ah_attr attr;
513 struct ib_uverbs_create_ah_resp {
517 struct ib_uverbs_destroy_ah {
521 struct ib_uverbs_attach_mcast {
526 __u64 driver_data[0];
529 struct ib_uverbs_detach_mcast {
534 __u64 driver_data[0];
537 struct ib_uverbs_create_srq {
544 __u64 driver_data[0];
547 struct ib_uverbs_create_srq_resp {
551 struct ib_uverbs_modify_srq {
558 __u64 driver_data[0];
561 struct ib_uverbs_destroy_srq {
567 struct ib_uverbs_destroy_srq_resp {
568 __u32 events_reported;
571 #endif /* IB_USER_VERBS_H */