drivers/net/ethernet/intel/i40e/i40e_txrx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_txrx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_txrx.h- Extension
.h- Size
- 18300 bytes
- Lines
- 567
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/net/intel/libie/pctype.hnet/xdp.hi40e_type.h
Detected Declarations
struct i40e_tx_bufferstruct i40e_rx_bufferstruct i40e_queue_statsstruct i40e_tx_queue_statsstruct i40e_rx_queue_statsstruct i40e_ringstruct i40e_ring_containerenum i40e_dyn_idxenum i40e_ring_statefunction i40e_intrl_usec_to_regfunction i40e_compute_padfunction i40e_skb_padfunction i40e_test_staterrfunction i40e_txd_use_countfunction ring_uses_build_skbfunction set_ring_build_skb_enabledfunction clear_ring_build_skb_enabledfunction ring_is_xdpfunction set_ring_xdpfunction i40e_rx_pg_orderfunction i40e_get_headfunction i40e_xmit_descriptor_countfunction i40e_maybe_stop_txfunction i40e_chk_linearize
Annotated Snippet
struct i40e_tx_buffer {
struct i40e_tx_desc *next_to_watch;
union {
struct xdp_frame *xdpf;
struct sk_buff *skb;
void *raw_buf;
};
unsigned int bytecount;
unsigned short gso_segs;
DEFINE_DMA_UNMAP_ADDR(dma);
DEFINE_DMA_UNMAP_LEN(len);
u32 tx_flags;
};
struct i40e_rx_buffer {
dma_addr_t dma;
struct page *page;
__u32 page_offset;
__u16 pagecnt_bias;
__u32 page_count;
};
struct i40e_queue_stats {
u64 packets;
u64 bytes;
};
struct i40e_tx_queue_stats {
u64 restart_queue;
u64 tx_busy;
u64 tx_done_old;
u64 tx_linearize;
u64 tx_force_wb;
u64 tx_stopped;
int prev_pkt_ctr;
};
struct i40e_rx_queue_stats {
u64 non_eop_descs;
u64 alloc_page_failed;
u64 alloc_buff_failed;
u64 page_reuse_count;
u64 page_alloc_count;
u64 page_waive_count;
u64 page_busy_count;
};
enum i40e_ring_state {
__I40E_TX_FDIR_INIT_DONE,
__I40E_TX_XPS_INIT_DONE,
__I40E_RING_STATE_NBITS /* must be last */
};
/* some useful defines for virtchannel interface, which
* is the only remaining user of header split
*/
#define I40E_RX_DTYPE_HEADER_SPLIT 1
#define I40E_RX_SPLIT_L2 0x1
#define I40E_RX_SPLIT_IP 0x2
#define I40E_RX_SPLIT_TCP_UDP 0x4
#define I40E_RX_SPLIT_SCTP 0x8
/* struct that defines a descriptor ring, associated with a VSI */
struct i40e_ring {
struct i40e_ring *next; /* pointer to next ring in q_vector */
void *desc; /* Descriptor ring memory */
struct device *dev; /* Used for DMA mapping */
struct net_device *netdev; /* netdev ring maps to */
struct bpf_prog *xdp_prog;
union {
struct i40e_tx_buffer *tx_bi;
struct i40e_rx_buffer *rx_bi;
struct xdp_buff **rx_bi_zc;
};
DECLARE_BITMAP(state, __I40E_RING_STATE_NBITS);
u16 queue_index; /* Queue number of ring */
u8 dcb_tc; /* Traffic class of ring */
u8 __iomem *tail;
/* Storing xdp_buff on ring helps in saving the state of partially built
* packet when i40e_clean_rx_ring_irq() must return before it sees EOP
* and to resume packet building for this ring in the next call to
* i40e_clean_rx_ring_irq().
*/
struct xdp_buff xdp;
/* Next descriptor to be processed; next_to_clean is updated only on
* processing EOP descriptor
*/
Annotation
- Immediate include surface: `linux/net/intel/libie/pctype.h`, `net/xdp.h`, `i40e_type.h`.
- Detected declarations: `struct i40e_tx_buffer`, `struct i40e_rx_buffer`, `struct i40e_queue_stats`, `struct i40e_tx_queue_stats`, `struct i40e_rx_queue_stats`, `struct i40e_ring`, `struct i40e_ring_container`, `enum i40e_dyn_idx`, `enum i40e_ring_state`, `function i40e_intrl_usec_to_reg`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.