Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/virtchnl.h
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | */ | ||||
VIRTCHNL_OP_SET_RSS_HENA = 26, | VIRTCHNL_OP_SET_RSS_HENA = 26, | ||||
VIRTCHNL_OP_ENABLE_VLAN_STRIPPING = 27, | VIRTCHNL_OP_ENABLE_VLAN_STRIPPING = 27, | ||||
VIRTCHNL_OP_DISABLE_VLAN_STRIPPING = 28, | VIRTCHNL_OP_DISABLE_VLAN_STRIPPING = 28, | ||||
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, | ||||
/* opcodes 34, 35, 36, 37 and 38 are reserved */ | /* opcode 34 is reserved */ | ||||
/* opcodes 39, 40, 41 and 42 are reserved */ | /* opcodes 39, 40, 41, 42 and 43 are reserved */ | ||||
/* opcode 42 is reserved */ | /* opcode 44 is reserved */ | ||||
/* opcode 45, 46, 47, 48 and 49 are reserved */ | |||||
VIRTCHNL_OP_MAX, | |||||
}; | }; | ||||
/* These macros are used to generate compilation errors if a structure/union | /* 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 | * 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 | * structure/union is not of the correct size, otherwise it creates an enum | ||||
* that is never used. | * that is never used. | ||||
*/ | */ | ||||
#define VIRTCHNL_CHECK_STRUCT_LEN(n, X) enum virtchnl_static_assert_enum_##X \ | #define VIRTCHNL_CHECK_STRUCT_LEN(n, X) enum virtchnl_static_assert_enum_##X \ | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
#define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000 | #define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000 | ||||
#define VIRTCHNL_VF_OFFLOAD_RSS_PF 0X00080000 | #define VIRTCHNL_VF_OFFLOAD_RSS_PF 0X00080000 | ||||
#define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000 | #define VIRTCHNL_VF_OFFLOAD_ENCAP 0X00100000 | ||||
#define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000 | #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM 0X00200000 | ||||
#define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 | #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 | ||||
#define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 | #define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 | ||||
#define VIRTCHNL_VF_OFFLOAD_ADQ_V2 0X01000000 | #define VIRTCHNL_VF_OFFLOAD_ADQ_V2 0X01000000 | ||||
#define VIRTCHNL_VF_OFFLOAD_USO 0X02000000 | #define VIRTCHNL_VF_OFFLOAD_USO 0X02000000 | ||||
/* 0x04000000 is reserved */ | |||||
/* 0X08000000 and 0X10000000 are reserved */ | |||||
/* 0X20000000 is reserved */ | |||||
/* 0X40000000 is reserved */ | /* 0X40000000 is reserved */ | ||||
/* 0X80000000 is reserved */ | /* 0X80000000 is reserved */ | ||||
/* Define below the capability flags that are not offloads */ | /* Define below the capability flags that are not offloads */ | ||||
#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 | #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) | ||||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
/* VIRTCHNL_OP_DEL_ETH_ADDR | /* VIRTCHNL_OP_DEL_ETH_ADDR | ||||
* VF sends this message in order to remove one or more unicast or multicast | * VF sends this message in order to remove one or more unicast or multicast | ||||
* filters for the specified VSI. | * filters for the specified VSI. | ||||
* PF removes the filters and returns status. | * PF removes the filters and returns status. | ||||
*/ | */ | ||||
/* VIRTCHNL_ETHER_ADDR_LEGACY | |||||
* Prior to adding the @type member to virtchnl_ether_addr, there were 2 pad | |||||
* bytes. Moving forward all VF drivers should not set type to | |||||
* VIRTCHNL_ETHER_ADDR_LEGACY. This is only here to not break previous/legacy | |||||
* behavior. The control plane function (i.e. PF) can use a best effort method | |||||
* of tracking the primary/device unicast in this case, but there is no | |||||
* guarantee and functionality depends on the implementation of the PF. | |||||
*/ | |||||
/* VIRTCHNL_ETHER_ADDR_PRIMARY | |||||
* All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_PRIMARY for the | |||||
* primary/device unicast MAC address filter for VIRTCHNL_OP_ADD_ETH_ADDR and | |||||
* VIRTCHNL_OP_DEL_ETH_ADDR. This allows for the underlying control plane | |||||
* function (i.e. PF) to accurately track and use this MAC address for | |||||
* displaying on the host and for VM/function reset. | |||||
*/ | |||||
/* VIRTCHNL_ETHER_ADDR_EXTRA | |||||
* All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_EXTRA for any extra | |||||
* unicast and/or multicast filters that are being added/deleted via | |||||
* VIRTCHNL_OP_DEL_ETH_ADDR/VIRTCHNL_OP_ADD_ETH_ADDR respectively. | |||||
*/ | |||||
struct virtchnl_ether_addr { | struct virtchnl_ether_addr { | ||||
u8 addr[VIRTCHNL_ETH_LENGTH_OF_ADDRESS]; | u8 addr[VIRTCHNL_ETH_LENGTH_OF_ADDRESS]; | ||||
u8 pad[2]; | u8 type; | ||||
#define VIRTCHNL_ETHER_ADDR_LEGACY 0 | |||||
#define VIRTCHNL_ETHER_ADDR_PRIMARY 1 | |||||
#define VIRTCHNL_ETHER_ADDR_EXTRA 2 | |||||
#define VIRTCHNL_ETHER_ADDR_TYPE_MASK 3 /* first two bits of type are valid */ | |||||
u8 pad; | |||||
}; | }; | ||||
VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_ether_addr); | VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_ether_addr); | ||||
struct virtchnl_ether_addr_list { | struct virtchnl_ether_addr_list { | ||||
u16 vsi_id; | u16 vsi_id; | ||||
u16 num_elements; | u16 num_elements; | ||||
struct virtchnl_ether_addr list[1]; | struct virtchnl_ether_addr list[1]; | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
VIRTCHNL_CHECK_UNION_LEN(128, virtchnl_flow_spec); | VIRTCHNL_CHECK_UNION_LEN(128, virtchnl_flow_spec); | ||||
enum virtchnl_action { | enum virtchnl_action { | ||||
/* action types */ | /* action types */ | ||||
VIRTCHNL_ACTION_DROP = 0, | VIRTCHNL_ACTION_DROP = 0, | ||||
VIRTCHNL_ACTION_TC_REDIRECT, | VIRTCHNL_ACTION_TC_REDIRECT, | ||||
VIRTCHNL_ACTION_PASSTHRU, | |||||
VIRTCHNL_ACTION_QUEUE, | |||||
VIRTCHNL_ACTION_Q_REGION, | |||||
VIRTCHNL_ACTION_MARK, | |||||
VIRTCHNL_ACTION_COUNT, | |||||
}; | }; | ||||
enum virtchnl_flow_type { | enum virtchnl_flow_type { | ||||
/* flow types */ | /* flow types */ | ||||
VIRTCHNL_TCP_V4_FLOW = 0, | VIRTCHNL_TCP_V4_FLOW = 0, | ||||
VIRTCHNL_TCP_V6_FLOW, | VIRTCHNL_TCP_V6_FLOW, | ||||
VIRTCHNL_UDP_V4_FLOW, | VIRTCHNL_UDP_V4_FLOW, | ||||
VIRTCHNL_UDP_V6_FLOW, | VIRTCHNL_UDP_V6_FLOW, | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* validate msg format against struct for each opcode | * validate msg format against struct for each opcode | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, | virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, | ||||
u8 *msg, u16 msglen) | u8 *msg, u16 msglen) | ||||
{ | { | ||||
bool err_msg_format = false; | bool err_msg_format = false; | ||||
int valid_len = 0; | u32 valid_len = 0; | ||||
/* Validate message length. */ | /* Validate message length. */ | ||||
switch (v_opcode) { | switch (v_opcode) { | ||||
case VIRTCHNL_OP_VERSION: | case VIRTCHNL_OP_VERSION: | ||||
valid_len = sizeof(struct virtchnl_version_info); | valid_len = sizeof(struct virtchnl_version_info); | ||||
break; | break; | ||||
case VIRTCHNL_OP_RESET_VF: | case VIRTCHNL_OP_RESET_VF: | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |