Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/virtchnl.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
* we must send all messages as "indirect", i.e. using an external buffer. | * we must send all messages as "indirect", i.e. using an external buffer. | ||||
* | * | ||||
* All the VSI indexes are relative to the VF. Each VF can have maximum of | * All the VSI indexes are relative to the VF. Each VF can have maximum of | ||||
* three VSIs. All the queue indexes are relative to the VSI. Each VF can | * three VSIs. All the queue indexes are relative to the VSI. Each VF can | ||||
* have a maximum of sixteen queues for all of its VSIs. | * have a maximum of sixteen queues for all of its VSIs. | ||||
* | * | ||||
* The PF is required to return a status code in v_retval for all messages | * The PF is required to return a status code in v_retval for all messages | ||||
* except RESET_VF, which does not require any response. The returned value | * except RESET_VF, which does not require any response. The returned value | ||||
* is of virtchnl_status_code type, defined in the shared type.h. | * is of virtchnl_status_code type, defined here. | ||||
* | * | ||||
* In general, VF driver initialization should roughly follow the order of | * In general, VF driver initialization should roughly follow the order of | ||||
* these opcodes. The VF driver must first validate the API version of the | * these opcodes. The VF driver must first validate the API version of the | ||||
* PF driver, then request a reset, then get resources, then configure | * PF driver, then request a reset, then get resources, then configure | ||||
* queues and interrupts. After these operations are complete, the VF | * queues and interrupts. After these operations are complete, the VF | ||||
* driver may start its queues, optionally add MAC and VLAN filters, and | * driver may start its queues, optionally add MAC and VLAN filters, and | ||||
* process traffic. | * process traffic. | ||||
*/ | */ | ||||
/* START GENERIC DEFINES | /* START GENERIC DEFINES | ||||
* Need to ensure the following enums and defines hold the same meaning and | * Need to ensure the following enums and defines hold the same meaning and | ||||
* value in current and future projects | * value in current and future projects | ||||
*/ | */ | ||||
/* Error Codes */ | #define VIRTCHNL_ETH_LENGTH_OF_ADDRESS 6 | ||||
/* These macros are used to generate compilation errors if a structure/union | |||||
* is not exactly the correct length. It gives a divide by zero error if the | |||||
* structure/union is not of the correct size, otherwise it creates an enum | |||||
* that is never used. | |||||
*/ | |||||
#define VIRTCHNL_CHECK_STRUCT_LEN(n, X) enum virtchnl_static_assert_enum_##X \ | |||||
{ virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } | |||||
#define VIRTCHNL_CHECK_UNION_LEN(n, X) enum virtchnl_static_asset_enum_##X \ | |||||
{ virtchnl_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) } | |||||
/* Error Codes | |||||
* Note that many older versions of various iAVF drivers convert the reported | |||||
* status code directly into an iavf_status enumeration. For this reason, it | |||||
* is important that the values of these enumerations line up. | |||||
*/ | |||||
enum virtchnl_status_code { | enum virtchnl_status_code { | ||||
VIRTCHNL_STATUS_SUCCESS = 0, | VIRTCHNL_STATUS_SUCCESS = 0, | ||||
VIRTCHNL_STATUS_ERR_PARAM = -5, | VIRTCHNL_STATUS_ERR_PARAM = -5, | ||||
VIRTCHNL_STATUS_ERR_NO_MEMORY = -18, | VIRTCHNL_STATUS_ERR_NO_MEMORY = -18, | ||||
VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38, | VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38, | ||||
VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39, | VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39, | ||||
VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40, | VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40, | ||||
VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53, | VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53, | ||||
Show All 30 Lines | |||||
enum virtchnl_rx_hsplit { | enum virtchnl_rx_hsplit { | ||||
VIRTCHNL_RX_HSPLIT_NO_SPLIT = 0, | VIRTCHNL_RX_HSPLIT_NO_SPLIT = 0, | ||||
VIRTCHNL_RX_HSPLIT_SPLIT_L2 = 1, | VIRTCHNL_RX_HSPLIT_SPLIT_L2 = 1, | ||||
VIRTCHNL_RX_HSPLIT_SPLIT_IP = 2, | VIRTCHNL_RX_HSPLIT_SPLIT_IP = 2, | ||||
VIRTCHNL_RX_HSPLIT_SPLIT_TCP_UDP = 4, | VIRTCHNL_RX_HSPLIT_SPLIT_TCP_UDP = 4, | ||||
VIRTCHNL_RX_HSPLIT_SPLIT_SCTP = 8, | VIRTCHNL_RX_HSPLIT_SPLIT_SCTP = 8, | ||||
}; | }; | ||||
#define VIRTCHNL_ETH_LENGTH_OF_ADDRESS 6 | enum virtchnl_bw_limit_type { | ||||
VIRTCHNL_BW_SHAPER = 0, | |||||
}; | |||||
/* END GENERIC DEFINES */ | /* END GENERIC DEFINES */ | ||||
/* Opcodes for VF-PF communication. These are placed in the v_opcode field | /* Opcodes for VF-PF communication. These are placed in the v_opcode field | ||||
* of the virtchnl_msg structure. | * of the virtchnl_msg structure. | ||||
*/ | */ | ||||
enum virtchnl_ops { | enum virtchnl_ops { | ||||
/* The PF sends status change events to VFs using | /* The PF sends status change events to VFs using | ||||
* the VIRTCHNL_OP_EVENT opcode. | * the VIRTCHNL_OP_EVENT opcode. | ||||
* VFs send requests to the PF using the other ops. | * VFs send requests to the PF using the other ops. | ||||
* Use of "advanced opcode" features must be negotiated as part of capabilities | * Use of "advanced opcode" features must be negotiated as part of capabilities | ||||
* exchange and are not considered part of base mode feature set. | * exchange and are not considered part of base mode feature set. | ||||
* | |||||
*/ | */ | ||||
VIRTCHNL_OP_UNKNOWN = 0, | VIRTCHNL_OP_UNKNOWN = 0, | ||||
VIRTCHNL_OP_VERSION = 1, /* must ALWAYS be 1 */ | VIRTCHNL_OP_VERSION = 1, /* must ALWAYS be 1 */ | ||||
VIRTCHNL_OP_RESET_VF = 2, | VIRTCHNL_OP_RESET_VF = 2, | ||||
VIRTCHNL_OP_GET_VF_RESOURCES = 3, | VIRTCHNL_OP_GET_VF_RESOURCES = 3, | ||||
VIRTCHNL_OP_CONFIG_TX_QUEUE = 4, | VIRTCHNL_OP_CONFIG_TX_QUEUE = 4, | ||||
VIRTCHNL_OP_CONFIG_RX_QUEUE = 5, | VIRTCHNL_OP_CONFIG_RX_QUEUE = 5, | ||||
VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6, | VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6, | ||||
Show All 19 Lines | */ | ||||
VIRTCHNL_OP_REQUEST_QUEUES = 29, | VIRTCHNL_OP_REQUEST_QUEUES = 29, | ||||
VIRTCHNL_OP_ENABLE_CHANNELS = 30, | VIRTCHNL_OP_ENABLE_CHANNELS = 30, | ||||
VIRTCHNL_OP_DISABLE_CHANNELS = 31, | VIRTCHNL_OP_DISABLE_CHANNELS = 31, | ||||
VIRTCHNL_OP_ADD_CLOUD_FILTER = 32, | VIRTCHNL_OP_ADD_CLOUD_FILTER = 32, | ||||
VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, | VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, | ||||
/* opcode 34 is reserved */ | /* opcode 34 is reserved */ | ||||
/* opcodes 38, 39, 40, 41, 42 and 43 are reserved */ | /* opcodes 38, 39, 40, 41, 42 and 43 are reserved */ | ||||
/* opcode 44 is reserved */ | /* opcode 44 is reserved */ | ||||
/* opcode 45, 46, 47, 48 and 49 are reserved */ | VIRTCHNL_OP_ADD_RSS_CFG = 45, | ||||
VIRTCHNL_OP_DEL_RSS_CFG = 46, | |||||
VIRTCHNL_OP_ADD_FDIR_FILTER = 47, | |||||
VIRTCHNL_OP_DEL_FDIR_FILTER = 48, | |||||
VIRTCHNL_OP_GET_MAX_RSS_QREGION = 50, | VIRTCHNL_OP_GET_MAX_RSS_QREGION = 50, | ||||
VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS = 51, | VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS = 51, | ||||
VIRTCHNL_OP_ADD_VLAN_V2 = 52, | VIRTCHNL_OP_ADD_VLAN_V2 = 52, | ||||
VIRTCHNL_OP_DEL_VLAN_V2 = 53, | VIRTCHNL_OP_DEL_VLAN_V2 = 53, | ||||
VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 = 54, | VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 = 54, | ||||
VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 = 55, | VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 = 55, | ||||
VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 = 56, | VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 = 56, | ||||
VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2 = 57, | VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2 = 57, | ||||
VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2 = 58, | VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2 = 58, | ||||
VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 = 59, | VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 = 59, | ||||
/* opcodes 60 through 69 are reserved */ | /* opcodes 60 through 65 are reserved */ | ||||
VIRTCHNL_OP_GET_QOS_CAPS = 66, | |||||
VIRTCHNL_OP_CONFIG_QUEUE_TC_MAP = 67, | |||||
/* opcode 68, 69 are reserved */ | |||||
VIRTCHNL_OP_ENABLE_QUEUES_V2 = 107, | VIRTCHNL_OP_ENABLE_QUEUES_V2 = 107, | ||||
VIRTCHNL_OP_DISABLE_QUEUES_V2 = 108, | VIRTCHNL_OP_DISABLE_QUEUES_V2 = 108, | ||||
VIRTCHNL_OP_MAP_QUEUE_VECTOR = 111, | VIRTCHNL_OP_MAP_QUEUE_VECTOR = 111, | ||||
VIRTCHNL_OP_MAX, | VIRTCHNL_OP_MAX, | ||||
}; | }; | ||||
static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode) | static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode) | ||||
case VIRTCHNL_OP_ENABLE_CHANNELS: | case VIRTCHNL_OP_ENABLE_CHANNELS: | ||||
return "VIRTCHNL_OP_ENABLE_CHANNELS"; | return "VIRTCHNL_OP_ENABLE_CHANNELS"; | ||||
case VIRTCHNL_OP_DISABLE_CHANNELS: | case VIRTCHNL_OP_DISABLE_CHANNELS: | ||||
return "VIRTCHNL_OP_DISABLE_CHANNELS"; | return "VIRTCHNL_OP_DISABLE_CHANNELS"; | ||||
case VIRTCHNL_OP_ADD_CLOUD_FILTER: | case VIRTCHNL_OP_ADD_CLOUD_FILTER: | ||||
return "VIRTCHNL_OP_ADD_CLOUD_FILTER"; | return "VIRTCHNL_OP_ADD_CLOUD_FILTER"; | ||||
case VIRTCHNL_OP_DEL_CLOUD_FILTER: | case VIRTCHNL_OP_DEL_CLOUD_FILTER: | ||||
return "VIRTCHNL_OP_DEL_CLOUD_FILTER"; | return "VIRTCHNL_OP_DEL_CLOUD_FILTER"; | ||||
case VIRTCHNL_OP_ADD_RSS_CFG: | |||||
return "VIRTCHNL_OP_ADD_RSS_CFG"; | |||||
case VIRTCHNL_OP_DEL_RSS_CFG: | |||||
return "VIRTCHNL_OP_DEL_RSS_CFG"; | |||||
case VIRTCHNL_OP_ADD_FDIR_FILTER: | |||||
return "VIRTCHNL_OP_ADD_FDIR_FILTER"; | |||||
case VIRTCHNL_OP_DEL_FDIR_FILTER: | |||||
return "VIRTCHNL_OP_DEL_FDIR_FILTER"; | |||||
case VIRTCHNL_OP_GET_MAX_RSS_QREGION: | case VIRTCHNL_OP_GET_MAX_RSS_QREGION: | ||||
return "VIRTCHNL_OP_GET_MAX_RSS_QREGION"; | return "VIRTCHNL_OP_GET_MAX_RSS_QREGION"; | ||||
case VIRTCHNL_OP_ENABLE_QUEUES_V2: | case VIRTCHNL_OP_ENABLE_QUEUES_V2: | ||||
return "VIRTCHNL_OP_ENABLE_QUEUES_V2"; | return "VIRTCHNL_OP_ENABLE_QUEUES_V2"; | ||||
case VIRTCHNL_OP_DISABLE_QUEUES_V2: | case VIRTCHNL_OP_DISABLE_QUEUES_V2: | ||||
return "VIRTCHNL_OP_DISABLE_QUEUES_V2"; | return "VIRTCHNL_OP_DISABLE_QUEUES_V2"; | ||||
case VIRTCHNL_OP_MAP_QUEUE_VECTOR: | case VIRTCHNL_OP_MAP_QUEUE_VECTOR: | ||||
return "VIRTCHNL_OP_MAP_QUEUE_VECTOR"; | return "VIRTCHNL_OP_MAP_QUEUE_VECTOR"; | ||||
Show All 17 Lines | case VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2: | ||||
return "VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2"; | return "VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2"; | ||||
case VIRTCHNL_OP_MAX: | case VIRTCHNL_OP_MAX: | ||||
return "VIRTCHNL_OP_MAX"; | return "VIRTCHNL_OP_MAX"; | ||||
default: | default: | ||||
return "Unsupported (update virtchnl.h)"; | return "Unsupported (update virtchnl.h)"; | ||||
} | } | ||||
} | } | ||||
/* These macros are used to generate compilation errors if a structure/union | static inline const char *virtchnl_stat_str(enum virtchnl_status_code v_status) | ||||
* is not exactly the correct length. It gives a divide by zero error if the | { | ||||
* structure/union is not of the correct size, otherwise it creates an enum | switch (v_status) { | ||||
* that is never used. | case VIRTCHNL_STATUS_SUCCESS: | ||||
*/ | return "VIRTCHNL_STATUS_SUCCESS"; | ||||
#define VIRTCHNL_CHECK_STRUCT_LEN(n, X) enum virtchnl_static_assert_enum_##X \ | case VIRTCHNL_STATUS_ERR_PARAM: | ||||
{ virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } | return "VIRTCHNL_STATUS_ERR_PARAM"; | ||||
#define VIRTCHNL_CHECK_UNION_LEN(n, X) enum virtchnl_static_asset_enum_##X \ | case VIRTCHNL_STATUS_ERR_NO_MEMORY: | ||||
{ virtchnl_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) } | return "VIRTCHNL_STATUS_ERR_NO_MEMORY"; | ||||
case VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH: | |||||
return "VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH"; | |||||
case VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR: | |||||
return "VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR"; | |||||
case VIRTCHNL_STATUS_ERR_INVALID_VF_ID: | |||||
return "VIRTCHNL_STATUS_ERR_INVALID_VF_ID"; | |||||
case VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR: | |||||
return "VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR"; | |||||
case VIRTCHNL_STATUS_ERR_NOT_SUPPORTED: | |||||
return "VIRTCHNL_STATUS_ERR_NOT_SUPPORTED"; | |||||
default: | |||||
return "Unknown status code (update virtchnl.h)"; | |||||
} | |||||
} | |||||
/* Virtual channel message descriptor. This overlays the admin queue | /* Virtual channel message descriptor. This overlays the admin queue | ||||
* descriptor. All other data is passed in external buffers. | * descriptor. All other data is passed in external buffers. | ||||
*/ | */ | ||||
struct virtchnl_msg { | struct virtchnl_msg { | ||||
u8 pad[8]; /* AQ flags/opcode/len/retval fields */ | u8 pad[8]; /* AQ flags/opcode/len/retval fields */ | ||||
Show All 29 Lines | |||||
struct virtchnl_version_info { | struct virtchnl_version_info { | ||||
u32 major; | u32 major; | ||||
u32 minor; | u32 minor; | ||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_version_info); | VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_version_info); | ||||
#define VF_IS_V10(_v) (((_v)->major == 1) && ((_v)->minor == 0)) | #define VF_IS_V10(_ver) (((_ver)->major == 1) && ((_ver)->minor == 0)) | ||||
#define VF_IS_V11(_ver) (((_ver)->major == 1) && ((_ver)->minor == 1)) | #define VF_IS_V11(_ver) (((_ver)->major == 1) && ((_ver)->minor == 1)) | ||||
#define VF_IS_V20(_ver) (((_ver)->major == 2) && ((_ver)->minor == 0)) | |||||
/* VIRTCHNL_OP_RESET_VF | /* VIRTCHNL_OP_RESET_VF | ||||
* VF sends this request to PF with no parameters | * VF sends this request to PF with no parameters | ||||
* PF does NOT respond! VF driver must delay then poll VFGEN_RSTAT register | * PF does NOT respond! VF driver must delay then poll VFGEN_RSTAT register | ||||
* until reset completion is indicated. The admin queue must be reinitialized | * until reset completion is indicated. The admin queue must be reinitialized | ||||
* after this operation. | * after this operation. | ||||
* | * | ||||
* When reset is complete, PF must ensure that all queues in all VSIs associated | * When reset is complete, PF must ensure that all queues in all VSIs associated | ||||
Show All 30 Lines | |||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource); | VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource); | ||||
/* VF capability flags | /* VF capability flags | ||||
* VIRTCHNL_VF_OFFLOAD_L2 flag is inclusive of base mode L2 offloads including | * VIRTCHNL_VF_OFFLOAD_L2 flag is inclusive of base mode L2 offloads including | ||||
* TX/RX Checksum offloading and TSO for non-tunnelled packets. | * TX/RX Checksum offloading and TSO for non-tunnelled packets. | ||||
*/ | */ | ||||
#define VIRTCHNL_VF_OFFLOAD_L2 0x00000001 | #define VIRTCHNL_VF_OFFLOAD_L2 BIT(0) | ||||
#define VIRTCHNL_VF_OFFLOAD_IWARP 0x00000002 | #define VIRTCHNL_VF_OFFLOAD_IWARP BIT(1) | ||||
#define VIRTCHNL_VF_OFFLOAD_RSVD 0x00000004 | #define VIRTCHNL_VF_CAP_RDMA VIRTCHNL_VF_OFFLOAD_IWARP | ||||
#define VIRTCHNL_VF_OFFLOAD_RSS_AQ 0x00000008 | #define VIRTCHNL_VF_OFFLOAD_RSS_AQ BIT(3) | ||||
#define VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010 | #define VIRTCHNL_VF_OFFLOAD_RSS_REG BIT(4) | ||||
#define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR 0x00000020 | #define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR BIT(5) | ||||
#define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES 0x00000040 | #define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES BIT(6) | ||||
#define VIRTCHNL_VF_OFFLOAD_CRC 0x00000080 | /* used to negotiate communicating link speeds in Mbps */ | ||||
/* 0X00000100 is reserved */ | #define VIRTCHNL_VF_CAP_ADV_LINK_SPEED BIT(7) | ||||
#define VIRTCHNL_VF_LARGE_NUM_QPAIRS 0x00000200 | /* BIT(8) is reserved */ | ||||
#define VIRTCHNL_VF_OFFLOAD_VLAN_V2 0x00008000 | #define VIRTCHNL_VF_LARGE_NUM_QPAIRS BIT(9) | ||||
#define VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000 | #define VIRTCHNL_VF_OFFLOAD_CRC BIT(10) | ||||
#define VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000 | #define VIRTCHNL_VF_OFFLOAD_VLAN_V2 BIT(15) | ||||
#define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000 | #define VIRTCHNL_VF_OFFLOAD_VLAN BIT(16) | ||||
#define VIRTCHNL_VF_OFFLOAD_RSS_PF 0X00080000 | #define VIRTCHNL_VF_OFFLOAD_RX_POLLING BIT(17) | ||||
#define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000 | #define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 BIT(18) | ||||
#define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000 | #define VIRTCHNL_VF_OFFLOAD_RSS_PF BIT(19) | ||||
#define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 | #define VIRTCHNL_VF_OFFLOAD_ENCAP BIT(20) | ||||
#define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 | #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM BIT(21) | ||||
#define VIRTCHNL_VF_OFFLOAD_ADQ_V2 0X01000000 | #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM BIT(22) | ||||
#define VIRTCHNL_VF_OFFLOAD_USO 0X02000000 | #define VIRTCHNL_VF_OFFLOAD_ADQ BIT(23) | ||||
/* 0x04000000 is reserved */ | #define VIRTCHNL_VF_OFFLOAD_ADQ_V2 BIT(24) | ||||
/* 0X08000000 and 0X10000000 are reserved */ | #define VIRTCHNL_VF_OFFLOAD_USO BIT(25) | ||||
/* 0X20000000 is reserved */ | /* BIT(26) is reserved */ | ||||
/* 0X40000000 is reserved */ | #define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF BIT(27) | ||||
/* 0X80000000 is reserved */ | #define VIRTCHNL_VF_OFFLOAD_FDIR_PF BIT(28) | ||||
#define VIRTCHNL_VF_OFFLOAD_QOS BIT(29) | |||||
/* BIT(30) is reserved */ | |||||
/* BIT(31) is reserved */ | |||||
/* Define below the capability flags that are not offloads */ | |||||
#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 | |||||
#define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ | #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ | ||||
VIRTCHNL_VF_OFFLOAD_VLAN | \ | VIRTCHNL_VF_OFFLOAD_VLAN | \ | ||||
VIRTCHNL_VF_OFFLOAD_RSS_PF) | VIRTCHNL_VF_OFFLOAD_RSS_PF) | ||||
struct virtchnl_vf_resource { | struct virtchnl_vf_resource { | ||||
u16 num_vsis; | u16 num_vsis; | ||||
u16 num_queue_pairs; | u16 num_queue_pairs; | ||||
u16 max_vectors; | u16 max_vectors; | ||||
Show All 21 Lines | struct virtchnl_txq_info { | ||||
u16 ring_len; /* number of descriptors, multiple of 8 */ | u16 ring_len; /* number of descriptors, multiple of 8 */ | ||||
u16 headwb_enabled; /* deprecated with AVF 1.0 */ | u16 headwb_enabled; /* deprecated with AVF 1.0 */ | ||||
u64 dma_ring_addr; | u64 dma_ring_addr; | ||||
u64 dma_headwb_addr; /* deprecated with AVF 1.0 */ | u64 dma_headwb_addr; /* deprecated with AVF 1.0 */ | ||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_txq_info); | VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_txq_info); | ||||
/* RX descriptor IDs (range from 0 to 63) */ | |||||
enum virtchnl_rx_desc_ids { | |||||
VIRTCHNL_RXDID_0_16B_BASE = 0, | |||||
/* 32B_BASE and FLEX_SPLITQ share desc ids as default descriptors | |||||
* because they can be differentiated based on queue model; e.g. single | |||||
* queue model can only use 32B_BASE and split queue model can only use | |||||
* FLEX_SPLITQ. Having these as 1 allows them to be used as default | |||||
* descriptors without negotiation. | |||||
*/ | |||||
VIRTCHNL_RXDID_1_32B_BASE = 1, | |||||
VIRTCHNL_RXDID_1_FLEX_SPLITQ = 1, | |||||
VIRTCHNL_RXDID_2_FLEX_SQ_NIC = 2, | |||||
VIRTCHNL_RXDID_3_FLEX_SQ_SW = 3, | |||||
VIRTCHNL_RXDID_4_FLEX_SQ_NIC_VEB = 4, | |||||
VIRTCHNL_RXDID_5_FLEX_SQ_NIC_ACL = 5, | |||||
VIRTCHNL_RXDID_6_FLEX_SQ_NIC_2 = 6, | |||||
VIRTCHNL_RXDID_7_HW_RSVD = 7, | |||||
/* 9 through 15 are reserved */ | |||||
VIRTCHNL_RXDID_16_COMMS_GENERIC = 16, | |||||
VIRTCHNL_RXDID_17_COMMS_AUX_VLAN = 17, | |||||
VIRTCHNL_RXDID_18_COMMS_AUX_IPV4 = 18, | |||||
VIRTCHNL_RXDID_19_COMMS_AUX_IPV6 = 19, | |||||
VIRTCHNL_RXDID_20_COMMS_AUX_FLOW = 20, | |||||
VIRTCHNL_RXDID_21_COMMS_AUX_TCP = 21, | |||||
/* 22 through 63 are reserved */ | |||||
}; | |||||
/* RX descriptor ID bitmasks */ | |||||
enum virtchnl_rx_desc_id_bitmasks { | |||||
VIRTCHNL_RXDID_0_16B_BASE_M = BIT(VIRTCHNL_RXDID_0_16B_BASE), | |||||
VIRTCHNL_RXDID_1_32B_BASE_M = BIT(VIRTCHNL_RXDID_1_32B_BASE), | |||||
VIRTCHNL_RXDID_1_FLEX_SPLITQ_M = BIT(VIRTCHNL_RXDID_1_FLEX_SPLITQ), | |||||
VIRTCHNL_RXDID_2_FLEX_SQ_NIC_M = BIT(VIRTCHNL_RXDID_2_FLEX_SQ_NIC), | |||||
VIRTCHNL_RXDID_3_FLEX_SQ_SW_M = BIT(VIRTCHNL_RXDID_3_FLEX_SQ_SW), | |||||
VIRTCHNL_RXDID_4_FLEX_SQ_NIC_VEB_M = BIT(VIRTCHNL_RXDID_4_FLEX_SQ_NIC_VEB), | |||||
VIRTCHNL_RXDID_5_FLEX_SQ_NIC_ACL_M = BIT(VIRTCHNL_RXDID_5_FLEX_SQ_NIC_ACL), | |||||
VIRTCHNL_RXDID_6_FLEX_SQ_NIC_2_M = BIT(VIRTCHNL_RXDID_6_FLEX_SQ_NIC_2), | |||||
VIRTCHNL_RXDID_7_HW_RSVD_M = BIT(VIRTCHNL_RXDID_7_HW_RSVD), | |||||
/* 9 through 15 are reserved */ | |||||
VIRTCHNL_RXDID_16_COMMS_GENERIC_M = BIT(VIRTCHNL_RXDID_16_COMMS_GENERIC), | |||||
VIRTCHNL_RXDID_17_COMMS_AUX_VLAN_M = BIT(VIRTCHNL_RXDID_17_COMMS_AUX_VLAN), | |||||
VIRTCHNL_RXDID_18_COMMS_AUX_IPV4_M = BIT(VIRTCHNL_RXDID_18_COMMS_AUX_IPV4), | |||||
VIRTCHNL_RXDID_19_COMMS_AUX_IPV6_M = BIT(VIRTCHNL_RXDID_19_COMMS_AUX_IPV6), | |||||
VIRTCHNL_RXDID_20_COMMS_AUX_FLOW_M = BIT(VIRTCHNL_RXDID_20_COMMS_AUX_FLOW), | |||||
VIRTCHNL_RXDID_21_COMMS_AUX_TCP_M = BIT(VIRTCHNL_RXDID_21_COMMS_AUX_TCP), | |||||
/* 22 through 63 are reserved */ | |||||
}; | |||||
/* VIRTCHNL_OP_CONFIG_RX_QUEUE | /* VIRTCHNL_OP_CONFIG_RX_QUEUE | ||||
* VF sends this message to set up parameters for one RX queue. | * VF sends this message to set up parameters for one RX queue. | ||||
* External data buffer contains one instance of virtchnl_rxq_info. | * External data buffer contains one instance of virtchnl_rxq_info. | ||||
* PF configures requested queue and returns a status code. The | * PF configures requested queue and returns a status code. The | ||||
* crc_disable flag disables CRC stripping on the VF. Setting | * crc_disable flag disables CRC stripping on the VF. Setting | ||||
* the crc_disable flag to 1 will disable CRC stripping for each | * the crc_disable flag to 1 will disable CRC stripping for each | ||||
* queue in the VF where the flag is set. The VIRTCHNL_VF_OFFLOAD_CRC | * queue in the VF where the flag is set. The VIRTCHNL_VF_OFFLOAD_CRC | ||||
* offload must have been set prior to sending this info or the PF | * offload must have been set prior to sending this info or the PF | ||||
▲ Show 20 Lines • Show All 671 Lines • ▼ Show 20 Lines | |||||
* traffic types that are hashed by the hardware. | * traffic types that are hashed by the hardware. | ||||
*/ | */ | ||||
struct virtchnl_rss_hena { | struct virtchnl_rss_hena { | ||||
u64 hena; | u64 hena; | ||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hena); | VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_rss_hena); | ||||
/* Type of RSS algorithm */ | |||||
enum virtchnl_rss_algorithm { | |||||
VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC = 0, | |||||
VIRTCHNL_RSS_ALG_R_ASYMMETRIC = 1, | |||||
VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC = 2, | |||||
VIRTCHNL_RSS_ALG_XOR_SYMMETRIC = 3, | |||||
}; | |||||
/* This is used by PF driver to enforce how many channels can be supported. | /* This is used by PF driver to enforce how many channels can be supported. | ||||
* When ADQ_V2 capability is negotiated, it will allow 16 channels otherwise | * When ADQ_V2 capability is negotiated, it will allow 16 channels otherwise | ||||
* PF driver will allow only max 4 channels | * PF driver will allow only max 4 channels | ||||
*/ | */ | ||||
#define VIRTCHNL_MAX_ADQ_CHANNELS 4 | #define VIRTCHNL_MAX_ADQ_CHANNELS 4 | ||||
#define VIRTCHNL_MAX_ADQ_V2_CHANNELS 16 | #define VIRTCHNL_MAX_ADQ_V2_CHANNELS 16 | ||||
/* VIRTCHNL_OP_ENABLE_CHANNELS | /* VIRTCHNL_OP_ENABLE_CHANNELS | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | struct virtchnl_filter { | ||||
/* see enum virtchnl_action */ | /* see enum virtchnl_action */ | ||||
s32 action; | s32 action; | ||||
u32 action_meta; | u32 action_meta; | ||||
u8 field_flags; | u8 field_flags; | ||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter); | VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter); | ||||
struct virtchnl_shaper_bw { | |||||
/* Unit is Kbps */ | |||||
u32 committed; | |||||
u32 peak; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_shaper_bw); | |||||
/* VIRTCHNL_OP_EVENT | /* VIRTCHNL_OP_EVENT | ||||
* PF sends this message to inform the VF driver of events that may affect it. | * PF sends this message to inform the VF driver of events that may affect it. | ||||
* No direct response is expected from the VF, though it may generate other | * No direct response is expected from the VF, though it may generate other | ||||
* messages in response to this one. | * messages in response to this one. | ||||
*/ | */ | ||||
enum virtchnl_event_codes { | enum virtchnl_event_codes { | ||||
VIRTCHNL_EVENT_UNKNOWN = 0, | VIRTCHNL_EVENT_UNKNOWN = 0, | ||||
VIRTCHNL_EVENT_LINK_CHANGE, | VIRTCHNL_EVENT_LINK_CHANGE, | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
* will result in 3. | * will result in 3. | ||||
*/ | */ | ||||
enum virtchnl_vfr_states { | enum virtchnl_vfr_states { | ||||
VIRTCHNL_VFR_INPROGRESS = 0, | VIRTCHNL_VFR_INPROGRESS = 0, | ||||
VIRTCHNL_VFR_COMPLETED, | VIRTCHNL_VFR_COMPLETED, | ||||
VIRTCHNL_VFR_VFACTIVE, | VIRTCHNL_VFR_VFACTIVE, | ||||
}; | }; | ||||
#define VIRTCHNL_MAX_NUM_PROTO_HDRS 32 | |||||
#define PROTO_HDR_SHIFT 5 | |||||
#define PROTO_HDR_FIELD_START(proto_hdr_type) \ | |||||
(proto_hdr_type << PROTO_HDR_SHIFT) | |||||
#define PROTO_HDR_FIELD_MASK ((1UL << PROTO_HDR_SHIFT) - 1) | |||||
/* VF use these macros to configure each protocol header. | |||||
* Specify which protocol headers and protocol header fields base on | |||||
* virtchnl_proto_hdr_type and virtchnl_proto_hdr_field. | |||||
* @param hdr: a struct of virtchnl_proto_hdr | |||||
* @param hdr_type: ETH/IPV4/TCP, etc | |||||
* @param field: SRC/DST/TEID/SPI, etc | |||||
*/ | |||||
#define VIRTCHNL_ADD_PROTO_HDR_FIELD(hdr, field) \ | |||||
((hdr)->field_selector |= BIT((field) & PROTO_HDR_FIELD_MASK)) | |||||
#define VIRTCHNL_DEL_PROTO_HDR_FIELD(hdr, field) \ | |||||
((hdr)->field_selector &= ~BIT((field) & PROTO_HDR_FIELD_MASK)) | |||||
#define VIRTCHNL_TEST_PROTO_HDR_FIELD(hdr, val) \ | |||||
((hdr)->field_selector & BIT((val) & PROTO_HDR_FIELD_MASK)) | |||||
#define VIRTCHNL_GET_PROTO_HDR_FIELD(hdr) ((hdr)->field_selector) | |||||
#define VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, hdr_type, field) \ | |||||
(VIRTCHNL_ADD_PROTO_HDR_FIELD(hdr, \ | |||||
VIRTCHNL_PROTO_HDR_ ## hdr_type ## _ ## field)) | |||||
#define VIRTCHNL_DEL_PROTO_HDR_FIELD_BIT(hdr, hdr_type, field) \ | |||||
(VIRTCHNL_DEL_PROTO_HDR_FIELD(hdr, \ | |||||
VIRTCHNL_PROTO_HDR_ ## hdr_type ## _ ## field)) | |||||
#define VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, hdr_type) \ | |||||
((hdr)->type = VIRTCHNL_PROTO_HDR_ ## hdr_type) | |||||
#define VIRTCHNL_GET_PROTO_HDR_TYPE(hdr) \ | |||||
(((hdr)->type) >> PROTO_HDR_SHIFT) | |||||
#define VIRTCHNL_TEST_PROTO_HDR_TYPE(hdr, val) \ | |||||
((hdr)->type == ((s32)((val) >> PROTO_HDR_SHIFT))) | |||||
#define VIRTCHNL_TEST_PROTO_HDR(hdr, val) \ | |||||
(VIRTCHNL_TEST_PROTO_HDR_TYPE(hdr, val) && \ | |||||
VIRTCHNL_TEST_PROTO_HDR_FIELD(hdr, val)) | |||||
/* Protocol header type within a packet segment. A segment consists of one or | |||||
* more protocol headers that make up a logical group of protocol headers. Each | |||||
* logical group of protocol headers encapsulates or is encapsulated using/by | |||||
* tunneling or encapsulation protocols for network virtualization. | |||||
*/ | |||||
enum virtchnl_proto_hdr_type { | |||||
VIRTCHNL_PROTO_HDR_NONE, | |||||
VIRTCHNL_PROTO_HDR_ETH, | |||||
VIRTCHNL_PROTO_HDR_S_VLAN, | |||||
VIRTCHNL_PROTO_HDR_C_VLAN, | |||||
VIRTCHNL_PROTO_HDR_IPV4, | |||||
VIRTCHNL_PROTO_HDR_IPV6, | |||||
VIRTCHNL_PROTO_HDR_TCP, | |||||
VIRTCHNL_PROTO_HDR_UDP, | |||||
VIRTCHNL_PROTO_HDR_SCTP, | |||||
VIRTCHNL_PROTO_HDR_GTPU_IP, | |||||
VIRTCHNL_PROTO_HDR_GTPU_EH, | |||||
VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN, | |||||
VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, | |||||
VIRTCHNL_PROTO_HDR_PPPOE, | |||||
VIRTCHNL_PROTO_HDR_L2TPV3, | |||||
VIRTCHNL_PROTO_HDR_ESP, | |||||
VIRTCHNL_PROTO_HDR_AH, | |||||
VIRTCHNL_PROTO_HDR_PFCP, | |||||
VIRTCHNL_PROTO_HDR_GTPC, | |||||
VIRTCHNL_PROTO_HDR_ECPRI, | |||||
VIRTCHNL_PROTO_HDR_L2TPV2, | |||||
VIRTCHNL_PROTO_HDR_PPP, | |||||
/* IPv4 and IPv6 Fragment header types are only associated to | |||||
* VIRTCHNL_PROTO_HDR_IPV4 and VIRTCHNL_PROTO_HDR_IPV6 respectively, | |||||
* cannot be used independently. | |||||
*/ | |||||
VIRTCHNL_PROTO_HDR_IPV4_FRAG, | |||||
VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG, | |||||
VIRTCHNL_PROTO_HDR_GRE, | |||||
}; | |||||
/* Protocol header field within a protocol header. */ | |||||
enum virtchnl_proto_hdr_field { | |||||
/* ETHER */ | |||||
VIRTCHNL_PROTO_HDR_ETH_SRC = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_ETH), | |||||
VIRTCHNL_PROTO_HDR_ETH_DST, | |||||
VIRTCHNL_PROTO_HDR_ETH_ETHERTYPE, | |||||
/* S-VLAN */ | |||||
VIRTCHNL_PROTO_HDR_S_VLAN_ID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_S_VLAN), | |||||
/* C-VLAN */ | |||||
VIRTCHNL_PROTO_HDR_C_VLAN_ID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_C_VLAN), | |||||
/* IPV4 */ | |||||
VIRTCHNL_PROTO_HDR_IPV4_SRC = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV4), | |||||
VIRTCHNL_PROTO_HDR_IPV4_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV4_DSCP, | |||||
VIRTCHNL_PROTO_HDR_IPV4_TTL, | |||||
VIRTCHNL_PROTO_HDR_IPV4_PROT, | |||||
VIRTCHNL_PROTO_HDR_IPV4_CHKSUM, | |||||
/* IPV6 */ | |||||
VIRTCHNL_PROTO_HDR_IPV6_SRC = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV6), | |||||
VIRTCHNL_PROTO_HDR_IPV6_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_TC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_HOP_LIMIT, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PROT, | |||||
/* IPV6 Prefix */ | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX32_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX32_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX40_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX40_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX48_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX48_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX56_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX56_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX96_SRC, | |||||
VIRTCHNL_PROTO_HDR_IPV6_PREFIX96_DST, | |||||
/* TCP */ | |||||
VIRTCHNL_PROTO_HDR_TCP_SRC_PORT = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_TCP), | |||||
VIRTCHNL_PROTO_HDR_TCP_DST_PORT, | |||||
VIRTCHNL_PROTO_HDR_TCP_CHKSUM, | |||||
/* UDP */ | |||||
VIRTCHNL_PROTO_HDR_UDP_SRC_PORT = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_UDP), | |||||
VIRTCHNL_PROTO_HDR_UDP_DST_PORT, | |||||
VIRTCHNL_PROTO_HDR_UDP_CHKSUM, | |||||
/* SCTP */ | |||||
VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_SCTP), | |||||
VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, | |||||
VIRTCHNL_PROTO_HDR_SCTP_CHKSUM, | |||||
/* GTPU_IP */ | |||||
VIRTCHNL_PROTO_HDR_GTPU_IP_TEID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_IP), | |||||
/* GTPU_EH */ | |||||
VIRTCHNL_PROTO_HDR_GTPU_EH_PDU = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH), | |||||
VIRTCHNL_PROTO_HDR_GTPU_EH_QFI, | |||||
/* PPPOE */ | |||||
VIRTCHNL_PROTO_HDR_PPPOE_SESS_ID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_PPPOE), | |||||
/* L2TPV3 */ | |||||
VIRTCHNL_PROTO_HDR_L2TPV3_SESS_ID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV3), | |||||
/* ESP */ | |||||
VIRTCHNL_PROTO_HDR_ESP_SPI = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_ESP), | |||||
/* AH */ | |||||
VIRTCHNL_PROTO_HDR_AH_SPI = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_AH), | |||||
/* PFCP */ | |||||
VIRTCHNL_PROTO_HDR_PFCP_S_FIELD = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_PFCP), | |||||
VIRTCHNL_PROTO_HDR_PFCP_SEID, | |||||
/* GTPC */ | |||||
VIRTCHNL_PROTO_HDR_GTPC_TEID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPC), | |||||
/* ECPRI */ | |||||
VIRTCHNL_PROTO_HDR_ECPRI_MSG_TYPE = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_ECPRI), | |||||
VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID, | |||||
/* IPv4 Dummy Fragment */ | |||||
VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV4_FRAG), | |||||
/* IPv6 Extension Fragment */ | |||||
VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG_PKID = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG), | |||||
/* GTPU_DWN/UP */ | |||||
VIRTCHNL_PROTO_HDR_GTPU_DWN_QFI = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN), | |||||
VIRTCHNL_PROTO_HDR_GTPU_UP_QFI = | |||||
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP), | |||||
}; | |||||
struct virtchnl_proto_hdr { | |||||
/* see enum virtchnl_proto_hdr_type */ | |||||
s32 type; | |||||
u32 field_selector; /* a bit mask to select field for header type */ | |||||
u8 buffer[64]; | |||||
/** | |||||
* binary buffer in network order for specific header type. | |||||
* For example, if type = VIRTCHNL_PROTO_HDR_IPV4, a IPv4 | |||||
* header is expected to be copied into the buffer. | |||||
*/ | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_proto_hdr); | |||||
struct virtchnl_proto_hdrs { | |||||
u8 tunnel_level; | |||||
/** | |||||
* specify where protocol header start from. | |||||
* 0 - from the outer layer | |||||
* 1 - from the first inner layer | |||||
* 2 - from the second inner layer | |||||
* .... | |||||
**/ | |||||
int count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */ | |||||
struct virtchnl_proto_hdr proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS]; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs); | |||||
struct virtchnl_rss_cfg { | |||||
struct virtchnl_proto_hdrs proto_hdrs; /* protocol headers */ | |||||
/* see enum virtchnl_rss_algorithm; rss algorithm type */ | |||||
s32 rss_algorithm; | |||||
u8 reserved[128]; /* reserve for future */ | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(2444, virtchnl_rss_cfg); | |||||
/* action configuration for FDIR */ | |||||
struct virtchnl_filter_action { | |||||
/* see enum virtchnl_action type */ | |||||
s32 type; | |||||
union { | |||||
/* used for queue and qgroup action */ | |||||
struct { | |||||
u16 index; | |||||
u8 region; | |||||
} queue; | |||||
/* used for count action */ | |||||
struct { | |||||
/* share counter ID with other flow rules */ | |||||
u8 shared; | |||||
u32 id; /* counter ID */ | |||||
} count; | |||||
/* used for mark action */ | |||||
u32 mark_id; | |||||
u8 reserve[32]; | |||||
} act_conf; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(36, virtchnl_filter_action); | |||||
#define VIRTCHNL_MAX_NUM_ACTIONS 8 | |||||
struct virtchnl_filter_action_set { | |||||
/* action number must be less then VIRTCHNL_MAX_NUM_ACTIONS */ | |||||
int count; | |||||
struct virtchnl_filter_action actions[VIRTCHNL_MAX_NUM_ACTIONS]; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(292, virtchnl_filter_action_set); | |||||
/* pattern and action for FDIR rule */ | |||||
struct virtchnl_fdir_rule { | |||||
struct virtchnl_proto_hdrs proto_hdrs; | |||||
struct virtchnl_filter_action_set action_set; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(2604, virtchnl_fdir_rule); | |||||
/* Status returned to VF after VF requests FDIR commands | |||||
* VIRTCHNL_FDIR_SUCCESS | |||||
* VF FDIR related request is successfully done by PF | |||||
* The request can be OP_ADD/DEL/QUERY_FDIR_FILTER. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE | |||||
* OP_ADD_FDIR_FILTER request is failed due to no Hardware resource. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_EXIST | |||||
* OP_ADD_FDIR_FILTER request is failed due to the rule is already existed. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_CONFLICT | |||||
* OP_ADD_FDIR_FILTER request is failed due to conflict with existing rule. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_NONEXIST | |||||
* OP_DEL_FDIR_FILTER request is failed due to this rule doesn't exist. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_INVALID | |||||
* OP_ADD_FDIR_FILTER request is failed due to parameters validation | |||||
* or HW doesn't support. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_RULE_TIMEOUT | |||||
* OP_ADD/DEL_FDIR_FILTER request is failed due to timing out | |||||
* for programming. | |||||
* | |||||
* VIRTCHNL_FDIR_FAILURE_QUERY_INVALID | |||||
* OP_QUERY_FDIR_FILTER request is failed due to parameters validation, | |||||
* for example, VF query counter of a rule who has no counter action. | |||||
*/ | |||||
enum virtchnl_fdir_prgm_status { | |||||
VIRTCHNL_FDIR_SUCCESS = 0, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_EXIST, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_CONFLICT, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_NONEXIST, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_INVALID, | |||||
VIRTCHNL_FDIR_FAILURE_RULE_TIMEOUT, | |||||
VIRTCHNL_FDIR_FAILURE_QUERY_INVALID, | |||||
}; | |||||
/* VIRTCHNL_OP_ADD_FDIR_FILTER | |||||
* VF sends this request to PF by filling out vsi_id, | |||||
* validate_only and rule_cfg. PF will return flow_id | |||||
* if the request is successfully done and return add_status to VF. | |||||
*/ | |||||
struct virtchnl_fdir_add { | |||||
u16 vsi_id; /* INPUT */ | |||||
/* | |||||
* 1 for validating a fdir rule, 0 for creating a fdir rule. | |||||
* Validate and create share one ops: VIRTCHNL_OP_ADD_FDIR_FILTER. | |||||
*/ | |||||
u16 validate_only; /* INPUT */ | |||||
u32 flow_id; /* OUTPUT */ | |||||
struct virtchnl_fdir_rule rule_cfg; /* INPUT */ | |||||
/* see enum virtchnl_fdir_prgm_status; OUTPUT */ | |||||
s32 status; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(2616, virtchnl_fdir_add); | |||||
/* VIRTCHNL_OP_DEL_FDIR_FILTER | |||||
* VF sends this request to PF by filling out vsi_id | |||||
* and flow_id. PF will return del_status to VF. | |||||
*/ | |||||
struct virtchnl_fdir_del { | |||||
u16 vsi_id; /* INPUT */ | |||||
u16 pad; | |||||
u32 flow_id; /* INPUT */ | |||||
/* see enum virtchnl_fdir_prgm_status; OUTPUT */ | |||||
s32 status; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_fdir_del); | |||||
/* VIRTCHNL_OP_GET_QOS_CAPS | |||||
* VF sends this message to get its QoS Caps, such as | |||||
* TC number, Arbiter and Bandwidth. | |||||
*/ | |||||
struct virtchnl_qos_cap_elem { | |||||
u8 tc_num; | |||||
u8 tc_prio; | |||||
#define VIRTCHNL_ABITER_STRICT 0 | |||||
#define VIRTCHNL_ABITER_ETS 2 | |||||
u8 arbiter; | |||||
#define VIRTCHNL_STRICT_WEIGHT 1 | |||||
u8 weight; | |||||
enum virtchnl_bw_limit_type type; | |||||
union { | |||||
struct virtchnl_shaper_bw shaper; | |||||
u8 pad2[32]; | |||||
}; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_qos_cap_elem); | |||||
struct virtchnl_qos_cap_list { | |||||
u16 vsi_id; | |||||
u16 num_elem; | |||||
struct virtchnl_qos_cap_elem cap[1]; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(44, virtchnl_qos_cap_list); | |||||
/* VIRTCHNL_OP_CONFIG_QUEUE_TC_MAP | |||||
* VF sends message virtchnl_queue_tc_mapping to set queue to tc | |||||
* mapping for all the Tx and Rx queues with a specified VSI, and | |||||
* would get response about bitmap of valid user priorities | |||||
* associated with queues. | |||||
*/ | |||||
struct virtchnl_queue_tc_mapping { | |||||
u16 vsi_id; | |||||
u16 num_tc; | |||||
u16 num_queue_pairs; | |||||
u8 pad[2]; | |||||
union { | |||||
struct { | |||||
u16 start_queue_id; | |||||
u16 queue_count; | |||||
} req; | |||||
struct { | |||||
#define VIRTCHNL_USER_PRIO_TYPE_UP 0 | |||||
#define VIRTCHNL_USER_PRIO_TYPE_DSCP 1 | |||||
u16 prio_type; | |||||
u16 valid_prio_bitmap; | |||||
} resp; | |||||
} tc[1]; | |||||
}; | |||||
VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_queue_tc_mapping); | |||||
/* TX and RX queue types are valid in legacy as well as split queue models. | /* TX and RX queue types are valid in legacy as well as split queue models. | ||||
* With Split Queue model, 2 additional types are introduced - TX_COMPLETION | * With Split Queue model, 2 additional types are introduced - TX_COMPLETION | ||||
* and RX_BUFFER. In split queue model, RX corresponds to the queue where HW | * and RX_BUFFER. In split queue model, RX corresponds to the queue where HW | ||||
* posts completions. | * posts completions. | ||||
*/ | */ | ||||
enum virtchnl_queue_type { | enum virtchnl_queue_type { | ||||
VIRTCHNL_QUEUE_TYPE_TX = 0, | VIRTCHNL_QUEUE_TYPE_TX = 0, | ||||
VIRTCHNL_QUEUE_TYPE_RX = 1, | VIRTCHNL_QUEUE_TYPE_RX = 1, | ||||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | if (msglen >= valid_len) { | ||||
sizeof(struct virtchnl_channel_info); | sizeof(struct virtchnl_channel_info); | ||||
} | } | ||||
break; | break; | ||||
case VIRTCHNL_OP_DISABLE_CHANNELS: | case VIRTCHNL_OP_DISABLE_CHANNELS: | ||||
break; | break; | ||||
case VIRTCHNL_OP_ADD_CLOUD_FILTER: | case VIRTCHNL_OP_ADD_CLOUD_FILTER: | ||||
case VIRTCHNL_OP_DEL_CLOUD_FILTER: | case VIRTCHNL_OP_DEL_CLOUD_FILTER: | ||||
valid_len = sizeof(struct virtchnl_filter); | valid_len = sizeof(struct virtchnl_filter); | ||||
break; | |||||
case VIRTCHNL_OP_ADD_RSS_CFG: | |||||
case VIRTCHNL_OP_DEL_RSS_CFG: | |||||
valid_len = sizeof(struct virtchnl_rss_cfg); | |||||
break; | |||||
case VIRTCHNL_OP_ADD_FDIR_FILTER: | |||||
valid_len = sizeof(struct virtchnl_fdir_add); | |||||
break; | |||||
case VIRTCHNL_OP_DEL_FDIR_FILTER: | |||||
valid_len = sizeof(struct virtchnl_fdir_del); | |||||
break; | |||||
case VIRTCHNL_OP_GET_QOS_CAPS: | |||||
break; | |||||
case VIRTCHNL_OP_CONFIG_QUEUE_TC_MAP: | |||||
valid_len = sizeof(struct virtchnl_queue_tc_mapping); | |||||
if (msglen >= valid_len) { | |||||
struct virtchnl_queue_tc_mapping *q_tc = | |||||
(struct virtchnl_queue_tc_mapping *)msg; | |||||
if (q_tc->num_tc == 0) { | |||||
err_msg_format = true; | |||||
break; | |||||
} | |||||
valid_len += (q_tc->num_tc - 1) * | |||||
sizeof(q_tc->tc[0]); | |||||
} | |||||
break; | break; | ||||
case VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS: | case VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS: | ||||
break; | break; | ||||
case VIRTCHNL_OP_ADD_VLAN_V2: | case VIRTCHNL_OP_ADD_VLAN_V2: | ||||
case VIRTCHNL_OP_DEL_VLAN_V2: | case VIRTCHNL_OP_DEL_VLAN_V2: | ||||
valid_len = sizeof(struct virtchnl_vlan_filter_list_v2); | valid_len = sizeof(struct virtchnl_vlan_filter_list_v2); | ||||
if (msglen >= valid_len) { | if (msglen >= valid_len) { | ||||
struct virtchnl_vlan_filter_list_v2 *vfl = | struct virtchnl_vlan_filter_list_v2 *vfl = | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |