Path: blob/master/include/uapi/rdma/ib_user_ioctl_verbs.h
26288 views
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */1/*2* Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved.3*4* This software is available to you under a choice of one of two5* licenses. You may choose to be licensed under the terms of the GNU6* General Public License (GPL) Version 2, available from the file7* COPYING in the main directory of this source tree, or the8* OpenIB.org BSD license below:9*10* Redistribution and use in source and binary forms, with or11* without modification, are permitted provided that the following12* conditions are met:13*14* - Redistributions of source code must retain the above15* copyright notice, this list of conditions and the following16* disclaimer.17*18* - Redistributions in binary form must reproduce the above19* copyright notice, this list of conditions and the following20* disclaimer in the documentation and/or other materials21* provided with the distribution.22*23* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,24* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF25* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND26* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS27* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN28* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN29* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE30* SOFTWARE.31*/3233#ifndef IB_USER_IOCTL_VERBS_H34#define IB_USER_IOCTL_VERBS_H3536#include <linux/types.h>37#include <rdma/ib_user_verbs.h>3839#ifndef RDMA_UAPI_PTR40#define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name41#endif4243#define IB_UVERBS_ACCESS_OPTIONAL_FIRST (1 << 20)44#define IB_UVERBS_ACCESS_OPTIONAL_LAST (1 << 29)4546enum ib_uverbs_core_support {47IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS = 1 << 0,48};4950enum ib_uverbs_access_flags {51IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,52IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,53IB_UVERBS_ACCESS_REMOTE_READ = 1 << 2,54IB_UVERBS_ACCESS_REMOTE_ATOMIC = 1 << 3,55IB_UVERBS_ACCESS_MW_BIND = 1 << 4,56IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,57IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,58IB_UVERBS_ACCESS_HUGETLB = 1 << 7,59IB_UVERBS_ACCESS_FLUSH_GLOBAL = 1 << 8,60IB_UVERBS_ACCESS_FLUSH_PERSISTENT = 1 << 9,6162IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,63IB_UVERBS_ACCESS_OPTIONAL_RANGE =64((IB_UVERBS_ACCESS_OPTIONAL_LAST << 1) - 1) &65~(IB_UVERBS_ACCESS_OPTIONAL_FIRST - 1)66};6768enum ib_uverbs_srq_type {69IB_UVERBS_SRQT_BASIC,70IB_UVERBS_SRQT_XRC,71IB_UVERBS_SRQT_TM,72};7374enum ib_uverbs_wq_type {75IB_UVERBS_WQT_RQ,76};7778enum ib_uverbs_wq_flags {79IB_UVERBS_WQ_FLAGS_CVLAN_STRIPPING = 1 << 0,80IB_UVERBS_WQ_FLAGS_SCATTER_FCS = 1 << 1,81IB_UVERBS_WQ_FLAGS_DELAY_DROP = 1 << 2,82IB_UVERBS_WQ_FLAGS_PCI_WRITE_END_PADDING = 1 << 3,83};8485enum ib_uverbs_qp_type {86IB_UVERBS_QPT_RC = 2,87IB_UVERBS_QPT_UC,88IB_UVERBS_QPT_UD,89IB_UVERBS_QPT_RAW_PACKET = 8,90IB_UVERBS_QPT_XRC_INI,91IB_UVERBS_QPT_XRC_TGT,92IB_UVERBS_QPT_DRIVER = 0xFF,93};9495enum ib_uverbs_qp_create_flags {96IB_UVERBS_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1,97IB_UVERBS_QP_CREATE_SCATTER_FCS = 1 << 8,98IB_UVERBS_QP_CREATE_CVLAN_STRIPPING = 1 << 9,99IB_UVERBS_QP_CREATE_PCI_WRITE_END_PADDING = 1 << 11,100IB_UVERBS_QP_CREATE_SQ_SIG_ALL = 1 << 12,101};102103enum ib_uverbs_query_port_cap_flags {104IB_UVERBS_PCF_SM = 1 << 1,105IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,106IB_UVERBS_PCF_TRAP_SUP = 1 << 3,107IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,108IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,109IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,110IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,111IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,112IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,113IB_UVERBS_PCF_SM_DISABLED = 1 << 10,114IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,115IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,116IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,117IB_UVERBS_PCF_CM_SUP = 1 << 16,118IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,119IB_UVERBS_PCF_REINIT_SUP = 1 << 18,120IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,121IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,122IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,123IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,124IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,125IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,126IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,127/*128* IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and129* is inaccessible130*/131IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,132IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,133IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,134IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,135IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,136137/* NOTE this is an internal flag, not an IBA flag */138IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,139};140141enum ib_uverbs_query_port_flags {142IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,143};144145enum ib_uverbs_flow_action_esp_keymat {146IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,147};148149enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {150IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,151};152153struct ib_uverbs_flow_action_esp_keymat_aes_gcm {154__aligned_u64 iv;155__u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */156157__u32 salt;158__u32 icv_len;159160__u32 key_len;161__u32 aes_key[256 / 32];162};163164enum ib_uverbs_flow_action_esp_replay {165IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,166IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,167};168169struct ib_uverbs_flow_action_esp_replay_bmp {170__u32 size;171};172173enum ib_uverbs_flow_action_esp_flags {174IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */175IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,176177IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */178IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,179180IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */181IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,182183IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,184};185186struct ib_uverbs_flow_action_esp_encap {187/* This struct represents a list of pointers to flow_xxxx_filter that188* encapsulates the payload in ESP tunnel mode.189*/190RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */191RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);192__u16 len; /* Len of the filter struct val_ptr points to */193__u16 type; /* Use flow_spec_type enum */194};195196struct ib_uverbs_flow_action_esp {197__u32 spi;198__u32 seq;199__u32 tfc_pad;200__u32 flags;201__aligned_u64 hard_limit_pkts;202};203204enum ib_uverbs_read_counters_flags {205/* prefer read values from driver cache */206IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,207};208209enum ib_uverbs_advise_mr_advice {210IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH,211IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,212IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_NO_FAULT,213};214215enum ib_uverbs_advise_mr_flag {216IB_UVERBS_ADVISE_MR_FLAG_FLUSH = 1 << 0,217};218219struct ib_uverbs_query_port_resp_ex {220struct ib_uverbs_query_port_resp legacy_resp;221__u16 port_cap_flags2;222__u8 reserved[2];223__u32 active_speed_ex;224};225226struct ib_uverbs_qp_cap {227__u32 max_send_wr;228__u32 max_recv_wr;229__u32 max_send_sge;230__u32 max_recv_sge;231__u32 max_inline_data;232};233234enum rdma_driver_id {235RDMA_DRIVER_UNKNOWN,236RDMA_DRIVER_MLX5,237RDMA_DRIVER_MLX4,238RDMA_DRIVER_CXGB3,239RDMA_DRIVER_CXGB4,240RDMA_DRIVER_MTHCA,241RDMA_DRIVER_BNXT_RE,242RDMA_DRIVER_OCRDMA,243RDMA_DRIVER_NES,244RDMA_DRIVER_I40IW,245RDMA_DRIVER_IRDMA = RDMA_DRIVER_I40IW,246RDMA_DRIVER_VMW_PVRDMA,247RDMA_DRIVER_QEDR,248RDMA_DRIVER_HNS,249RDMA_DRIVER_USNIC,250RDMA_DRIVER_RXE,251RDMA_DRIVER_HFI1,252RDMA_DRIVER_QIB,253RDMA_DRIVER_EFA,254RDMA_DRIVER_SIW,255RDMA_DRIVER_ERDMA,256RDMA_DRIVER_MANA,257};258259enum ib_uverbs_gid_type {260IB_UVERBS_GID_TYPE_IB,261IB_UVERBS_GID_TYPE_ROCE_V1,262IB_UVERBS_GID_TYPE_ROCE_V2,263};264265struct ib_uverbs_gid_entry {266__aligned_u64 gid[2];267__u32 gid_index;268__u32 port_num;269__u32 gid_type;270__u32 netdev_ifindex; /* It is 0 if there is no netdev associated with it */271};272273#endif274275276