Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
0002 /*
0003  * Copyright (c) 2017-2018, Mellanox Technologies inc.  All rights reserved.
0004  *
0005  * This software is available to you under a choice of one of two
0006  * licenses.  You may choose to be licensed under the terms of the GNU
0007  * General Public License (GPL) Version 2, available from the file
0008  * COPYING in the main directory of this source tree, or the
0009  * OpenIB.org BSD license below:
0010  *
0011  *     Redistribution and use in source and binary forms, with or
0012  *     without modification, are permitted provided that the following
0013  *     conditions are met:
0014  *
0015  *      - Redistributions of source code must retain the above
0016  *        copyright notice, this list of conditions and the following
0017  *        disclaimer.
0018  *
0019  *      - Redistributions in binary form must reproduce the above
0020  *        copyright notice, this list of conditions and the following
0021  *        disclaimer in the documentation and/or other materials
0022  *        provided with the distribution.
0023  *
0024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0025  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0026  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0027  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0028  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0029  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0030  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0031  * SOFTWARE.
0032  */
0033 
0034 #ifndef IB_USER_IOCTL_VERBS_H
0035 #define IB_USER_IOCTL_VERBS_H
0036 
0037 #include <linux/types.h>
0038 #include <rdma/ib_user_verbs.h>
0039 
0040 #ifndef RDMA_UAPI_PTR
0041 #define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
0042 #endif
0043 
0044 #define IB_UVERBS_ACCESS_OPTIONAL_FIRST (1 << 20)
0045 #define IB_UVERBS_ACCESS_OPTIONAL_LAST (1 << 29)
0046 
0047 enum ib_uverbs_core_support {
0048     IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS = 1 << 0,
0049 };
0050 
0051 enum ib_uverbs_access_flags {
0052     IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,
0053     IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,
0054     IB_UVERBS_ACCESS_REMOTE_READ = 1 << 2,
0055     IB_UVERBS_ACCESS_REMOTE_ATOMIC = 1 << 3,
0056     IB_UVERBS_ACCESS_MW_BIND = 1 << 4,
0057     IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
0058     IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
0059     IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
0060 
0061     IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,
0062     IB_UVERBS_ACCESS_OPTIONAL_RANGE =
0063         ((IB_UVERBS_ACCESS_OPTIONAL_LAST << 1) - 1) &
0064         ~(IB_UVERBS_ACCESS_OPTIONAL_FIRST - 1)
0065 };
0066 
0067 enum ib_uverbs_srq_type {
0068     IB_UVERBS_SRQT_BASIC,
0069     IB_UVERBS_SRQT_XRC,
0070     IB_UVERBS_SRQT_TM,
0071 };
0072 
0073 enum ib_uverbs_wq_type {
0074     IB_UVERBS_WQT_RQ,
0075 };
0076 
0077 enum ib_uverbs_wq_flags {
0078     IB_UVERBS_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0,
0079     IB_UVERBS_WQ_FLAGS_SCATTER_FCS = 1 << 1,
0080     IB_UVERBS_WQ_FLAGS_DELAY_DROP = 1 << 2,
0081     IB_UVERBS_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3,
0082 };
0083 
0084 enum ib_uverbs_qp_type {
0085     IB_UVERBS_QPT_RC = 2,
0086     IB_UVERBS_QPT_UC,
0087     IB_UVERBS_QPT_UD,
0088     IB_UVERBS_QPT_RAW_PACKET = 8,
0089     IB_UVERBS_QPT_XRC_INI,
0090     IB_UVERBS_QPT_XRC_TGT,
0091     IB_UVERBS_QPT_DRIVER = 0xFF,
0092 };
0093 
0094 enum ib_uverbs_qp_create_flags {
0095     IB_UVERBS_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1,
0096     IB_UVERBS_QP_CREATE_SCATTER_FCS = 1 << 8,
0097     IB_UVERBS_QP_CREATE_CVLAN_STRIPPING = 1 << 9,
0098     IB_UVERBS_QP_CREATE_PCI_WRITE_END_PADDING = 1 << 11,
0099     IB_UVERBS_QP_CREATE_SQ_SIG_ALL = 1 << 12,
0100 };
0101 
0102 enum ib_uverbs_query_port_cap_flags {
0103     IB_UVERBS_PCF_SM = 1 << 1,
0104     IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,
0105     IB_UVERBS_PCF_TRAP_SUP = 1 << 3,
0106     IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,
0107     IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,
0108     IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,
0109     IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,
0110     IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,
0111     IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,
0112     IB_UVERBS_PCF_SM_DISABLED = 1 << 10,
0113     IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,
0114     IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
0115     IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,
0116     IB_UVERBS_PCF_CM_SUP = 1 << 16,
0117     IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,
0118     IB_UVERBS_PCF_REINIT_SUP = 1 << 18,
0119     IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,
0120     IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,
0121     IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,
0122     IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,
0123     IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,
0124     IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,
0125     IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,
0126     /*
0127      * IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and
0128      * is inaccessible
0129      */
0130     IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,
0131     IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,
0132     IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,
0133     IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,
0134     IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,
0135 
0136     /* NOTE this is an internal flag, not an IBA flag */
0137     IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,
0138 };
0139 
0140 enum ib_uverbs_query_port_flags {
0141     IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,
0142 };
0143 
0144 enum ib_uverbs_flow_action_esp_keymat {
0145     IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
0146 };
0147 
0148 enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {
0149     IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,
0150 };
0151 
0152 struct ib_uverbs_flow_action_esp_keymat_aes_gcm {
0153     __aligned_u64   iv;
0154     __u32       iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */
0155 
0156     __u32       salt;
0157     __u32       icv_len;
0158 
0159     __u32       key_len;
0160     __u32       aes_key[256 / 32];
0161 };
0162 
0163 enum ib_uverbs_flow_action_esp_replay {
0164     IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,
0165     IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,
0166 };
0167 
0168 struct ib_uverbs_flow_action_esp_replay_bmp {
0169     __u32   size;
0170 };
0171 
0172 enum ib_uverbs_flow_action_esp_flags {
0173     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO   = 0UL << 0, /* Default */
0174     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD    = 1UL << 0,
0175 
0176     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL      = 0UL << 1, /* Default */
0177     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT   = 1UL << 1,
0178 
0179     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT     = 0UL << 2, /* Default */
0180     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT     = 1UL << 2,
0181 
0182     IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW  = 1UL << 3,
0183 };
0184 
0185 struct ib_uverbs_flow_action_esp_encap {
0186     /* This struct represents a list of pointers to flow_xxxx_filter that
0187      * encapsulates the payload in ESP tunnel mode.
0188      */
0189     RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */
0190     RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);
0191     __u16   len;        /* Len of the filter struct val_ptr points to */
0192     __u16   type;       /* Use flow_spec_type enum */
0193 };
0194 
0195 struct ib_uverbs_flow_action_esp {
0196     __u32       spi;
0197     __u32       seq;
0198     __u32       tfc_pad;
0199     __u32       flags;
0200     __aligned_u64   hard_limit_pkts;
0201 };
0202 
0203 enum ib_uverbs_read_counters_flags {
0204     /* prefer read values from driver cache */
0205     IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,
0206 };
0207 
0208 enum ib_uverbs_advise_mr_advice {
0209     IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH,
0210     IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,
0211     IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_NO_FAULT,
0212 };
0213 
0214 enum ib_uverbs_advise_mr_flag {
0215     IB_UVERBS_ADVISE_MR_FLAG_FLUSH = 1 << 0,
0216 };
0217 
0218 struct ib_uverbs_query_port_resp_ex {
0219     struct ib_uverbs_query_port_resp legacy_resp;
0220     __u16 port_cap_flags2;
0221     __u8  reserved[6];
0222 };
0223 
0224 struct ib_uverbs_qp_cap {
0225     __u32 max_send_wr;
0226     __u32 max_recv_wr;
0227     __u32 max_send_sge;
0228     __u32 max_recv_sge;
0229     __u32 max_inline_data;
0230 };
0231 
0232 enum rdma_driver_id {
0233     RDMA_DRIVER_UNKNOWN,
0234     RDMA_DRIVER_MLX5,
0235     RDMA_DRIVER_MLX4,
0236     RDMA_DRIVER_CXGB3,
0237     RDMA_DRIVER_CXGB4,
0238     RDMA_DRIVER_MTHCA,
0239     RDMA_DRIVER_BNXT_RE,
0240     RDMA_DRIVER_OCRDMA,
0241     RDMA_DRIVER_NES,
0242     RDMA_DRIVER_I40IW,
0243     RDMA_DRIVER_IRDMA = RDMA_DRIVER_I40IW,
0244     RDMA_DRIVER_VMW_PVRDMA,
0245     RDMA_DRIVER_QEDR,
0246     RDMA_DRIVER_HNS,
0247     RDMA_DRIVER_USNIC,
0248     RDMA_DRIVER_RXE,
0249     RDMA_DRIVER_HFI1,
0250     RDMA_DRIVER_QIB,
0251     RDMA_DRIVER_EFA,
0252     RDMA_DRIVER_SIW,
0253     RDMA_DRIVER_ERDMA,
0254 };
0255 
0256 enum ib_uverbs_gid_type {
0257     IB_UVERBS_GID_TYPE_IB,
0258     IB_UVERBS_GID_TYPE_ROCE_V1,
0259     IB_UVERBS_GID_TYPE_ROCE_V2,
0260 };
0261 
0262 struct ib_uverbs_gid_entry {
0263     __aligned_u64 gid[2];
0264     __u32 gid_index;
0265     __u32 port_num;
0266     __u32 gid_type;
0267     __u32 netdev_ifindex; /* It is 0 if there is no netdev associated with it */
0268 };
0269 
0270 #endif