2 * Copyright (c) 2012 Mellanox Technologies, Inc. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36 #include <infiniband/kern-abi.h>
37 #include <infiniband/verbs.h>
40 #define MLX5_UVERBS_MIN_ABI_VERSION 1
41 #define MLX5_UVERBS_MAX_ABI_VERSION 1
44 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
45 MLX5_QP_FLAG_SCATTER_CQE = 1 << 1,
49 MLX5_RWQ_FLAG_SIGNATURE = 1 << 0,
53 MLX5_NUM_NON_FP_BFREGS_PER_UAR = 2,
54 NUM_BFREGS_PER_UAR = 4,
55 MLX5_MAX_UARS = 1 << 8,
56 MLX5_MAX_BFREGS = MLX5_MAX_UARS * MLX5_NUM_NON_FP_BFREGS_PER_UAR,
57 MLX5_DEF_TOT_UUARS = 8 * MLX5_NUM_NON_FP_BFREGS_PER_UAR,
58 MLX5_MED_BFREGS_TSHOLD = 12,
62 MLX5_LIB_CAP_4K_UAR = 1 << 0,
65 struct mlx5_alloc_ucontext {
66 struct ibv_get_context ibv_req;
67 __u32 total_num_uuars;
68 __u32 num_low_latency_uuars;
78 enum mlx5_ib_alloc_ucontext_resp_mask {
79 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
82 struct mlx5_alloc_ucontext_resp {
83 struct ibv_get_context_resp ibv_resp;
87 __u32 cache_line_size;
92 __u32 max_srq_recv_wr;
96 __u32 response_length;
100 __u64 hca_core_clock_offset;
102 __u32 num_uars_per_page;
105 struct mlx5_create_ah_resp {
106 struct ibv_create_ah_resp ibv_resp;
107 __u32 response_length;
108 __u8 dmac[ETHERNET_LL_SIZE];
112 struct mlx5_alloc_pd_resp {
113 struct ibv_alloc_pd_resp ibv_resp;
117 struct mlx5_create_cq {
118 struct ibv_create_cq ibv_cmd;
123 __u8 cqe_comp_res_format;
127 struct mlx5_create_cq_resp {
128 struct ibv_create_cq_resp ibv_resp;
132 struct mlx5_create_srq {
133 struct ibv_create_srq ibv_cmd;
139 struct mlx5_create_srq_resp {
140 struct ibv_create_srq_resp ibv_resp;
145 struct mlx5_create_srq_ex {
146 struct ibv_create_xsrq ibv_cmd;
155 struct mlx5_create_qp_drv_ex {
164 /* SQ buffer address - used for Raw Packet QP */
168 struct mlx5_create_qp_ex {
169 struct ibv_create_qp_ex ibv_cmd;
170 struct mlx5_create_qp_drv_ex drv_ex;
173 struct mlx5_create_qp_ex_rss {
174 struct ibv_create_qp_ex ibv_cmd;
175 __u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */
176 __u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */
179 __u8 rx_hash_key[128];
184 struct mlx5_create_qp_resp_ex {
185 struct ibv_create_qp_resp_ex ibv_resp;
190 struct mlx5_create_qp {
191 struct ibv_create_qp ibv_cmd;
200 /* SQ buffer address - used for Raw Packet QP */
204 struct mlx5_create_qp_resp {
205 struct ibv_create_qp_resp ibv_resp;
209 struct mlx5_drv_create_wq {
220 struct mlx5_create_wq {
221 struct ibv_create_wq ibv_cmd;
222 struct mlx5_drv_create_wq drv;
225 struct mlx5_create_wq_resp {
226 struct ibv_create_wq_resp ibv_resp;
227 __u32 response_length;
231 struct mlx5_modify_wq {
232 struct ibv_modify_wq ibv_cmd;
237 struct mlx5_create_rwq_ind_table_resp {
238 struct ibv_create_rwq_ind_table_resp ibv_resp;
241 struct mlx5_destroy_rwq_ind_table {
242 struct ibv_destroy_rwq_ind_table ibv_cmd;
245 struct mlx5_resize_cq {
246 struct ibv_resize_cq ibv_cmd;
253 struct mlx5_resize_cq_resp {
254 struct ibv_resize_cq_resp ibv_resp;
257 struct mlx5_query_device_ex {
258 struct ibv_query_device_ex ibv_cmd;
261 struct mlx5_reserved_tso_caps {
265 struct mlx5_rss_caps {
266 __u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */
267 __u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */
271 struct mlx5_packet_pacing_caps {
272 struct ibv_packet_pacing_caps caps;
276 struct mlx5_query_device_ex_resp {
277 struct ibv_query_device_resp_ex ibv_resp;
279 __u32 response_length;
280 struct ibv_tso_caps tso_caps;
281 struct mlx5_rss_caps rss_caps; /* vendor data channel */
282 struct mlx5dv_cqe_comp_caps cqe_comp_caps;
283 struct mlx5_packet_pacing_caps packet_pacing_caps;
284 __u32 support_multi_pkt_send_wqe;
288 #endif /* MLX5_ABI_H */