xref: /linux/include/uapi/rdma/mlx5-abi.h (revision 353b7a55dcaf5fb8758e09ebe2ddf5f3adbac7c5)
1d50e14abSJason Gunthorpe /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2e126ba97SEli Cohen /*
36cf0a15fSSaeed Mahameed  * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
4e126ba97SEli Cohen  *
5e126ba97SEli Cohen  * This software is available to you under a choice of one of two
6e126ba97SEli Cohen  * licenses.  You may choose to be licensed under the terms of the GNU
7e126ba97SEli Cohen  * General Public License (GPL) Version 2, available from the file
8e126ba97SEli Cohen  * COPYING in the main directory of this source tree, or the
9e126ba97SEli Cohen  * OpenIB.org BSD license below:
10e126ba97SEli Cohen  *
11e126ba97SEli Cohen  *     Redistribution and use in source and binary forms, with or
12e126ba97SEli Cohen  *     without modification, are permitted provided that the following
13e126ba97SEli Cohen  *     conditions are met:
14e126ba97SEli Cohen  *
15e126ba97SEli Cohen  *      - Redistributions of source code must retain the above
16e126ba97SEli Cohen  *        copyright notice, this list of conditions and the following
17e126ba97SEli Cohen  *        disclaimer.
18e126ba97SEli Cohen  *
19e126ba97SEli Cohen  *      - Redistributions in binary form must reproduce the above
20e126ba97SEli Cohen  *        copyright notice, this list of conditions and the following
21e126ba97SEli Cohen  *        disclaimer in the documentation and/or other materials
22e126ba97SEli Cohen  *        provided with the distribution.
23e126ba97SEli Cohen  *
24e126ba97SEli Cohen  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25e126ba97SEli Cohen  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26e126ba97SEli Cohen  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27e126ba97SEli Cohen  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28e126ba97SEli Cohen  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29e126ba97SEli Cohen  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30e126ba97SEli Cohen  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31e126ba97SEli Cohen  * SOFTWARE.
32e126ba97SEli Cohen  */
33e126ba97SEli Cohen 
343085e29eSLeon Romanovsky #ifndef MLX5_ABI_USER_H
353085e29eSLeon Romanovsky #define MLX5_ABI_USER_H
36e126ba97SEli Cohen 
37e126ba97SEli Cohen #include <linux/types.h>
38812755d6SDmitry V. Levin #include <linux/if_ether.h>	/* For ETH_ALEN. */
393b3233fbSRaed Salem #include <rdma/ib_user_ioctl_verbs.h>
40e126ba97SEli Cohen 
41e126ba97SEli Cohen enum {
42e126ba97SEli Cohen 	MLX5_QP_FLAG_SIGNATURE		= 1 << 0,
43e126ba97SEli Cohen 	MLX5_QP_FLAG_SCATTER_CQE	= 1 << 1,
44f95ef6cbSMaor Gottlieb 	MLX5_QP_FLAG_TUNNEL_OFFLOADS	= 1 << 2,
451ee47ab3SYishai Hadas 	MLX5_QP_FLAG_BFREG_INDEX	= 1 << 3,
46b4aaa1f0SMoni Shoua 	MLX5_QP_FLAG_TYPE_DCT		= 1 << 4,
47b4aaa1f0SMoni Shoua 	MLX5_QP_FLAG_TYPE_DCI		= 1 << 5,
48175edba8SMark Bloch 	MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
49175edba8SMark Bloch 	MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
506f4bc0eaSYonatan Cohen 	MLX5_QP_FLAG_ALLOW_SCATTER_CQE	= 1 << 8,
51569c6651SDanit Goldberg 	MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE	= 1 << 9,
52ac42a5eeSYishai Hadas 	MLX5_QP_FLAG_UAR_PAGE_INDEX = 1 << 10,
53e126ba97SEli Cohen };
54e126ba97SEli Cohen 
55e126ba97SEli Cohen enum {
56e126ba97SEli Cohen 	MLX5_SRQ_FLAG_SIGNATURE		= 1 << 0,
57e126ba97SEli Cohen };
58e126ba97SEli Cohen 
5979b20a6cSYishai Hadas enum {
6079b20a6cSYishai Hadas 	MLX5_WQ_FLAG_SIGNATURE		= 1 << 0,
6179b20a6cSYishai Hadas };
6279b20a6cSYishai Hadas 
63e126ba97SEli Cohen /* Increment this value if any changes that break userspace ABI
64e126ba97SEli Cohen  * compatibility are made.
65e126ba97SEli Cohen  */
66e126ba97SEli Cohen #define MLX5_IB_UVERBS_ABI_VERSION	1
67e126ba97SEli Cohen 
68e126ba97SEli Cohen /* Make sure that all structs defined in this file remain laid out so
69e126ba97SEli Cohen  * that they pack the same way on 32-bit and 64-bit architectures (to
70e126ba97SEli Cohen  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
71e126ba97SEli Cohen  * In particular do not use pointer types -- pass pointers in __u64
72e126ba97SEli Cohen  * instead.
73e126ba97SEli Cohen  */
74e126ba97SEli Cohen 
75e126ba97SEli Cohen struct mlx5_ib_alloc_ucontext_req {
762f5ff264SEli Cohen 	__u32	total_num_bfregs;
772f5ff264SEli Cohen 	__u32	num_low_latency_bfregs;
78e126ba97SEli Cohen };
79e126ba97SEli Cohen 
8030aa60b3SEli Cohen enum mlx5_lib_caps {
81812755d6SDmitry V. Levin 	MLX5_LIB_CAP_4K_UAR	= (__u64)1 << 0,
820a2fd01cSYishai Hadas 	MLX5_LIB_CAP_DYN_UAR	= (__u64)1 << 1,
8330aa60b3SEli Cohen };
8430aa60b3SEli Cohen 
85a8b92ca1SYishai Hadas enum mlx5_ib_alloc_uctx_v2_flags {
86a8b92ca1SYishai Hadas 	MLX5_IB_ALLOC_UCTX_DEVX	= 1 << 0,
87a8b92ca1SYishai Hadas };
8878c0f98cSEli Cohen struct mlx5_ib_alloc_ucontext_req_v2 {
892f5ff264SEli Cohen 	__u32	total_num_bfregs;
902f5ff264SEli Cohen 	__u32	num_low_latency_bfregs;
9178c0f98cSEli Cohen 	__u32	flags;
92b368d7cbSMatan Barak 	__u32	comp_mask;
93f72300c5SHaggai Abramovsky 	__u8	max_cqe_version;
94f72300c5SHaggai Abramovsky 	__u8	reserved0;
95f72300c5SHaggai Abramovsky 	__u16	reserved1;
96f72300c5SHaggai Abramovsky 	__u32	reserved2;
9726b99066SJason Gunthorpe 	__aligned_u64 lib_caps;
98b368d7cbSMatan Barak };
99b368d7cbSMatan Barak 
100b368d7cbSMatan Barak enum mlx5_ib_alloc_ucontext_resp_mask {
101b368d7cbSMatan Barak 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
10225bb36e7SYonatan Cohen 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY    = 1UL << 1,
1035f62a521SLeon Romanovsky 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE               = 1UL << 2,
104c906b86eSSergey Gorenko 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS           = 1UL << 3,
105*33652951SAharon Landau 	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS	   = 1UL << 4,
10678c0f98cSEli Cohen };
10778c0f98cSEli Cohen 
108402ca536SBodong Wang enum mlx5_user_cmds_supp_uhw {
109402ca536SBodong Wang 	MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0,
1106ad279c5SMoni Shoua 	MLX5_USER_CMDS_SUPP_UHW_CREATE_AH    = 1 << 1,
111402ca536SBodong Wang };
112402ca536SBodong Wang 
11378984898SOr Gerlitz /* The eth_min_inline response value is set to off-by-one vs the FW
11478984898SOr Gerlitz  * returned value to allow user-space to deal with older kernels.
11578984898SOr Gerlitz  */
11678984898SOr Gerlitz enum mlx5_user_inline_mode {
11778984898SOr Gerlitz 	MLX5_USER_INLINE_MODE_NA,
11878984898SOr Gerlitz 	MLX5_USER_INLINE_MODE_NONE,
11978984898SOr Gerlitz 	MLX5_USER_INLINE_MODE_L2,
12078984898SOr Gerlitz 	MLX5_USER_INLINE_MODE_IP,
12178984898SOr Gerlitz 	MLX5_USER_INLINE_MODE_TCP_UDP,
12278984898SOr Gerlitz };
12378984898SOr Gerlitz 
124c03faa56SMatan Barak enum {
125c03faa56SMatan Barak 	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM = 1 << 0,
126c03faa56SMatan Barak 	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_REQ_METADATA = 1 << 1,
127c03faa56SMatan Barak 	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_SPI_STEERING = 1 << 2,
128c03faa56SMatan Barak 	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_FULL_OFFLOAD = 1 << 3,
129c03faa56SMatan Barak 	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_TX_IV_IS_ESN = 1 << 4,
130c03faa56SMatan Barak };
131c03faa56SMatan Barak 
132e126ba97SEli Cohen struct mlx5_ib_alloc_ucontext_resp {
133e126ba97SEli Cohen 	__u32	qp_tab_size;
134e126ba97SEli Cohen 	__u32	bf_reg_size;
1352f5ff264SEli Cohen 	__u32	tot_bfregs;
136e126ba97SEli Cohen 	__u32	cache_line_size;
137e126ba97SEli Cohen 	__u16	max_sq_desc_sz;
138e126ba97SEli Cohen 	__u16	max_rq_desc_sz;
139e126ba97SEli Cohen 	__u32	max_send_wqebb;
140e126ba97SEli Cohen 	__u32	max_recv_wr;
141e126ba97SEli Cohen 	__u32	max_srq_recv_wr;
142e126ba97SEli Cohen 	__u16	num_ports;
143c03faa56SMatan Barak 	__u16	flow_action_flags;
144b368d7cbSMatan Barak 	__u32	comp_mask;
145b368d7cbSMatan Barak 	__u32	response_length;
146f72300c5SHaggai Abramovsky 	__u8	cqe_version;
147402ca536SBodong Wang 	__u8	cmds_supp_uhw;
14878984898SOr Gerlitz 	__u8	eth_min_inline;
1495c99eaecSFeras Daoud 	__u8	clock_info_versions;
15026b99066SJason Gunthorpe 	__aligned_u64 hca_core_clock_offset;
15130aa60b3SEli Cohen 	__u32	log_uar_size;
15230aa60b3SEli Cohen 	__u32	num_uars_per_page;
15331a78a5aSYishai Hadas 	__u32	num_dyn_bfregs;
15425bb36e7SYonatan Cohen 	__u32	dump_fill_mkey;
155e126ba97SEli Cohen };
156e126ba97SEli Cohen 
157e126ba97SEli Cohen struct mlx5_ib_alloc_pd_resp {
158e126ba97SEli Cohen 	__u32	pdn;
159e126ba97SEli Cohen };
160e126ba97SEli Cohen 
161402ca536SBodong Wang struct mlx5_ib_tso_caps {
162402ca536SBodong Wang 	__u32 max_tso; /* Maximum tso payload size in bytes */
163402ca536SBodong Wang 
164402ca536SBodong Wang 	/* Corresponding bit will be set if qp type from
165402ca536SBodong Wang 	 * 'enum ib_qp_type' is supported, e.g.
166402ca536SBodong Wang 	 * supported_qpts |= 1 << IB_QPT_UD
167402ca536SBodong Wang 	 */
168402ca536SBodong Wang 	__u32 supported_qpts;
169402ca536SBodong Wang };
170402ca536SBodong Wang 
17131f69a82SYishai Hadas struct mlx5_ib_rss_caps {
17226b99066SJason Gunthorpe 	__aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
17331f69a82SYishai Hadas 	__u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
17431f69a82SYishai Hadas 	__u8 reserved[7];
17531f69a82SYishai Hadas };
17631f69a82SYishai Hadas 
1777e43a2a5SBodong Wang enum mlx5_ib_cqe_comp_res_format {
1787e43a2a5SBodong Wang 	MLX5_IB_CQE_RES_FORMAT_HASH	= 1 << 0,
1797e43a2a5SBodong Wang 	MLX5_IB_CQE_RES_FORMAT_CSUM	= 1 << 1,
1806f1006a4SYonatan Cohen 	MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2,
1817e43a2a5SBodong Wang };
1827e43a2a5SBodong Wang 
1837e43a2a5SBodong Wang struct mlx5_ib_cqe_comp_caps {
1847e43a2a5SBodong Wang 	__u32 max_num;
1857e43a2a5SBodong Wang 	__u32 supported_format; /* enum mlx5_ib_cqe_comp_res_format */
1867e43a2a5SBodong Wang };
1877e43a2a5SBodong Wang 
18861147f39SBodong Wang enum mlx5_ib_packet_pacing_cap_flags {
18961147f39SBodong Wang 	MLX5_IB_PP_SUPPORT_BURST	= 1 << 0,
19061147f39SBodong Wang };
19161147f39SBodong Wang 
192d949167dSBodong Wang struct mlx5_packet_pacing_caps {
193d949167dSBodong Wang 	__u32 qp_rate_limit_min;
194d949167dSBodong Wang 	__u32 qp_rate_limit_max; /* In kpbs */
195d949167dSBodong Wang 
196d949167dSBodong Wang 	/* Corresponding bit will be set if qp type from
197d949167dSBodong Wang 	 * 'enum ib_qp_type' is supported, e.g.
198d949167dSBodong Wang 	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
199d949167dSBodong Wang 	 */
200d949167dSBodong Wang 	__u32 supported_qpts;
20161147f39SBodong Wang 	__u8  cap_flags; /* enum mlx5_ib_packet_pacing_cap_flags */
20261147f39SBodong Wang 	__u8  reserved[3];
203d949167dSBodong Wang };
204d949167dSBodong Wang 
205795b609cSBodong Wang enum mlx5_ib_mpw_caps {
206795b609cSBodong Wang 	MPW_RESERVED		= 1 << 0,
207795b609cSBodong Wang 	MLX5_IB_ALLOW_MPW	= 1 << 1,
208050da902SBodong Wang 	MLX5_IB_SUPPORT_EMPW	= 1 << 2,
209795b609cSBodong Wang };
210795b609cSBodong Wang 
21196dc3fc5SNoa Osherovich enum mlx5_ib_sw_parsing_offloads {
21296dc3fc5SNoa Osherovich 	MLX5_IB_SW_PARSING = 1 << 0,
21396dc3fc5SNoa Osherovich 	MLX5_IB_SW_PARSING_CSUM = 1 << 1,
21496dc3fc5SNoa Osherovich 	MLX5_IB_SW_PARSING_LSO = 1 << 2,
21596dc3fc5SNoa Osherovich };
21696dc3fc5SNoa Osherovich 
21796dc3fc5SNoa Osherovich struct mlx5_ib_sw_parsing_caps {
21896dc3fc5SNoa Osherovich 	__u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */
21996dc3fc5SNoa Osherovich 
22096dc3fc5SNoa Osherovich 	/* Corresponding bit will be set if qp type from
22196dc3fc5SNoa Osherovich 	 * 'enum ib_qp_type' is supported, e.g.
22296dc3fc5SNoa Osherovich 	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
22396dc3fc5SNoa Osherovich 	 */
22496dc3fc5SNoa Osherovich 	__u32 supported_qpts;
22596dc3fc5SNoa Osherovich };
22696dc3fc5SNoa Osherovich 
227b4f34597SNoa Osherovich struct mlx5_ib_striding_rq_caps {
228b4f34597SNoa Osherovich 	__u32 min_single_stride_log_num_of_bytes;
229b4f34597SNoa Osherovich 	__u32 max_single_stride_log_num_of_bytes;
230b4f34597SNoa Osherovich 	__u32 min_single_wqe_log_num_of_strides;
231b4f34597SNoa Osherovich 	__u32 max_single_wqe_log_num_of_strides;
232b4f34597SNoa Osherovich 
233b4f34597SNoa Osherovich 	/* Corresponding bit will be set if qp type from
234b4f34597SNoa Osherovich 	 * 'enum ib_qp_type' is supported, e.g.
235b4f34597SNoa Osherovich 	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
236b4f34597SNoa Osherovich 	 */
237b4f34597SNoa Osherovich 	__u32 supported_qpts;
238f17966f1SNoa Osherovich 	__u32 reserved;
239b4f34597SNoa Osherovich };
240b4f34597SNoa Osherovich 
241de57f2adSGuy Levi enum mlx5_ib_query_dev_resp_flags {
242de57f2adSGuy Levi 	/* Support 128B CQE compression */
243de57f2adSGuy Levi 	MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
2447a0c8f42SGuy Levi 	MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD  = 1 << 1,
2457e11b911SDanit Goldberg 	MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,
2467249c8eaSGuy Levi 	MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3,
247de57f2adSGuy Levi };
248de57f2adSGuy Levi 
249f95ef6cbSMaor Gottlieb enum mlx5_ib_tunnel_offloads {
250f95ef6cbSMaor Gottlieb 	MLX5_IB_TUNNELED_OFFLOADS_VXLAN  = 1 << 0,
251f95ef6cbSMaor Gottlieb 	MLX5_IB_TUNNELED_OFFLOADS_GRE    = 1 << 1,
252e818e255SAriel Levkovich 	MLX5_IB_TUNNELED_OFFLOADS_GENEVE = 1 << 2,
253e818e255SAriel Levkovich 	MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE = 1 << 3,
254e818e255SAriel Levkovich 	MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP = 1 << 4,
255f95ef6cbSMaor Gottlieb };
256f95ef6cbSMaor Gottlieb 
257402ca536SBodong Wang struct mlx5_ib_query_device_resp {
258402ca536SBodong Wang 	__u32	comp_mask;
259402ca536SBodong Wang 	__u32	response_length;
260402ca536SBodong Wang 	struct	mlx5_ib_tso_caps tso_caps;
26131f69a82SYishai Hadas 	struct	mlx5_ib_rss_caps rss_caps;
2627e43a2a5SBodong Wang 	struct	mlx5_ib_cqe_comp_caps cqe_comp_caps;
263d949167dSBodong Wang 	struct	mlx5_packet_pacing_caps packet_pacing_caps;
264191ded4aSBodong Wang 	__u32	mlx5_ib_support_multi_pkt_send_wqes;
265de57f2adSGuy Levi 	__u32	flags; /* Use enum mlx5_ib_query_dev_resp_flags */
26696dc3fc5SNoa Osherovich 	struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
267b4f34597SNoa Osherovich 	struct mlx5_ib_striding_rq_caps striding_rq_caps;
268f95ef6cbSMaor Gottlieb 	__u32	tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */
269f95ef6cbSMaor Gottlieb 	__u32	reserved;
270402ca536SBodong Wang };
271402ca536SBodong Wang 
2727a0c8f42SGuy Levi enum mlx5_ib_create_cq_flags {
2737a0c8f42SGuy Levi 	MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD	= 1 << 0,
27464d99f6aSYishai Hadas 	MLX5_IB_CREATE_CQ_FLAGS_UAR_PAGE_INDEX  = 1 << 1,
275*33652951SAharon Landau 	MLX5_IB_CREATE_CQ_FLAGS_REAL_TIME_TS	= 1 << 2,
276e126ba97SEli Cohen };
277e126ba97SEli Cohen 
278e126ba97SEli Cohen struct mlx5_ib_create_cq {
27926b99066SJason Gunthorpe 	__aligned_u64 buf_addr;
28026b99066SJason Gunthorpe 	__aligned_u64 db_addr;
281e126ba97SEli Cohen 	__u32	cqe_size;
2821cbe6fc8SBodong Wang 	__u8    cqe_comp_en;
2831cbe6fc8SBodong Wang 	__u8    cqe_comp_res_format;
2847a0c8f42SGuy Levi 	__u16	flags;
28564d99f6aSYishai Hadas 	__u16	uar_page_index;
28664d99f6aSYishai Hadas 	__u16	reserved0;
28764d99f6aSYishai Hadas 	__u32	reserved1;
288e126ba97SEli Cohen };
289e126ba97SEli Cohen 
290e126ba97SEli Cohen struct mlx5_ib_create_cq_resp {
291e126ba97SEli Cohen 	__u32	cqn;
292e126ba97SEli Cohen 	__u32	reserved;
293e126ba97SEli Cohen };
294e126ba97SEli Cohen 
295e126ba97SEli Cohen struct mlx5_ib_resize_cq {
29626b99066SJason Gunthorpe 	__aligned_u64 buf_addr;
297e126ba97SEli Cohen 	__u16	cqe_size;
298e126ba97SEli Cohen 	__u16	reserved0;
299e126ba97SEli Cohen 	__u32	reserved1;
300e126ba97SEli Cohen };
301e126ba97SEli Cohen 
302e126ba97SEli Cohen struct mlx5_ib_create_srq {
30326b99066SJason Gunthorpe 	__aligned_u64 buf_addr;
30426b99066SJason Gunthorpe 	__aligned_u64 db_addr;
305e126ba97SEli Cohen 	__u32	flags;
306cfb5e088SHaggai Abramovsky 	__u32	reserved0; /* explicit padding (optional on i386) */
307cfb5e088SHaggai Abramovsky 	__u32	uidx;
308cfb5e088SHaggai Abramovsky 	__u32	reserved1;
309e126ba97SEli Cohen };
310e126ba97SEli Cohen 
311e126ba97SEli Cohen struct mlx5_ib_create_srq_resp {
312e126ba97SEli Cohen 	__u32	srqn;
313e126ba97SEli Cohen 	__u32	reserved;
314e126ba97SEli Cohen };
315e126ba97SEli Cohen 
316e126ba97SEli Cohen struct mlx5_ib_create_qp {
31726b99066SJason Gunthorpe 	__aligned_u64 buf_addr;
31826b99066SJason Gunthorpe 	__aligned_u64 db_addr;
319e126ba97SEli Cohen 	__u32	sq_wqe_count;
320e126ba97SEli Cohen 	__u32	rq_wqe_count;
321e126ba97SEli Cohen 	__u32	rq_wqe_shift;
322e126ba97SEli Cohen 	__u32	flags;
323cfb5e088SHaggai Abramovsky 	__u32	uidx;
3241ee47ab3SYishai Hadas 	__u32	bfreg_index;
325b4aaa1f0SMoni Shoua 	union {
32626b99066SJason Gunthorpe 		__aligned_u64 sq_buf_addr;
32726b99066SJason Gunthorpe 		__aligned_u64 access_key;
328b4aaa1f0SMoni Shoua 	};
329e383085cSLeon Romanovsky 	__u32  ece_options;
330e383085cSLeon Romanovsky 	__u32  reserved;
331e126ba97SEli Cohen };
332e126ba97SEli Cohen 
33328d61370SYishai Hadas /* RX Hash function flags */
33428d61370SYishai Hadas enum mlx5_rx_hash_function_flags {
33528d61370SYishai Hadas 	MLX5_RX_HASH_FUNC_TOEPLITZ	= 1 << 0,
33628d61370SYishai Hadas };
33728d61370SYishai Hadas 
33828d61370SYishai Hadas /*
33928d61370SYishai Hadas  * RX Hash flags, these flags allows to set which incoming packet's field should
34028d61370SYishai Hadas  * participates in RX Hash. Each flag represent certain packet's field,
34128d61370SYishai Hadas  * when the flag is set the field that is represented by the flag will
34228d61370SYishai Hadas  * participate in RX Hash calculation.
34328d61370SYishai Hadas  * Note: *IPV4 and *IPV6 flags can't be enabled together on the same QP
34428d61370SYishai Hadas  * and *TCP and *UDP flags can't be enabled together on the same QP.
34528d61370SYishai Hadas */
34628d61370SYishai Hadas enum mlx5_rx_hash_fields {
34728d61370SYishai Hadas 	MLX5_RX_HASH_SRC_IPV4	= 1 << 0,
34828d61370SYishai Hadas 	MLX5_RX_HASH_DST_IPV4	= 1 << 1,
34928d61370SYishai Hadas 	MLX5_RX_HASH_SRC_IPV6	= 1 << 2,
35028d61370SYishai Hadas 	MLX5_RX_HASH_DST_IPV6	= 1 << 3,
35128d61370SYishai Hadas 	MLX5_RX_HASH_SRC_PORT_TCP	= 1 << 4,
35228d61370SYishai Hadas 	MLX5_RX_HASH_DST_PORT_TCP	= 1 << 5,
35328d61370SYishai Hadas 	MLX5_RX_HASH_SRC_PORT_UDP	= 1 << 6,
354309fa347SMaor Gottlieb 	MLX5_RX_HASH_DST_PORT_UDP	= 1 << 7,
3552d93fc85SMatan Barak 	MLX5_RX_HASH_IPSEC_SPI		= 1 << 8,
356309fa347SMaor Gottlieb 	/* Save bits for future fields */
3574e2b53a5SMaor Gottlieb 	MLX5_RX_HASH_INNER		= (1UL << 31),
35828d61370SYishai Hadas };
35928d61370SYishai Hadas 
36028d61370SYishai Hadas struct mlx5_ib_create_qp_rss {
36126b99066SJason Gunthorpe 	__aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
36228d61370SYishai Hadas 	__u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
36328d61370SYishai Hadas 	__u8 rx_key_len; /* valid only for Toeplitz */
36428d61370SYishai Hadas 	__u8 reserved[6];
36528d61370SYishai Hadas 	__u8 rx_hash_key[128]; /* valid only for Toeplitz */
36628d61370SYishai Hadas 	__u32   comp_mask;
367f95ef6cbSMaor Gottlieb 	__u32	flags;
36828d61370SYishai Hadas };
36928d61370SYishai Hadas 
3707f72052cSYishai Hadas enum mlx5_ib_create_qp_resp_mask {
3717f72052cSYishai Hadas 	MLX5_IB_CREATE_QP_RESP_MASK_TIRN = 1UL << 0,
3727f72052cSYishai Hadas 	MLX5_IB_CREATE_QP_RESP_MASK_TISN = 1UL << 1,
3737f72052cSYishai Hadas 	MLX5_IB_CREATE_QP_RESP_MASK_RQN  = 1UL << 2,
3747f72052cSYishai Hadas 	MLX5_IB_CREATE_QP_RESP_MASK_SQN  = 1UL << 3,
3751f1d6abbSAriel Levkovich 	MLX5_IB_CREATE_QP_RESP_MASK_TIR_ICM_ADDR  = 1UL << 4,
3767f72052cSYishai Hadas };
3777f72052cSYishai Hadas 
378e126ba97SEli Cohen struct mlx5_ib_create_qp_resp {
3792f5ff264SEli Cohen 	__u32	bfreg_index;
3803e09a427SLeon Romanovsky 	__u32   ece_options;
3817f72052cSYishai Hadas 	__u32	comp_mask;
3827f72052cSYishai Hadas 	__u32	tirn;
3837f72052cSYishai Hadas 	__u32	tisn;
3847f72052cSYishai Hadas 	__u32	rqn;
3857f72052cSYishai Hadas 	__u32	sqn;
3867f72052cSYishai Hadas 	__u32   reserved1;
3871f1d6abbSAriel Levkovich 	__u64	tir_icm_addr;
388e126ba97SEli Cohen };
389cfb5e088SHaggai Abramovsky 
390d2370e0aSMatan Barak struct mlx5_ib_alloc_mw {
391d2370e0aSMatan Barak 	__u32	comp_mask;
392d2370e0aSMatan Barak 	__u8	num_klms;
393d2370e0aSMatan Barak 	__u8	reserved1;
394d2370e0aSMatan Barak 	__u16	reserved2;
395d2370e0aSMatan Barak };
396d2370e0aSMatan Barak 
397ccc87087SNoa Osherovich enum mlx5_ib_create_wq_mask {
398ccc87087SNoa Osherovich 	MLX5_IB_CREATE_WQ_STRIDING_RQ	= (1 << 0),
399ccc87087SNoa Osherovich };
400ccc87087SNoa Osherovich 
40179b20a6cSYishai Hadas struct mlx5_ib_create_wq {
40226b99066SJason Gunthorpe 	__aligned_u64 buf_addr;
40326b99066SJason Gunthorpe 	__aligned_u64 db_addr;
40479b20a6cSYishai Hadas 	__u32   rq_wqe_count;
40579b20a6cSYishai Hadas 	__u32   rq_wqe_shift;
40679b20a6cSYishai Hadas 	__u32   user_index;
40779b20a6cSYishai Hadas 	__u32   flags;
40879b20a6cSYishai Hadas 	__u32   comp_mask;
409ccc87087SNoa Osherovich 	__u32	single_stride_log_num_of_bytes;
410ccc87087SNoa Osherovich 	__u32	single_wqe_log_num_of_strides;
411ccc87087SNoa Osherovich 	__u32	two_byte_shift_en;
41279b20a6cSYishai Hadas };
41379b20a6cSYishai Hadas 
4145097e71fSMoni Shoua struct mlx5_ib_create_ah_resp {
4155097e71fSMoni Shoua 	__u32	response_length;
4165097e71fSMoni Shoua 	__u8	dmac[ETH_ALEN];
4175097e71fSMoni Shoua 	__u8	reserved[6];
4185097e71fSMoni Shoua };
4195097e71fSMoni Shoua 
42061147f39SBodong Wang struct mlx5_ib_burst_info {
42161147f39SBodong Wang 	__u32       max_burst_sz;
42261147f39SBodong Wang 	__u16       typical_pkt_sz;
42361147f39SBodong Wang 	__u16       reserved;
42461147f39SBodong Wang };
42561147f39SBodong Wang 
42661147f39SBodong Wang struct mlx5_ib_modify_qp {
42761147f39SBodong Wang 	__u32			   comp_mask;
42861147f39SBodong Wang 	struct mlx5_ib_burst_info  burst_info;
4295f62a521SLeon Romanovsky 	__u32			   ece_options;
43061147f39SBodong Wang };
43161147f39SBodong Wang 
432776a3906SMoni Shoua struct mlx5_ib_modify_qp_resp {
433776a3906SMoni Shoua 	__u32	response_length;
434776a3906SMoni Shoua 	__u32	dctn;
43550aec2c3SLeon Romanovsky 	__u32   ece_options;
43650aec2c3SLeon Romanovsky 	__u32   reserved;
437776a3906SMoni Shoua };
438776a3906SMoni Shoua 
43979b20a6cSYishai Hadas struct mlx5_ib_create_wq_resp {
44079b20a6cSYishai Hadas 	__u32	response_length;
44179b20a6cSYishai Hadas 	__u32	reserved;
44279b20a6cSYishai Hadas };
44379b20a6cSYishai Hadas 
444c5f90929SYishai Hadas struct mlx5_ib_create_rwq_ind_tbl_resp {
445c5f90929SYishai Hadas 	__u32	response_length;
446c5f90929SYishai Hadas 	__u32	reserved;
447c5f90929SYishai Hadas };
448c5f90929SYishai Hadas 
44979b20a6cSYishai Hadas struct mlx5_ib_modify_wq {
45079b20a6cSYishai Hadas 	__u32	comp_mask;
45179b20a6cSYishai Hadas 	__u32	reserved;
45279b20a6cSYishai Hadas };
45324d33d2cSFeras Daoud 
45424d33d2cSFeras Daoud struct mlx5_ib_clock_info {
45524d33d2cSFeras Daoud 	__u32 sign;
45624d33d2cSFeras Daoud 	__u32 resv;
45726b99066SJason Gunthorpe 	__aligned_u64 nsec;
45826b99066SJason Gunthorpe 	__aligned_u64 cycles;
45926b99066SJason Gunthorpe 	__aligned_u64 frac;
46024d33d2cSFeras Daoud 	__u32 mult;
46124d33d2cSFeras Daoud 	__u32 shift;
46226b99066SJason Gunthorpe 	__aligned_u64 mask;
46326b99066SJason Gunthorpe 	__aligned_u64 overflow_period;
46424d33d2cSFeras Daoud };
46524d33d2cSFeras Daoud 
4665c99eaecSFeras Daoud enum mlx5_ib_mmap_cmd {
4675c99eaecSFeras Daoud 	MLX5_IB_MMAP_REGULAR_PAGE               = 0,
4685c99eaecSFeras Daoud 	MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES       = 1,
4695c99eaecSFeras Daoud 	MLX5_IB_MMAP_WC_PAGE                    = 2,
4705c99eaecSFeras Daoud 	MLX5_IB_MMAP_NC_PAGE                    = 3,
4715c99eaecSFeras Daoud 	/* 5 is chosen in order to be compatible with old versions of libmlx5 */
4725c99eaecSFeras Daoud 	MLX5_IB_MMAP_CORE_CLOCK                 = 5,
4735c99eaecSFeras Daoud 	MLX5_IB_MMAP_ALLOC_WC                   = 6,
4745c99eaecSFeras Daoud 	MLX5_IB_MMAP_CLOCK_INFO                 = 7,
47524da0016SAriel Levkovich 	MLX5_IB_MMAP_DEVICE_MEM                 = 8,
4765c99eaecSFeras Daoud };
4775c99eaecSFeras Daoud 
47824d33d2cSFeras Daoud enum {
47924d33d2cSFeras Daoud 	MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1,
48024d33d2cSFeras Daoud };
4815c99eaecSFeras Daoud 
4825c99eaecSFeras Daoud /* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */
4835c99eaecSFeras Daoud enum {
4845c99eaecSFeras Daoud 	MLX5_IB_CLOCK_INFO_V1              = 0,
4855c99eaecSFeras Daoud };
4863b3233fbSRaed Salem 
4873b3233fbSRaed Salem struct mlx5_ib_flow_counters_desc {
4883b3233fbSRaed Salem 	__u32	description;
4893b3233fbSRaed Salem 	__u32	index;
4903b3233fbSRaed Salem };
4913b3233fbSRaed Salem 
4923b3233fbSRaed Salem struct mlx5_ib_flow_counters_data {
4933b3233fbSRaed Salem 	RDMA_UAPI_PTR(struct mlx5_ib_flow_counters_desc *, counters_data);
4943b3233fbSRaed Salem 	__u32   ncounters;
4953b3233fbSRaed Salem 	__u32   reserved;
4963b3233fbSRaed Salem };
4973b3233fbSRaed Salem 
4983b3233fbSRaed Salem struct mlx5_ib_create_flow {
4993b3233fbSRaed Salem 	__u32   ncounters_data;
5003b3233fbSRaed Salem 	__u32   reserved;
5013b3233fbSRaed Salem 	/*
5023b3233fbSRaed Salem 	 * Following are counters data based on ncounters_data, each
5033b3233fbSRaed Salem 	 * entry in the data[] should match a corresponding counter object
5043b3233fbSRaed Salem 	 * that was pointed by a counters spec upon the flow creation
5053b3233fbSRaed Salem 	 */
5063b3233fbSRaed Salem 	struct mlx5_ib_flow_counters_data data[];
5073b3233fbSRaed Salem };
5083b3233fbSRaed Salem 
5093085e29eSLeon Romanovsky #endif /* MLX5_ABI_USER_H */
510