/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */1/*2* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.3* Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved.4*5* This software is available to you under a choice of one of two6* licenses. You may choose to be licensed under the terms of the GNU7* General Public License (GPL) Version 2, available from the file8* COPYING in the main directory of this source tree, or the9* OpenIB.org BSD license below:10*11* Redistribution and use in source and binary forms, with or12* without modification, are permitted provided that the following13* conditions are met:14*15* - Redistributions of source code must retain the above16* copyright notice, this list of conditions and the following17* disclaimer.18*19* - Redistributions in binary form must reproduce the above20* copyright notice, this list of conditions and the following21* disclaimer in the documentation and/or other materials22* provided with the distribution.23*24* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,25* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF26* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND27* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS28* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN29* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN30* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE31* SOFTWARE.32*/3334#ifndef MLX4_ABI_USER_H35#define MLX4_ABI_USER_H3637#include <linux/types.h>3839/*40* Increment this value if any changes that break userspace ABI41* compatibility are made.42*/4344#define MLX4_IB_UVERBS_NO_DEV_CAPS_ABI_VERSION 345#define MLX4_IB_UVERBS_ABI_VERSION 44647/*48* Make sure that all structs defined in this file remain laid out so49* that they pack the same way on 32-bit and 64-bit architectures (to50* avoid incompatibility between 32-bit userspace and 64-bit kernels).51* In particular do not use pointer types -- pass pointers in __u6452* instead.53*/5455struct mlx4_ib_alloc_ucontext_resp_v3 {56__u32 qp_tab_size;57__u16 bf_reg_size;58__u16 bf_regs_per_page;59};6061enum {62MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0,63};6465struct mlx4_ib_alloc_ucontext_resp {66__u32 dev_caps;67__u32 qp_tab_size;68__u16 bf_reg_size;69__u16 bf_regs_per_page;70__u32 cqe_size;71};7273struct mlx4_ib_alloc_pd_resp {74__u32 pdn;75__u32 reserved;76};7778struct mlx4_ib_create_cq {79__aligned_u64 buf_addr;80__aligned_u64 db_addr;81};8283struct mlx4_ib_create_cq_resp {84__u32 cqn;85__u32 reserved;86};8788struct mlx4_ib_resize_cq {89__aligned_u64 buf_addr;90};9192struct mlx4_ib_create_srq {93__aligned_u64 buf_addr;94__aligned_u64 db_addr;95};9697struct mlx4_ib_create_srq_resp {98__u32 srqn;99__u32 reserved;100};101102struct mlx4_ib_create_qp_rss {103__aligned_u64 rx_hash_fields_mask; /* Use enum mlx4_ib_rx_hash_fields */104__u8 rx_hash_function; /* Use enum mlx4_ib_rx_hash_function_flags */105__u8 reserved[7];106__u8 rx_hash_key[40];107__u32 comp_mask;108__u32 reserved1;109};110111struct mlx4_ib_create_qp {112__aligned_u64 buf_addr;113__aligned_u64 db_addr;114__u8 log_sq_bb_count;115__u8 log_sq_stride;116__u8 sq_no_prefetch;117__u8 reserved;118__u32 inl_recv_sz;119};120121struct mlx4_ib_create_wq {122__aligned_u64 buf_addr;123__aligned_u64 db_addr;124__u8 log_range_size;125__u8 reserved[3];126__u32 comp_mask;127};128129struct mlx4_ib_modify_wq {130__u32 comp_mask;131__u32 reserved;132};133134struct mlx4_ib_create_rwq_ind_tbl_resp {135__u32 response_length;136__u32 reserved;137};138139/* RX Hash function flags */140enum mlx4_ib_rx_hash_function_flags {141MLX4_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,142};143144/*145* RX Hash flags, these flags allows to set which incoming packet's field should146* participates in RX Hash. Each flag represent certain packet's field,147* when the flag is set the field that is represented by the flag will148* participate in RX Hash calculation.149*/150enum mlx4_ib_rx_hash_fields {151MLX4_IB_RX_HASH_SRC_IPV4 = 1 << 0,152MLX4_IB_RX_HASH_DST_IPV4 = 1 << 1,153MLX4_IB_RX_HASH_SRC_IPV6 = 1 << 2,154MLX4_IB_RX_HASH_DST_IPV6 = 1 << 3,155MLX4_IB_RX_HASH_SRC_PORT_TCP = 1 << 4,156MLX4_IB_RX_HASH_DST_PORT_TCP = 1 << 5,157MLX4_IB_RX_HASH_SRC_PORT_UDP = 1 << 6,158MLX4_IB_RX_HASH_DST_PORT_UDP = 1 << 7,159MLX4_IB_RX_HASH_INNER = 1ULL << 31,160};161162struct mlx4_ib_rss_caps {163__aligned_u64 rx_hash_fields_mask; /* enum mlx4_ib_rx_hash_fields */164__u8 rx_hash_function; /* enum mlx4_ib_rx_hash_function_flags */165__u8 reserved[7];166};167168enum query_device_resp_mask {169MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,170};171172struct mlx4_ib_tso_caps {173__u32 max_tso; /* Maximum tso payload size in bytes */174/* Corresponding bit will be set if qp type from175* 'enum ib_qp_type' is supported.176*/177__u32 supported_qpts;178};179180struct mlx4_uverbs_ex_query_device_resp {181__u32 comp_mask;182__u32 response_length;183__aligned_u64 hca_core_clock_offset;184__u32 max_inl_recv_sz;185__u32 reserved;186struct mlx4_ib_rss_caps rss_caps;187struct mlx4_ib_tso_caps tso_caps;188};189190#endif /* MLX4_ABI_USER_H */191192193