Path: blob/main/sys/ofed/include/uapi/rdma/ib_user_ioctl_verbs.h
39488 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,5960IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,61IB_UVERBS_ACCESS_OPTIONAL_RANGE =62((IB_UVERBS_ACCESS_OPTIONAL_LAST << 1) - 1) &63~(IB_UVERBS_ACCESS_OPTIONAL_FIRST - 1)64};6566enum ib_uverbs_query_port_cap_flags {67IB_UVERBS_PCF_SM = 1 << 1,68IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,69IB_UVERBS_PCF_TRAP_SUP = 1 << 3,70IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,71IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,72IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,73IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,74IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,75IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,76IB_UVERBS_PCF_SM_DISABLED = 1 << 10,77IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,78IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,79IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,80IB_UVERBS_PCF_CM_SUP = 1 << 16,81IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,82IB_UVERBS_PCF_REINIT_SUP = 1 << 18,83IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,84IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,85IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,86IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,87IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,88IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,89IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,90/*91* IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and92* is inaccessible93*/94IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,95IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,96IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,97IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,98IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,99100/* NOTE this is an internal flag, not an IBA flag */101IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,102};103104enum ib_uverbs_query_port_flags {105IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,106};107108enum ib_uverbs_flow_action_esp_keymat {109IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,110};111112enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {113IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,114};115116struct ib_uverbs_flow_action_esp_keymat_aes_gcm {117__aligned_u64 iv;118__u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */119120__u32 salt;121__u32 icv_len;122123__u32 key_len;124__u32 aes_key[256 / 32];125};126127enum ib_uverbs_flow_action_esp_replay {128IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,129IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,130};131132struct ib_uverbs_flow_action_esp_replay_bmp {133__u32 size;134};135136enum ib_uverbs_flow_action_esp_flags {137IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */138IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,139140IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */141IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,142143IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */144IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,145146IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,147};148149struct ib_uverbs_flow_action_esp_encap {150/* This struct represents a list of pointers to flow_xxxx_filter that151* encapsulates the payload in ESP tunnel mode.152*/153RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */154RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);155__u16 len; /* Len of the filter struct val_ptr points to */156__u16 type; /* Use flow_spec_type enum */157};158159struct ib_uverbs_flow_action_esp {160__u32 spi;161__u32 seq;162__u32 tfc_pad;163__u32 flags;164__aligned_u64 hard_limit_pkts;165};166167enum ib_uverbs_read_counters_flags {168/* prefer read values from driver cache */169IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,170};171172enum ib_uverbs_advise_mr_advice {173IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH,174IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,175};176177enum ib_uverbs_advise_mr_flag {178IB_UVERBS_ADVISE_MR_FLAG_FLUSH = 1 << 0,179};180181struct ib_uverbs_query_port_resp_ex {182struct ib_uverbs_query_port_resp legacy_resp;183__u16 port_cap_flags2;184__u8 reserved[6];185};186187enum rdma_driver_id {188RDMA_DRIVER_UNKNOWN,189RDMA_DRIVER_MLX5,190RDMA_DRIVER_MLX4,191RDMA_DRIVER_CXGB3,192RDMA_DRIVER_CXGB4,193RDMA_DRIVER_MTHCA,194RDMA_DRIVER_BNXT_RE,195RDMA_DRIVER_OCRDMA,196RDMA_DRIVER_NES,197RDMA_DRIVER_I40IW,198RDMA_DRIVER_VMW_PVRDMA,199RDMA_DRIVER_QEDR,200RDMA_DRIVER_HNS,201RDMA_DRIVER_USNIC,202RDMA_DRIVER_RXE,203RDMA_DRIVER_HFI1,204RDMA_DRIVER_QIB,205RDMA_DRIVER_EFA,206RDMA_DRIVER_SIW,207RDMA_DRIVER_QLNXR,208};209210#endif211212213