drivers/net/ethernet/intel/iavf/iavf.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/iavf/iavf.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/iavf/iavf.h- Extension
.h- Size
- 22428 bytes
- Lines
- 629
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/pci.hlinux/netdevice.hlinux/vmalloc.hlinux/interrupt.hlinux/ethtool.hlinux/if_vlan.hlinux/ip.hlinux/tcp.hlinux/sctp.hlinux/ipv6.hlinux/kernel.hlinux/bitops.hlinux/timer.hlinux/workqueue.hlinux/wait.hlinux/delay.hlinux/gfp.hlinux/skbuff.hlinux/dma-mapping.hlinux/etherdevice.hlinux/socket.hlinux/jiffies.hnet/ip6_checksum.hnet/pkt_cls.hnet/pkt_sched.hnet/udp.hnet/tc_act/tc_gact.hnet/tc_act/tc_mirred.hnet/tc_act/tc_skbedit.hnet/net_shaper.hiavf_type.h
Detected Declarations
struct iavf_vsistruct iavf_q_vectorstruct iavf_mac_filterstruct iavf_vlanstruct iavf_vlan_filterstruct iavf_channel_configstruct iavf_cloud_filterstruct iavf_adapterenum iavf_vsi_state_tenum iavf_vlan_state_tenum iavf_tc_state_tenum iavf_cloud_filter_state_tenum iavf_state_tenum iavf_critical_section_tfunction iavf_fdir_max_reachedfunction iavf_inc_fdir_active_fltrfunction iavf_dec_fdir_active_fltrfunction iavf_change_state
Annotated Snippet
struct iavf_vsi {
struct iavf_adapter *back;
struct net_device *netdev;
u16 seid;
u16 id;
DECLARE_BITMAP(state, __IAVF_VSI_STATE_SIZE__);
int base_vector;
u16 qs_handle;
};
/* How many Rx Buffers do we bundle into one write to the hardware ? */
#define IAVF_RX_BUFFER_WRITE 16 /* Must be power of 2 */
#define IAVF_DEFAULT_TXD 512
#define IAVF_DEFAULT_RXD 512
#define IAVF_MAX_TXD 4096
#define IAVF_MIN_TXD 64
#define IAVF_MAX_RXD 4096
#define IAVF_MIN_RXD 64
#define IAVF_REQ_DESCRIPTOR_MULTIPLE 32
#define IAVF_MAX_AQ_BUF_SIZE 4096
#define IAVF_AQ_LEN 32
#define IAVF_AQ_MAX_ERR 20 /* times to try before resetting AQ */
#define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
#define IAVF_RX_DESC(R, i) (&(((struct iavf_rx_desc *)((R)->desc))[i]))
#define IAVF_TX_DESC(R, i) (&(((struct iavf_tx_desc *)((R)->desc))[i]))
#define IAVF_TX_CTXTDESC(R, i) \
(&(((struct iavf_tx_context_desc *)((R)->desc))[i]))
#define IAVF_MAX_REQ_QUEUES 16
#define IAVF_HKEY_ARRAY_SIZE ((IAVF_VFQF_HKEY_MAX_INDEX + 1) * 4)
#define IAVF_HLUT_ARRAY_SIZE ((IAVF_VFQF_HLUT_MAX_INDEX + 1) * 4)
#define IAVF_MBPS_DIVISOR 125000 /* divisor to convert to Mbps */
#define IAVF_MBPS_QUANTA 50
#define IAVF_VIRTCHNL_VF_RESOURCE_SIZE \
virtchnl_struct_size((struct virtchnl_vf_resource *)NULL, \
vsi_res, IAVF_MAX_VF_VSI)
/* MAX_MSIX_Q_VECTORS of these are allocated,
* but we only use one per queue-specific vector.
*/
struct iavf_q_vector {
struct iavf_adapter *adapter;
struct iavf_vsi *vsi;
struct napi_struct napi;
struct iavf_ring_container rx;
struct iavf_ring_container tx;
u32 ring_mask;
u8 itr_countdown; /* when 0 should adjust adaptive ITR */
u8 num_ringpairs; /* total number of ring pairs in vector */
u16 v_idx; /* index in the vsi->q_vector array. */
u16 reg_idx; /* register index of the interrupt */
char name[IFNAMSIZ + 15];
bool arm_wb_state;
};
/* Helper macros to switch between ints/sec and what the register uses.
* And yes, it's the same math going both ways. The lowest value
* supported by all of the iavf hardware is 8.
*/
#define EITR_INTS_PER_SEC_TO_REG(_eitr) \
((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8)
#define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG
#define IAVF_DESC_UNUSED(R) \
((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
(R)->next_to_clean - (R)->next_to_use - 1)
#define OTHER_VECTOR 1
#define NONQ_VECS (OTHER_VECTOR)
#define MIN_MSIX_Q_VECTORS 1
#define MIN_MSIX_COUNT (MIN_MSIX_Q_VECTORS + NONQ_VECS)
#define IAVF_QUEUE_END_OF_LIST 0x7FF
#define IAVF_FREE_VECTOR 0x7FFF
struct iavf_mac_filter {
struct list_head list;
u8 macaddr[ETH_ALEN];
struct {
u8 is_new_mac:1; /* filter is new, wait for PF decision */
u8 remove:1; /* filter needs to be removed */
u8 add:1; /* filter needs to be added */
u8 is_primary:1; /* filter is a default VF MAC */
u8 add_handled:1; /* received response for filter add */
u8 padding:3;
};
};
Annotation
- Immediate include surface: `linux/module.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/vmalloc.h`, `linux/interrupt.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/ip.h`.
- Detected declarations: `struct iavf_vsi`, `struct iavf_q_vector`, `struct iavf_mac_filter`, `struct iavf_vlan`, `struct iavf_vlan_filter`, `struct iavf_channel_config`, `struct iavf_cloud_filter`, `struct iavf_adapter`, `enum iavf_vsi_state_t`, `enum iavf_vlan_state_t`.
- Atlas domain: Driver Families / drivers/net.
- 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.