18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This software is available to you under a choice of one of two
68c2ecf20Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
78c2ecf20Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
88c2ecf20Sopenharmony_ci * COPYING in the main directory of this source tree, or the
98c2ecf20Sopenharmony_ci * OpenIB.org BSD license below:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
128c2ecf20Sopenharmony_ci *     without modification, are permitted provided that the following
138c2ecf20Sopenharmony_ci *     conditions are met:
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci *      - Redistributions of source code must retain the above
168c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
178c2ecf20Sopenharmony_ci *        disclaimer.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
208c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
218c2ecf20Sopenharmony_ci *        disclaimer in the documentation and/or other materials
228c2ecf20Sopenharmony_ci *        provided with the distribution.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
258c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
268c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
278c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
288c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
298c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
308c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
318c2ecf20Sopenharmony_ci * SOFTWARE.
328c2ecf20Sopenharmony_ci */
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#ifndef MLX5_ABI_USER_H
358c2ecf20Sopenharmony_ci#define MLX5_ABI_USER_H
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#include <linux/types.h>
388c2ecf20Sopenharmony_ci#include <linux/if_ether.h>	/* For ETH_ALEN. */
398c2ecf20Sopenharmony_ci#include <rdma/ib_user_ioctl_verbs.h>
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cienum {
428c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_SIGNATURE		= 1 << 0,
438c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_SCATTER_CQE	= 1 << 1,
448c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_TUNNEL_OFFLOADS	= 1 << 2,
458c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_BFREG_INDEX	= 1 << 3,
468c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_TYPE_DCT		= 1 << 4,
478c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_TYPE_DCI		= 1 << 5,
488c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6,
498c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7,
508c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_ALLOW_SCATTER_CQE	= 1 << 8,
518c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE	= 1 << 9,
528c2ecf20Sopenharmony_ci	MLX5_QP_FLAG_UAR_PAGE_INDEX = 1 << 10,
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_cienum {
568c2ecf20Sopenharmony_ci	MLX5_SRQ_FLAG_SIGNATURE		= 1 << 0,
578c2ecf20Sopenharmony_ci};
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_cienum {
608c2ecf20Sopenharmony_ci	MLX5_WQ_FLAG_SIGNATURE		= 1 << 0,
618c2ecf20Sopenharmony_ci};
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* Increment this value if any changes that break userspace ABI
648c2ecf20Sopenharmony_ci * compatibility are made.
658c2ecf20Sopenharmony_ci */
668c2ecf20Sopenharmony_ci#define MLX5_IB_UVERBS_ABI_VERSION	1
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* Make sure that all structs defined in this file remain laid out so
698c2ecf20Sopenharmony_ci * that they pack the same way on 32-bit and 64-bit architectures (to
708c2ecf20Sopenharmony_ci * avoid incompatibility between 32-bit userspace and 64-bit kernels).
718c2ecf20Sopenharmony_ci * In particular do not use pointer types -- pass pointers in __u64
728c2ecf20Sopenharmony_ci * instead.
738c2ecf20Sopenharmony_ci */
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_cistruct mlx5_ib_alloc_ucontext_req {
768c2ecf20Sopenharmony_ci	__u32	total_num_bfregs;
778c2ecf20Sopenharmony_ci	__u32	num_low_latency_bfregs;
788c2ecf20Sopenharmony_ci};
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cienum mlx5_lib_caps {
818c2ecf20Sopenharmony_ci	MLX5_LIB_CAP_4K_UAR	= (__u64)1 << 0,
828c2ecf20Sopenharmony_ci	MLX5_LIB_CAP_DYN_UAR	= (__u64)1 << 1,
838c2ecf20Sopenharmony_ci};
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_cienum mlx5_ib_alloc_uctx_v2_flags {
868c2ecf20Sopenharmony_ci	MLX5_IB_ALLOC_UCTX_DEVX	= 1 << 0,
878c2ecf20Sopenharmony_ci};
888c2ecf20Sopenharmony_cistruct mlx5_ib_alloc_ucontext_req_v2 {
898c2ecf20Sopenharmony_ci	__u32	total_num_bfregs;
908c2ecf20Sopenharmony_ci	__u32	num_low_latency_bfregs;
918c2ecf20Sopenharmony_ci	__u32	flags;
928c2ecf20Sopenharmony_ci	__u32	comp_mask;
938c2ecf20Sopenharmony_ci	__u8	max_cqe_version;
948c2ecf20Sopenharmony_ci	__u8	reserved0;
958c2ecf20Sopenharmony_ci	__u16	reserved1;
968c2ecf20Sopenharmony_ci	__u32	reserved2;
978c2ecf20Sopenharmony_ci	__aligned_u64 lib_caps;
988c2ecf20Sopenharmony_ci};
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_cienum mlx5_ib_alloc_ucontext_resp_mask {
1018c2ecf20Sopenharmony_ci	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
1028c2ecf20Sopenharmony_ci	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY    = 1UL << 1,
1038c2ecf20Sopenharmony_ci	MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE               = 1UL << 2,
1048c2ecf20Sopenharmony_ci};
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_cienum mlx5_user_cmds_supp_uhw {
1078c2ecf20Sopenharmony_ci	MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0,
1088c2ecf20Sopenharmony_ci	MLX5_USER_CMDS_SUPP_UHW_CREATE_AH    = 1 << 1,
1098c2ecf20Sopenharmony_ci};
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/* The eth_min_inline response value is set to off-by-one vs the FW
1128c2ecf20Sopenharmony_ci * returned value to allow user-space to deal with older kernels.
1138c2ecf20Sopenharmony_ci */
1148c2ecf20Sopenharmony_cienum mlx5_user_inline_mode {
1158c2ecf20Sopenharmony_ci	MLX5_USER_INLINE_MODE_NA,
1168c2ecf20Sopenharmony_ci	MLX5_USER_INLINE_MODE_NONE,
1178c2ecf20Sopenharmony_ci	MLX5_USER_INLINE_MODE_L2,
1188c2ecf20Sopenharmony_ci	MLX5_USER_INLINE_MODE_IP,
1198c2ecf20Sopenharmony_ci	MLX5_USER_INLINE_MODE_TCP_UDP,
1208c2ecf20Sopenharmony_ci};
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_cienum {
1238c2ecf20Sopenharmony_ci	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM = 1 << 0,
1248c2ecf20Sopenharmony_ci	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_REQ_METADATA = 1 << 1,
1258c2ecf20Sopenharmony_ci	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_SPI_STEERING = 1 << 2,
1268c2ecf20Sopenharmony_ci	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_FULL_OFFLOAD = 1 << 3,
1278c2ecf20Sopenharmony_ci	MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_TX_IV_IS_ESN = 1 << 4,
1288c2ecf20Sopenharmony_ci};
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_cistruct mlx5_ib_alloc_ucontext_resp {
1318c2ecf20Sopenharmony_ci	__u32	qp_tab_size;
1328c2ecf20Sopenharmony_ci	__u32	bf_reg_size;
1338c2ecf20Sopenharmony_ci	__u32	tot_bfregs;
1348c2ecf20Sopenharmony_ci	__u32	cache_line_size;
1358c2ecf20Sopenharmony_ci	__u16	max_sq_desc_sz;
1368c2ecf20Sopenharmony_ci	__u16	max_rq_desc_sz;
1378c2ecf20Sopenharmony_ci	__u32	max_send_wqebb;
1388c2ecf20Sopenharmony_ci	__u32	max_recv_wr;
1398c2ecf20Sopenharmony_ci	__u32	max_srq_recv_wr;
1408c2ecf20Sopenharmony_ci	__u16	num_ports;
1418c2ecf20Sopenharmony_ci	__u16	flow_action_flags;
1428c2ecf20Sopenharmony_ci	__u32	comp_mask;
1438c2ecf20Sopenharmony_ci	__u32	response_length;
1448c2ecf20Sopenharmony_ci	__u8	cqe_version;
1458c2ecf20Sopenharmony_ci	__u8	cmds_supp_uhw;
1468c2ecf20Sopenharmony_ci	__u8	eth_min_inline;
1478c2ecf20Sopenharmony_ci	__u8	clock_info_versions;
1488c2ecf20Sopenharmony_ci	__aligned_u64 hca_core_clock_offset;
1498c2ecf20Sopenharmony_ci	__u32	log_uar_size;
1508c2ecf20Sopenharmony_ci	__u32	num_uars_per_page;
1518c2ecf20Sopenharmony_ci	__u32	num_dyn_bfregs;
1528c2ecf20Sopenharmony_ci	__u32	dump_fill_mkey;
1538c2ecf20Sopenharmony_ci};
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_cistruct mlx5_ib_alloc_pd_resp {
1568c2ecf20Sopenharmony_ci	__u32	pdn;
1578c2ecf20Sopenharmony_ci};
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_cistruct mlx5_ib_tso_caps {
1608c2ecf20Sopenharmony_ci	__u32 max_tso; /* Maximum tso payload size in bytes */
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci	/* Corresponding bit will be set if qp type from
1638c2ecf20Sopenharmony_ci	 * 'enum ib_qp_type' is supported, e.g.
1648c2ecf20Sopenharmony_ci	 * supported_qpts |= 1 << IB_QPT_UD
1658c2ecf20Sopenharmony_ci	 */
1668c2ecf20Sopenharmony_ci	__u32 supported_qpts;
1678c2ecf20Sopenharmony_ci};
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_cistruct mlx5_ib_rss_caps {
1708c2ecf20Sopenharmony_ci	__aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
1718c2ecf20Sopenharmony_ci	__u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
1728c2ecf20Sopenharmony_ci	__u8 reserved[7];
1738c2ecf20Sopenharmony_ci};
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_cienum mlx5_ib_cqe_comp_res_format {
1768c2ecf20Sopenharmony_ci	MLX5_IB_CQE_RES_FORMAT_HASH	= 1 << 0,
1778c2ecf20Sopenharmony_ci	MLX5_IB_CQE_RES_FORMAT_CSUM	= 1 << 1,
1788c2ecf20Sopenharmony_ci	MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2,
1798c2ecf20Sopenharmony_ci};
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_cistruct mlx5_ib_cqe_comp_caps {
1828c2ecf20Sopenharmony_ci	__u32 max_num;
1838c2ecf20Sopenharmony_ci	__u32 supported_format; /* enum mlx5_ib_cqe_comp_res_format */
1848c2ecf20Sopenharmony_ci};
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_cienum mlx5_ib_packet_pacing_cap_flags {
1878c2ecf20Sopenharmony_ci	MLX5_IB_PP_SUPPORT_BURST	= 1 << 0,
1888c2ecf20Sopenharmony_ci};
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_cistruct mlx5_packet_pacing_caps {
1918c2ecf20Sopenharmony_ci	__u32 qp_rate_limit_min;
1928c2ecf20Sopenharmony_ci	__u32 qp_rate_limit_max; /* In kpbs */
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci	/* Corresponding bit will be set if qp type from
1958c2ecf20Sopenharmony_ci	 * 'enum ib_qp_type' is supported, e.g.
1968c2ecf20Sopenharmony_ci	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
1978c2ecf20Sopenharmony_ci	 */
1988c2ecf20Sopenharmony_ci	__u32 supported_qpts;
1998c2ecf20Sopenharmony_ci	__u8  cap_flags; /* enum mlx5_ib_packet_pacing_cap_flags */
2008c2ecf20Sopenharmony_ci	__u8  reserved[3];
2018c2ecf20Sopenharmony_ci};
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_cienum mlx5_ib_mpw_caps {
2048c2ecf20Sopenharmony_ci	MPW_RESERVED		= 1 << 0,
2058c2ecf20Sopenharmony_ci	MLX5_IB_ALLOW_MPW	= 1 << 1,
2068c2ecf20Sopenharmony_ci	MLX5_IB_SUPPORT_EMPW	= 1 << 2,
2078c2ecf20Sopenharmony_ci};
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_cienum mlx5_ib_sw_parsing_offloads {
2108c2ecf20Sopenharmony_ci	MLX5_IB_SW_PARSING = 1 << 0,
2118c2ecf20Sopenharmony_ci	MLX5_IB_SW_PARSING_CSUM = 1 << 1,
2128c2ecf20Sopenharmony_ci	MLX5_IB_SW_PARSING_LSO = 1 << 2,
2138c2ecf20Sopenharmony_ci};
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_cistruct mlx5_ib_sw_parsing_caps {
2168c2ecf20Sopenharmony_ci	__u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	/* Corresponding bit will be set if qp type from
2198c2ecf20Sopenharmony_ci	 * 'enum ib_qp_type' is supported, e.g.
2208c2ecf20Sopenharmony_ci	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
2218c2ecf20Sopenharmony_ci	 */
2228c2ecf20Sopenharmony_ci	__u32 supported_qpts;
2238c2ecf20Sopenharmony_ci};
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_cistruct mlx5_ib_striding_rq_caps {
2268c2ecf20Sopenharmony_ci	__u32 min_single_stride_log_num_of_bytes;
2278c2ecf20Sopenharmony_ci	__u32 max_single_stride_log_num_of_bytes;
2288c2ecf20Sopenharmony_ci	__u32 min_single_wqe_log_num_of_strides;
2298c2ecf20Sopenharmony_ci	__u32 max_single_wqe_log_num_of_strides;
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci	/* Corresponding bit will be set if qp type from
2328c2ecf20Sopenharmony_ci	 * 'enum ib_qp_type' is supported, e.g.
2338c2ecf20Sopenharmony_ci	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
2348c2ecf20Sopenharmony_ci	 */
2358c2ecf20Sopenharmony_ci	__u32 supported_qpts;
2368c2ecf20Sopenharmony_ci	__u32 reserved;
2378c2ecf20Sopenharmony_ci};
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_cienum mlx5_ib_query_dev_resp_flags {
2408c2ecf20Sopenharmony_ci	/* Support 128B CQE compression */
2418c2ecf20Sopenharmony_ci	MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
2428c2ecf20Sopenharmony_ci	MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD  = 1 << 1,
2438c2ecf20Sopenharmony_ci	MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2,
2448c2ecf20Sopenharmony_ci	MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3,
2458c2ecf20Sopenharmony_ci};
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_cienum mlx5_ib_tunnel_offloads {
2488c2ecf20Sopenharmony_ci	MLX5_IB_TUNNELED_OFFLOADS_VXLAN  = 1 << 0,
2498c2ecf20Sopenharmony_ci	MLX5_IB_TUNNELED_OFFLOADS_GRE    = 1 << 1,
2508c2ecf20Sopenharmony_ci	MLX5_IB_TUNNELED_OFFLOADS_GENEVE = 1 << 2,
2518c2ecf20Sopenharmony_ci	MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE = 1 << 3,
2528c2ecf20Sopenharmony_ci	MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP = 1 << 4,
2538c2ecf20Sopenharmony_ci};
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_cistruct mlx5_ib_query_device_resp {
2568c2ecf20Sopenharmony_ci	__u32	comp_mask;
2578c2ecf20Sopenharmony_ci	__u32	response_length;
2588c2ecf20Sopenharmony_ci	struct	mlx5_ib_tso_caps tso_caps;
2598c2ecf20Sopenharmony_ci	struct	mlx5_ib_rss_caps rss_caps;
2608c2ecf20Sopenharmony_ci	struct	mlx5_ib_cqe_comp_caps cqe_comp_caps;
2618c2ecf20Sopenharmony_ci	struct	mlx5_packet_pacing_caps packet_pacing_caps;
2628c2ecf20Sopenharmony_ci	__u32	mlx5_ib_support_multi_pkt_send_wqes;
2638c2ecf20Sopenharmony_ci	__u32	flags; /* Use enum mlx5_ib_query_dev_resp_flags */
2648c2ecf20Sopenharmony_ci	struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
2658c2ecf20Sopenharmony_ci	struct mlx5_ib_striding_rq_caps striding_rq_caps;
2668c2ecf20Sopenharmony_ci	__u32	tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */
2678c2ecf20Sopenharmony_ci	__u32	reserved;
2688c2ecf20Sopenharmony_ci};
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_cienum mlx5_ib_create_cq_flags {
2718c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD	= 1 << 0,
2728c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_CQ_FLAGS_UAR_PAGE_INDEX  = 1 << 1,
2738c2ecf20Sopenharmony_ci};
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_cistruct mlx5_ib_create_cq {
2768c2ecf20Sopenharmony_ci	__aligned_u64 buf_addr;
2778c2ecf20Sopenharmony_ci	__aligned_u64 db_addr;
2788c2ecf20Sopenharmony_ci	__u32	cqe_size;
2798c2ecf20Sopenharmony_ci	__u8    cqe_comp_en;
2808c2ecf20Sopenharmony_ci	__u8    cqe_comp_res_format;
2818c2ecf20Sopenharmony_ci	__u16	flags;
2828c2ecf20Sopenharmony_ci	__u16	uar_page_index;
2838c2ecf20Sopenharmony_ci	__u16	reserved0;
2848c2ecf20Sopenharmony_ci	__u32	reserved1;
2858c2ecf20Sopenharmony_ci};
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_cistruct mlx5_ib_create_cq_resp {
2888c2ecf20Sopenharmony_ci	__u32	cqn;
2898c2ecf20Sopenharmony_ci	__u32	reserved;
2908c2ecf20Sopenharmony_ci};
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_cistruct mlx5_ib_resize_cq {
2938c2ecf20Sopenharmony_ci	__aligned_u64 buf_addr;
2948c2ecf20Sopenharmony_ci	__u16	cqe_size;
2958c2ecf20Sopenharmony_ci	__u16	reserved0;
2968c2ecf20Sopenharmony_ci	__u32	reserved1;
2978c2ecf20Sopenharmony_ci};
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_cistruct mlx5_ib_create_srq {
3008c2ecf20Sopenharmony_ci	__aligned_u64 buf_addr;
3018c2ecf20Sopenharmony_ci	__aligned_u64 db_addr;
3028c2ecf20Sopenharmony_ci	__u32	flags;
3038c2ecf20Sopenharmony_ci	__u32	reserved0; /* explicit padding (optional on i386) */
3048c2ecf20Sopenharmony_ci	__u32	uidx;
3058c2ecf20Sopenharmony_ci	__u32	reserved1;
3068c2ecf20Sopenharmony_ci};
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_cistruct mlx5_ib_create_srq_resp {
3098c2ecf20Sopenharmony_ci	__u32	srqn;
3108c2ecf20Sopenharmony_ci	__u32	reserved;
3118c2ecf20Sopenharmony_ci};
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_cistruct mlx5_ib_create_qp {
3148c2ecf20Sopenharmony_ci	__aligned_u64 buf_addr;
3158c2ecf20Sopenharmony_ci	__aligned_u64 db_addr;
3168c2ecf20Sopenharmony_ci	__u32	sq_wqe_count;
3178c2ecf20Sopenharmony_ci	__u32	rq_wqe_count;
3188c2ecf20Sopenharmony_ci	__u32	rq_wqe_shift;
3198c2ecf20Sopenharmony_ci	__u32	flags;
3208c2ecf20Sopenharmony_ci	__u32	uidx;
3218c2ecf20Sopenharmony_ci	__u32	bfreg_index;
3228c2ecf20Sopenharmony_ci	union {
3238c2ecf20Sopenharmony_ci		__aligned_u64 sq_buf_addr;
3248c2ecf20Sopenharmony_ci		__aligned_u64 access_key;
3258c2ecf20Sopenharmony_ci	};
3268c2ecf20Sopenharmony_ci	__u32  ece_options;
3278c2ecf20Sopenharmony_ci	__u32  reserved;
3288c2ecf20Sopenharmony_ci};
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci/* RX Hash function flags */
3318c2ecf20Sopenharmony_cienum mlx5_rx_hash_function_flags {
3328c2ecf20Sopenharmony_ci	MLX5_RX_HASH_FUNC_TOEPLITZ	= 1 << 0,
3338c2ecf20Sopenharmony_ci};
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci/*
3368c2ecf20Sopenharmony_ci * RX Hash flags, these flags allows to set which incoming packet's field should
3378c2ecf20Sopenharmony_ci * participates in RX Hash. Each flag represent certain packet's field,
3388c2ecf20Sopenharmony_ci * when the flag is set the field that is represented by the flag will
3398c2ecf20Sopenharmony_ci * participate in RX Hash calculation.
3408c2ecf20Sopenharmony_ci * Note: *IPV4 and *IPV6 flags can't be enabled together on the same QP
3418c2ecf20Sopenharmony_ci * and *TCP and *UDP flags can't be enabled together on the same QP.
3428c2ecf20Sopenharmony_ci*/
3438c2ecf20Sopenharmony_cienum mlx5_rx_hash_fields {
3448c2ecf20Sopenharmony_ci	MLX5_RX_HASH_SRC_IPV4	= 1 << 0,
3458c2ecf20Sopenharmony_ci	MLX5_RX_HASH_DST_IPV4	= 1 << 1,
3468c2ecf20Sopenharmony_ci	MLX5_RX_HASH_SRC_IPV6	= 1 << 2,
3478c2ecf20Sopenharmony_ci	MLX5_RX_HASH_DST_IPV6	= 1 << 3,
3488c2ecf20Sopenharmony_ci	MLX5_RX_HASH_SRC_PORT_TCP	= 1 << 4,
3498c2ecf20Sopenharmony_ci	MLX5_RX_HASH_DST_PORT_TCP	= 1 << 5,
3508c2ecf20Sopenharmony_ci	MLX5_RX_HASH_SRC_PORT_UDP	= 1 << 6,
3518c2ecf20Sopenharmony_ci	MLX5_RX_HASH_DST_PORT_UDP	= 1 << 7,
3528c2ecf20Sopenharmony_ci	MLX5_RX_HASH_IPSEC_SPI		= 1 << 8,
3538c2ecf20Sopenharmony_ci	/* Save bits for future fields */
3548c2ecf20Sopenharmony_ci	MLX5_RX_HASH_INNER		= (1UL << 31),
3558c2ecf20Sopenharmony_ci};
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_cistruct mlx5_ib_create_qp_rss {
3588c2ecf20Sopenharmony_ci	__aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */
3598c2ecf20Sopenharmony_ci	__u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */
3608c2ecf20Sopenharmony_ci	__u8 rx_key_len; /* valid only for Toeplitz */
3618c2ecf20Sopenharmony_ci	__u8 reserved[6];
3628c2ecf20Sopenharmony_ci	__u8 rx_hash_key[128]; /* valid only for Toeplitz */
3638c2ecf20Sopenharmony_ci	__u32   comp_mask;
3648c2ecf20Sopenharmony_ci	__u32	flags;
3658c2ecf20Sopenharmony_ci};
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_cienum mlx5_ib_create_qp_resp_mask {
3688c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_QP_RESP_MASK_TIRN = 1UL << 0,
3698c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_QP_RESP_MASK_TISN = 1UL << 1,
3708c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_QP_RESP_MASK_RQN  = 1UL << 2,
3718c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_QP_RESP_MASK_SQN  = 1UL << 3,
3728c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_QP_RESP_MASK_TIR_ICM_ADDR  = 1UL << 4,
3738c2ecf20Sopenharmony_ci};
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_cistruct mlx5_ib_create_qp_resp {
3768c2ecf20Sopenharmony_ci	__u32	bfreg_index;
3778c2ecf20Sopenharmony_ci	__u32   ece_options;
3788c2ecf20Sopenharmony_ci	__u32	comp_mask;
3798c2ecf20Sopenharmony_ci	__u32	tirn;
3808c2ecf20Sopenharmony_ci	__u32	tisn;
3818c2ecf20Sopenharmony_ci	__u32	rqn;
3828c2ecf20Sopenharmony_ci	__u32	sqn;
3838c2ecf20Sopenharmony_ci	__u32   reserved1;
3848c2ecf20Sopenharmony_ci	__u64	tir_icm_addr;
3858c2ecf20Sopenharmony_ci};
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_cistruct mlx5_ib_alloc_mw {
3888c2ecf20Sopenharmony_ci	__u32	comp_mask;
3898c2ecf20Sopenharmony_ci	__u8	num_klms;
3908c2ecf20Sopenharmony_ci	__u8	reserved1;
3918c2ecf20Sopenharmony_ci	__u16	reserved2;
3928c2ecf20Sopenharmony_ci};
3938c2ecf20Sopenharmony_ci
3948c2ecf20Sopenharmony_cienum mlx5_ib_create_wq_mask {
3958c2ecf20Sopenharmony_ci	MLX5_IB_CREATE_WQ_STRIDING_RQ	= (1 << 0),
3968c2ecf20Sopenharmony_ci};
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_cistruct mlx5_ib_create_wq {
3998c2ecf20Sopenharmony_ci	__aligned_u64 buf_addr;
4008c2ecf20Sopenharmony_ci	__aligned_u64 db_addr;
4018c2ecf20Sopenharmony_ci	__u32   rq_wqe_count;
4028c2ecf20Sopenharmony_ci	__u32   rq_wqe_shift;
4038c2ecf20Sopenharmony_ci	__u32   user_index;
4048c2ecf20Sopenharmony_ci	__u32   flags;
4058c2ecf20Sopenharmony_ci	__u32   comp_mask;
4068c2ecf20Sopenharmony_ci	__u32	single_stride_log_num_of_bytes;
4078c2ecf20Sopenharmony_ci	__u32	single_wqe_log_num_of_strides;
4088c2ecf20Sopenharmony_ci	__u32	two_byte_shift_en;
4098c2ecf20Sopenharmony_ci};
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_cistruct mlx5_ib_create_ah_resp {
4128c2ecf20Sopenharmony_ci	__u32	response_length;
4138c2ecf20Sopenharmony_ci	__u8	dmac[ETH_ALEN];
4148c2ecf20Sopenharmony_ci	__u8	reserved[6];
4158c2ecf20Sopenharmony_ci};
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_cistruct mlx5_ib_burst_info {
4188c2ecf20Sopenharmony_ci	__u32       max_burst_sz;
4198c2ecf20Sopenharmony_ci	__u16       typical_pkt_sz;
4208c2ecf20Sopenharmony_ci	__u16       reserved;
4218c2ecf20Sopenharmony_ci};
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_cistruct mlx5_ib_modify_qp {
4248c2ecf20Sopenharmony_ci	__u32			   comp_mask;
4258c2ecf20Sopenharmony_ci	struct mlx5_ib_burst_info  burst_info;
4268c2ecf20Sopenharmony_ci	__u32			   ece_options;
4278c2ecf20Sopenharmony_ci};
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_cistruct mlx5_ib_modify_qp_resp {
4308c2ecf20Sopenharmony_ci	__u32	response_length;
4318c2ecf20Sopenharmony_ci	__u32	dctn;
4328c2ecf20Sopenharmony_ci	__u32   ece_options;
4338c2ecf20Sopenharmony_ci	__u32   reserved;
4348c2ecf20Sopenharmony_ci};
4358c2ecf20Sopenharmony_ci
4368c2ecf20Sopenharmony_cistruct mlx5_ib_create_wq_resp {
4378c2ecf20Sopenharmony_ci	__u32	response_length;
4388c2ecf20Sopenharmony_ci	__u32	reserved;
4398c2ecf20Sopenharmony_ci};
4408c2ecf20Sopenharmony_ci
4418c2ecf20Sopenharmony_cistruct mlx5_ib_create_rwq_ind_tbl_resp {
4428c2ecf20Sopenharmony_ci	__u32	response_length;
4438c2ecf20Sopenharmony_ci	__u32	reserved;
4448c2ecf20Sopenharmony_ci};
4458c2ecf20Sopenharmony_ci
4468c2ecf20Sopenharmony_cistruct mlx5_ib_modify_wq {
4478c2ecf20Sopenharmony_ci	__u32	comp_mask;
4488c2ecf20Sopenharmony_ci	__u32	reserved;
4498c2ecf20Sopenharmony_ci};
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_cistruct mlx5_ib_clock_info {
4528c2ecf20Sopenharmony_ci	__u32 sign;
4538c2ecf20Sopenharmony_ci	__u32 resv;
4548c2ecf20Sopenharmony_ci	__aligned_u64 nsec;
4558c2ecf20Sopenharmony_ci	__aligned_u64 cycles;
4568c2ecf20Sopenharmony_ci	__aligned_u64 frac;
4578c2ecf20Sopenharmony_ci	__u32 mult;
4588c2ecf20Sopenharmony_ci	__u32 shift;
4598c2ecf20Sopenharmony_ci	__aligned_u64 mask;
4608c2ecf20Sopenharmony_ci	__aligned_u64 overflow_period;
4618c2ecf20Sopenharmony_ci};
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_cienum mlx5_ib_mmap_cmd {
4648c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_REGULAR_PAGE               = 0,
4658c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES       = 1,
4668c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_WC_PAGE                    = 2,
4678c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_NC_PAGE                    = 3,
4688c2ecf20Sopenharmony_ci	/* 5 is chosen in order to be compatible with old versions of libmlx5 */
4698c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_CORE_CLOCK                 = 5,
4708c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_ALLOC_WC                   = 6,
4718c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_CLOCK_INFO                 = 7,
4728c2ecf20Sopenharmony_ci	MLX5_IB_MMAP_DEVICE_MEM                 = 8,
4738c2ecf20Sopenharmony_ci};
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_cienum {
4768c2ecf20Sopenharmony_ci	MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1,
4778c2ecf20Sopenharmony_ci};
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci/* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */
4808c2ecf20Sopenharmony_cienum {
4818c2ecf20Sopenharmony_ci	MLX5_IB_CLOCK_INFO_V1              = 0,
4828c2ecf20Sopenharmony_ci};
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_cistruct mlx5_ib_flow_counters_desc {
4858c2ecf20Sopenharmony_ci	__u32	description;
4868c2ecf20Sopenharmony_ci	__u32	index;
4878c2ecf20Sopenharmony_ci};
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_cistruct mlx5_ib_flow_counters_data {
4908c2ecf20Sopenharmony_ci	RDMA_UAPI_PTR(struct mlx5_ib_flow_counters_desc *, counters_data);
4918c2ecf20Sopenharmony_ci	__u32   ncounters;
4928c2ecf20Sopenharmony_ci	__u32   reserved;
4938c2ecf20Sopenharmony_ci};
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_cistruct mlx5_ib_create_flow {
4968c2ecf20Sopenharmony_ci	__u32   ncounters_data;
4978c2ecf20Sopenharmony_ci	__u32   reserved;
4988c2ecf20Sopenharmony_ci	/*
4998c2ecf20Sopenharmony_ci	 * Following are counters data based on ncounters_data, each
5008c2ecf20Sopenharmony_ci	 * entry in the data[] should match a corresponding counter object
5018c2ecf20Sopenharmony_ci	 * that was pointed by a counters spec upon the flow creation
5028c2ecf20Sopenharmony_ci	 */
5038c2ecf20Sopenharmony_ci	struct mlx5_ib_flow_counters_data data[];
5048c2ecf20Sopenharmony_ci};
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci#endif /* MLX5_ABI_USER_H */
507