include/linux/avf/virtchnl.h
Source file repositories/reference/linux-study-clean/include/linux/avf/virtchnl.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/avf/virtchnl.h- Extension
.h- Size
- 66491 bytes
- Lines
- 1945
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/bits.hlinux/overflow.huapi/linux/if_ether.h
Detected Declarations
struct virtchnl_version_infostruct virtchnl_vsi_resourcestruct virtchnl_vf_resourcestruct virtchnl_txq_infostruct virtchnl_rxq_infostruct virtchnl_queue_pair_infostruct virtchnl_vsi_queue_config_infostruct virtchnl_vf_res_requeststruct virtchnl_vector_mapstruct virtchnl_irq_map_infostruct virtchnl_queue_selectstruct virtchnl_ether_addrstruct virtchnl_ether_addr_liststruct virtchnl_vlan_filter_liststruct virtchnl_vlan_supported_capsstruct virtchnl_vlan_filtering_capsstruct virtchnl_vlan_offload_capsstruct virtchnl_vlan_capsstruct virtchnl_vlanstruct virtchnl_vlan_filterstruct virtchnl_vlan_filter_list_v2struct virtchnl_vlan_settingstruct virtchnl_promisc_infostruct virtchnl_rss_keystruct virtchnl_rss_lutstruct virtchnl_rss_hashcfgstruct virtchnl_rss_hfuncstruct virtchnl_channel_infostruct virtchnl_tc_infostruct virtchnl_l4_specstruct virtchnl_filterstruct virtchnl_pf_eventstruct virtchnl_rdma_qv_infostruct virtchnl_rdma_qvlist_infostruct virtchnl_proto_hdrstruct virtchnl_proto_hdrsstruct virtchnl_rss_cfgstruct virtchnl_filter_actionstruct virtchnl_filter_action_setstruct virtchnl_fdir_rulestruct virtchnl_fdir_addstruct virtchnl_fdir_delstruct virtchnl_ptp_capsstruct virtchnl_phc_timestruct virtchnl_shaper_bwstruct virtchnl_qos_cap_elemstruct virtchnl_qos_cap_liststruct virtchnl_queue_bw
Annotated Snippet
struct virtchnl_version_info {
u32 major;
u32 minor;
};
VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_version_info);
#define VF_IS_V10(_v) (((_v)->major == 1) && ((_v)->minor == 0))
#define VF_IS_V11(_ver) (((_ver)->major == 1) && ((_ver)->minor == 1))
/* VIRTCHNL_OP_RESET_VF
* VF sends this request to PF with no parameters
* PF does NOT respond! VF driver must delay then poll VFGEN_RSTAT register
* until reset completion is indicated. The admin queue must be reinitialized
* after this operation.
*
* When reset is complete, PF must ensure that all queues in all VSIs associated
* with the VF are stopped, all queue configurations in the HMC are set to 0,
* and all MAC and VLAN filters (except the default MAC address) on all VSIs
* are cleared.
*/
/* VSI types that use VIRTCHNL interface for VF-PF communication. VSI_SRIOV
* vsi_type should always be 6 for backward compatibility. Add other fields
* as needed.
*/
enum virtchnl_vsi_type {
VIRTCHNL_VSI_TYPE_INVALID = 0,
VIRTCHNL_VSI_SRIOV = 6,
};
/* VIRTCHNL_OP_GET_VF_RESOURCES
* Version 1.0 VF sends this request to PF with no parameters
* Version 1.1 VF sends this request to PF with u32 bitmap of its capabilities
* PF responds with an indirect message containing
* virtchnl_vf_resource and one or more
* virtchnl_vsi_resource structures.
*/
struct virtchnl_vsi_resource {
u16 vsi_id;
u16 num_queue_pairs;
/* see enum virtchnl_vsi_type */
s32 vsi_type;
u16 qset_handle;
u8 default_mac_addr[ETH_ALEN];
};
VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);
/* VF capability flags
* VIRTCHNL_VF_OFFLOAD_L2 flag is inclusive of base mode L2 offloads including
* TX/RX Checksum offloading and TSO for non-tunnelled packets.
*/
#define VIRTCHNL_VF_OFFLOAD_L2 BIT(0)
#define VIRTCHNL_VF_OFFLOAD_RDMA BIT(1)
#define VIRTCHNL_VF_CAP_RDMA VIRTCHNL_VF_OFFLOAD_RDMA
#define VIRTCHNL_VF_OFFLOAD_RSS_AQ BIT(3)
#define VIRTCHNL_VF_OFFLOAD_RSS_REG BIT(4)
#define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR BIT(5)
#define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES BIT(6)
/* used to negotiate communicating link speeds in Mbps */
#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED BIT(7)
#define VIRTCHNL_VF_OFFLOAD_CRC BIT(10)
#define VIRTCHNL_VF_OFFLOAD_TC_U32 BIT(11)
#define VIRTCHNL_VF_OFFLOAD_VLAN_V2 BIT(15)
#define VIRTCHNL_VF_OFFLOAD_VLAN BIT(16)
#define VIRTCHNL_VF_OFFLOAD_RX_POLLING BIT(17)
#define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 BIT(18)
#define VIRTCHNL_VF_OFFLOAD_RSS_PF BIT(19)
#define VIRTCHNL_VF_OFFLOAD_ENCAP BIT(20)
#define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM BIT(21)
#define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM BIT(22)
#define VIRTCHNL_VF_OFFLOAD_ADQ BIT(23)
#define VIRTCHNL_VF_OFFLOAD_USO BIT(25)
#define VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC BIT(26)
#define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF BIT(27)
#define VIRTCHNL_VF_OFFLOAD_FDIR_PF BIT(28)
#define VIRTCHNL_VF_OFFLOAD_QOS BIT(29)
#define VIRTCHNL_VF_CAP_PTP BIT(31)
#define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \
VIRTCHNL_VF_OFFLOAD_VLAN | \
VIRTCHNL_VF_OFFLOAD_RSS_PF)
struct virtchnl_vf_resource {
u16 num_vsis;
u16 num_queue_pairs;
u16 max_vectors;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/bits.h`, `linux/overflow.h`, `uapi/linux/if_ether.h`.
- Detected declarations: `struct virtchnl_version_info`, `struct virtchnl_vsi_resource`, `struct virtchnl_vf_resource`, `struct virtchnl_txq_info`, `struct virtchnl_rxq_info`, `struct virtchnl_queue_pair_info`, `struct virtchnl_vsi_queue_config_info`, `struct virtchnl_vf_res_request`, `struct virtchnl_vector_map`, `struct virtchnl_irq_map_info`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.