1*d50e14abSJason Gunthorpe /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ 2225c7b1fSRoland Dreier /* 3225c7b1fSRoland Dreier * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. 451a379d0SJack Morgenstein * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. 5225c7b1fSRoland Dreier * 6225c7b1fSRoland Dreier * This software is available to you under a choice of one of two 7225c7b1fSRoland Dreier * licenses. You may choose to be licensed under the terms of the GNU 8225c7b1fSRoland Dreier * General Public License (GPL) Version 2, available from the file 9225c7b1fSRoland Dreier * COPYING in the main directory of this source tree, or the 10225c7b1fSRoland Dreier * OpenIB.org BSD license below: 11225c7b1fSRoland Dreier * 12225c7b1fSRoland Dreier * Redistribution and use in source and binary forms, with or 13225c7b1fSRoland Dreier * without modification, are permitted provided that the following 14225c7b1fSRoland Dreier * conditions are met: 15225c7b1fSRoland Dreier * 16225c7b1fSRoland Dreier * - Redistributions of source code must retain the above 17225c7b1fSRoland Dreier * copyright notice, this list of conditions and the following 18225c7b1fSRoland Dreier * disclaimer. 19225c7b1fSRoland Dreier * 20225c7b1fSRoland Dreier * - Redistributions in binary form must reproduce the above 21225c7b1fSRoland Dreier * copyright notice, this list of conditions and the following 22225c7b1fSRoland Dreier * disclaimer in the documentation and/or other materials 23225c7b1fSRoland Dreier * provided with the distribution. 24225c7b1fSRoland Dreier * 25225c7b1fSRoland Dreier * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26225c7b1fSRoland Dreier * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27225c7b1fSRoland Dreier * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 28225c7b1fSRoland Dreier * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 29225c7b1fSRoland Dreier * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 30225c7b1fSRoland Dreier * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 31225c7b1fSRoland Dreier * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32225c7b1fSRoland Dreier * SOFTWARE. 33225c7b1fSRoland Dreier */ 34225c7b1fSRoland Dreier 359ce28a20SLeon Romanovsky #ifndef MLX4_ABI_USER_H 369ce28a20SLeon Romanovsky #define MLX4_ABI_USER_H 37225c7b1fSRoland Dreier 38225c7b1fSRoland Dreier #include <linux/types.h> 39225c7b1fSRoland Dreier 40225c7b1fSRoland Dreier /* 41225c7b1fSRoland Dreier * Increment this value if any changes that break userspace ABI 42225c7b1fSRoland Dreier * compatibility are made. 43225c7b1fSRoland Dreier */ 4408ff3235SOr Gerlitz 4508ff3235SOr Gerlitz #define MLX4_IB_UVERBS_NO_DEV_CAPS_ABI_VERSION 3 4608ff3235SOr Gerlitz #define MLX4_IB_UVERBS_ABI_VERSION 4 47225c7b1fSRoland Dreier 48225c7b1fSRoland Dreier /* 49225c7b1fSRoland Dreier * Make sure that all structs defined in this file remain laid out so 50225c7b1fSRoland Dreier * that they pack the same way on 32-bit and 64-bit architectures (to 51225c7b1fSRoland Dreier * avoid incompatibility between 32-bit userspace and 64-bit kernels). 52225c7b1fSRoland Dreier * In particular do not use pointer types -- pass pointers in __u64 53225c7b1fSRoland Dreier * instead. 54225c7b1fSRoland Dreier */ 55225c7b1fSRoland Dreier 5608ff3235SOr Gerlitz struct mlx4_ib_alloc_ucontext_resp_v3 { 57225c7b1fSRoland Dreier __u32 qp_tab_size; 58225c7b1fSRoland Dreier __u16 bf_reg_size; 59225c7b1fSRoland Dreier __u16 bf_regs_per_page; 60225c7b1fSRoland Dreier }; 61225c7b1fSRoland Dreier 6248962f5cSJason Gunthorpe enum { 6348962f5cSJason Gunthorpe MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0, 6448962f5cSJason Gunthorpe }; 6548962f5cSJason Gunthorpe 6608ff3235SOr Gerlitz struct mlx4_ib_alloc_ucontext_resp { 6708ff3235SOr Gerlitz __u32 dev_caps; 6808ff3235SOr Gerlitz __u32 qp_tab_size; 6908ff3235SOr Gerlitz __u16 bf_reg_size; 7008ff3235SOr Gerlitz __u16 bf_regs_per_page; 7108ff3235SOr Gerlitz __u32 cqe_size; 7208ff3235SOr Gerlitz }; 7308ff3235SOr Gerlitz 74225c7b1fSRoland Dreier struct mlx4_ib_alloc_pd_resp { 75225c7b1fSRoland Dreier __u32 pdn; 76225c7b1fSRoland Dreier __u32 reserved; 77225c7b1fSRoland Dreier }; 78225c7b1fSRoland Dreier 79225c7b1fSRoland Dreier struct mlx4_ib_create_cq { 8026b99066SJason Gunthorpe __aligned_u64 buf_addr; 8126b99066SJason Gunthorpe __aligned_u64 db_addr; 82225c7b1fSRoland Dreier }; 83225c7b1fSRoland Dreier 84225c7b1fSRoland Dreier struct mlx4_ib_create_cq_resp { 85225c7b1fSRoland Dreier __u32 cqn; 86225c7b1fSRoland Dreier __u32 reserved; 87225c7b1fSRoland Dreier }; 88225c7b1fSRoland Dreier 89225c7b1fSRoland Dreier struct mlx4_ib_resize_cq { 9026b99066SJason Gunthorpe __aligned_u64 buf_addr; 91225c7b1fSRoland Dreier }; 92225c7b1fSRoland Dreier 93225c7b1fSRoland Dreier struct mlx4_ib_create_srq { 9426b99066SJason Gunthorpe __aligned_u64 buf_addr; 9526b99066SJason Gunthorpe __aligned_u64 db_addr; 96225c7b1fSRoland Dreier }; 97225c7b1fSRoland Dreier 98225c7b1fSRoland Dreier struct mlx4_ib_create_srq_resp { 99225c7b1fSRoland Dreier __u32 srqn; 100225c7b1fSRoland Dreier __u32 reserved; 101225c7b1fSRoland Dreier }; 102225c7b1fSRoland Dreier 1033078f5f1SGuy Levi struct mlx4_ib_create_qp_rss { 10426b99066SJason Gunthorpe __aligned_u64 rx_hash_fields_mask; /* Use enum mlx4_ib_rx_hash_fields */ 10507d84f7bSGuy Levi __u8 rx_hash_function; /* Use enum mlx4_ib_rx_hash_function_flags */ 106b23673f8SGuy Levi __u8 reserved[7]; 1073078f5f1SGuy Levi __u8 rx_hash_key[40]; 1083078f5f1SGuy Levi __u32 comp_mask; 1093078f5f1SGuy Levi __u32 reserved1; 1103078f5f1SGuy Levi }; 1113078f5f1SGuy Levi 112225c7b1fSRoland Dreier struct mlx4_ib_create_qp { 11326b99066SJason Gunthorpe __aligned_u64 buf_addr; 11426b99066SJason Gunthorpe __aligned_u64 db_addr; 1152446304dSEli Cohen __u8 log_sq_bb_count; 1162446304dSEli Cohen __u8 log_sq_stride; 1170e6e7416SRoland Dreier __u8 sq_no_prefetch; 118ea30b966SMaor Gottlieb __u8 reserved; 11955f2467cSMaor Gottlieb __u32 inl_recv_sz; 120225c7b1fSRoland Dreier }; 121225c7b1fSRoland Dreier 122400b1ebcSGuy Levi struct mlx4_ib_create_wq { 12326b99066SJason Gunthorpe __aligned_u64 buf_addr; 12426b99066SJason Gunthorpe __aligned_u64 db_addr; 125400b1ebcSGuy Levi __u8 log_range_size; 126400b1ebcSGuy Levi __u8 reserved[3]; 127400b1ebcSGuy Levi __u32 comp_mask; 128400b1ebcSGuy Levi }; 129400b1ebcSGuy Levi 130400b1ebcSGuy Levi struct mlx4_ib_modify_wq { 131400b1ebcSGuy Levi __u32 comp_mask; 132400b1ebcSGuy Levi __u32 reserved; 133400b1ebcSGuy Levi }; 134400b1ebcSGuy Levi 135b8d46ca0SGuy Levi struct mlx4_ib_create_rwq_ind_tbl_resp { 136b8d46ca0SGuy Levi __u32 response_length; 137b8d46ca0SGuy Levi __u32 reserved; 138b8d46ca0SGuy Levi }; 1393078f5f1SGuy Levi 1403078f5f1SGuy Levi /* RX Hash function flags */ 1413078f5f1SGuy Levi enum mlx4_ib_rx_hash_function_flags { 1423078f5f1SGuy Levi MLX4_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0, 1433078f5f1SGuy Levi }; 1443078f5f1SGuy Levi 1453078f5f1SGuy Levi /* 1463078f5f1SGuy Levi * RX Hash flags, these flags allows to set which incoming packet's field should 1473078f5f1SGuy Levi * participates in RX Hash. Each flag represent certain packet's field, 1483078f5f1SGuy Levi * when the flag is set the field that is represented by the flag will 1493078f5f1SGuy Levi * participate in RX Hash calculation. 1503078f5f1SGuy Levi */ 1513078f5f1SGuy Levi enum mlx4_ib_rx_hash_fields { 1523078f5f1SGuy Levi MLX4_IB_RX_HASH_SRC_IPV4 = 1 << 0, 1533078f5f1SGuy Levi MLX4_IB_RX_HASH_DST_IPV4 = 1 << 1, 1543078f5f1SGuy Levi MLX4_IB_RX_HASH_SRC_IPV6 = 1 << 2, 1553078f5f1SGuy Levi MLX4_IB_RX_HASH_DST_IPV6 = 1 << 3, 1563078f5f1SGuy Levi MLX4_IB_RX_HASH_SRC_PORT_TCP = 1 << 4, 1573078f5f1SGuy Levi MLX4_IB_RX_HASH_DST_PORT_TCP = 1 << 5, 1583078f5f1SGuy Levi MLX4_IB_RX_HASH_SRC_PORT_UDP = 1 << 6, 15907d84f7bSGuy Levi MLX4_IB_RX_HASH_DST_PORT_UDP = 1 << 7, 16007d84f7bSGuy Levi MLX4_IB_RX_HASH_INNER = 1ULL << 31, 1613078f5f1SGuy Levi }; 1623078f5f1SGuy Levi 163d50a8a96SYishai Hadas struct mlx4_ib_rss_caps { 16426b99066SJason Gunthorpe __aligned_u64 rx_hash_fields_mask; /* enum mlx4_ib_rx_hash_fields */ 165d50a8a96SYishai Hadas __u8 rx_hash_function; /* enum mlx4_ib_rx_hash_function_flags */ 166d50a8a96SYishai Hadas __u8 reserved[7]; 167d50a8a96SYishai Hadas }; 168d50a8a96SYishai Hadas 16948962f5cSJason Gunthorpe enum query_device_resp_mask { 17048962f5cSJason Gunthorpe MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0, 17148962f5cSJason Gunthorpe }; 17248962f5cSJason Gunthorpe 1739c71172cSYishai Hadas struct mlx4_ib_tso_caps { 1749c71172cSYishai Hadas __u32 max_tso; /* Maximum tso payload size in bytes */ 1759c71172cSYishai Hadas /* Corresponding bit will be set if qp type from 1769c71172cSYishai Hadas * 'enum ib_qp_type' is supported. 1779c71172cSYishai Hadas */ 1789c71172cSYishai Hadas __u32 supported_qpts; 1799c71172cSYishai Hadas }; 1809c71172cSYishai Hadas 181d50a8a96SYishai Hadas struct mlx4_uverbs_ex_query_device_resp { 182d50a8a96SYishai Hadas __u32 comp_mask; 183d50a8a96SYishai Hadas __u32 response_length; 18426b99066SJason Gunthorpe __aligned_u64 hca_core_clock_offset; 185d50a8a96SYishai Hadas __u32 max_inl_recv_sz; 186366380a0SJason Gunthorpe __u32 reserved; 187d50a8a96SYishai Hadas struct mlx4_ib_rss_caps rss_caps; 1889c71172cSYishai Hadas struct mlx4_ib_tso_caps tso_caps; 189d50a8a96SYishai Hadas }; 190d50a8a96SYishai Hadas 1919ce28a20SLeon Romanovsky #endif /* MLX4_ABI_USER_H */ 192