2 * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #ifndef MLX5_IB_USER_H
29 #define MLX5_IB_USER_H
31 #include <linux/types.h>
34 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
38 MLX5_SRQ_FLAG_SIGNATURE = 1 << 0,
42 MLX5_WQ_FLAG_SIGNATURE = 1 << 0,
46 /* Increment this value if any changes that break userspace ABI
47 * compatibility are made.
49 #define MLX5_IB_UVERBS_ABI_VERSION 1
51 /* Make sure that all structs defined in this file remain laid out so
52 * that they pack the same way on 32-bit and 64-bit architectures (to
53 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
54 * In particular do not use pointer types -- pass pointers in __u64
58 struct mlx5_ib_alloc_ucontext_req {
59 __u32 total_num_uuars;
60 __u32 num_low_latency_uuars;
63 struct mlx5_ib_alloc_ucontext_req_v2 {
64 __u32 total_num_uuars;
65 __u32 num_low_latency_uuars;
70 struct mlx5_ib_alloc_ucontext_resp {
74 __u32 cache_line_size;
79 __u32 max_srq_recv_wr;
82 __u32 max_desc_sz_sq_dc;
83 __u32 atomic_arg_sizes_dc;
89 enum mlx5_exp_ib_alloc_ucontext_data_resp_mask {
90 MLX5_EXP_ALLOC_CTX_RESP_MASK_CQE_COMP_MAX_NUM = 1 << 0,
91 MLX5_EXP_ALLOC_CTX_RESP_MASK_CQE_VERSION = 1 << 1,
92 MLX5_EXP_ALLOC_CTX_RESP_MASK_RROCE_UDP_SPORT_MIN = 1 << 2,
93 MLX5_EXP_ALLOC_CTX_RESP_MASK_RROCE_UDP_SPORT_MAX = 1 << 3,
94 MLX5_EXP_ALLOC_CTX_RESP_MASK_HCA_CORE_CLOCK_OFFSET = 1 << 4,
97 struct mlx5_exp_ib_alloc_ucontext_data_resp {
98 __u32 comp_mask; /* use mlx5_ib_exp_alloc_ucontext_data_resp_mask */
99 __u16 cqe_comp_max_num;
102 __u16 rroce_udp_sport_min;
103 __u16 rroce_udp_sport_max;
104 __u32 hca_core_clock_offset;
107 struct mlx5_exp_ib_alloc_ucontext_resp {
111 __u32 cache_line_size;
112 __u16 max_sq_desc_sz;
113 __u16 max_rq_desc_sz;
114 __u32 max_send_wqebb;
116 __u32 max_srq_recv_wr;
119 __u32 max_desc_sz_sq_dc;
120 __u32 atomic_arg_sizes_dc;
124 /* Some more reserved fields for
125 * future growth of mlx5_ib_alloc_ucontext_resp */
126 __u64 prefix_reserved[8];
127 struct mlx5_exp_ib_alloc_ucontext_data_resp exp_data;
130 struct mlx5_ib_alloc_pd_resp {
134 struct mlx5_ib_create_cq {
138 __u32 reserved; /* explicit padding (optional on i386) */
141 enum mlx5_exp_ib_create_cq_mask {
142 MLX5_EXP_CREATE_CQ_MASK_CQE_COMP_EN = 1 << 0,
143 MLX5_EXP_CREATE_CQ_MASK_CQE_COMP_RECV_TYPE = 1 << 1,
144 MLX5_EXP_CREATE_CQ_MASK_RESERVED = 1 << 2,
147 enum mlx5_exp_cqe_comp_recv_type {
148 MLX5_IB_CQE_FORMAT_HASH,
149 MLX5_IB_CQE_FORMAT_CSUM,
152 struct mlx5_exp_ib_create_cq_data {
153 __u32 comp_mask; /* use mlx5_exp_ib_creaet_cq_mask */
155 __u8 cqe_comp_recv_type; /* use mlx5_exp_cqe_comp_recv_type */
159 struct mlx5_exp_ib_create_cq {
163 __u32 reserved; /* explicit padding (optional on i386) */
165 /* Some more reserved fields for future growth of mlx5_ib_create_cq */
166 __u64 prefix_reserved[8];
168 /* sizeof prefix aligned with mlx5_ib_create_cq */
169 __u64 size_of_prefix;
170 struct mlx5_exp_ib_create_cq_data exp_data;
173 struct mlx5_ib_create_cq_resp {
178 struct mlx5_ib_resize_cq {
185 struct mlx5_ib_create_srq {
189 __u32 reserved; /* explicit padding (optional on i386) */
194 struct mlx5_ib_create_srq_resp {
199 struct mlx5_ib_create_qp {
208 enum mlx5_exp_ib_create_qp_mask {
209 MLX5_EXP_CREATE_QP_MASK_UIDX = 1 << 0,
210 MLX5_EXP_CREATE_QP_MASK_SQ_BUFF_ADD = 1 << 1,
211 MLX5_EXP_CREATE_QP_MASK_WC_UAR_IDX = 1 << 2,
212 MLX5_EXP_CREATE_QP_MASK_FLAGS_IDX = 1 << 3,
213 MLX5_EXP_CREATE_QP_MASK_RESERVED = 1 << 4,
216 enum mlx5_exp_create_qp_flags {
217 MLX5_EXP_CREATE_QP_MULTI_PACKET_WQE_REQ_FLAG = 1 << 0,
220 enum mlx5_exp_drv_create_qp_uar_idx {
221 MLX5_EXP_CREATE_QP_DB_ONLY_UUAR = -1
224 struct mlx5_exp_ib_create_qp_data {
225 __u32 comp_mask; /* use mlx5_exp_ib_create_qp_mask */
229 __u32 flags; /* use mlx5_exp_create_qp_flags */
232 struct mlx5_exp_ib_create_qp {
233 /* To allow casting to mlx5_ib_create_qp the prefix is the same as
234 * struct mlx5_ib_create_qp prefix
243 /* Some more reserved fields for future growth of mlx5_ib_create_qp */
244 __u64 prefix_reserved[8];
246 /* sizeof prefix aligned with mlx5_ib_create_qp */
247 __u64 size_of_prefix;
250 * Add new experimental data only inside the exp struct
252 struct mlx5_exp_ib_create_qp_data exp;
256 MLX5_EXP_INVALID_UUAR = -1,
259 struct mlx5_ib_create_qp_resp {
264 enum mlx5_exp_ib_create_qp_resp_mask {
265 MLX5_EXP_CREATE_QP_RESP_MASK_FLAGS_IDX = 1 << 0,
266 MLX5_EXP_CREATE_QP_RESP_MASK_RESERVED = 1 << 1,
269 enum mlx5_exp_create_qp_resp_flags {
270 MLX5_EXP_CREATE_QP_RESP_MULTI_PACKET_WQE_FLAG = 1 << 0,
273 struct mlx5_exp_ib_create_qp_resp_data {
274 __u32 comp_mask; /* use mlx5_exp_ib_create_qp_resp_mask */
275 __u32 flags; /* use mlx5_exp_create_qp_resp_flags */
278 struct mlx5_exp_ib_create_qp_resp {
282 /* Some more reserved fields for future growth of mlx5_ib_create_qp_resp */
283 __u64 prefix_reserved[8];
285 /* sizeof prefix aligned with mlx5_ib_create_qp_resp */
286 __u64 size_of_prefix;
289 * Add new experimental data only inside the exp struct
291 struct mlx5_exp_ib_create_qp_resp_data exp;
294 struct mlx5_ib_create_dct {
299 struct mlx5_ib_arm_dct {
304 struct mlx5_ib_arm_dct_resp {
309 struct mlx5_ib_create_wq {
318 #endif /* MLX5_IB_USER_H */