include/net/libeth/types.h
Source file repositories/reference/linux-study-clean/include/net/libeth/types.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/libeth/types.h- Extension
.h- Size
- 3266 bytes
- Lines
- 128
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/workqueue.h
Detected Declarations
struct libeth_rq_napi_statsstruct libeth_sq_napi_statsstruct libeth_xdpsq_napi_statsstruct libeth_xdpsq_lockstruct libeth_xdpsq_timerstruct libeth_xdp_buff_stash
Annotated Snippet
struct libeth_rq_napi_stats {
union {
struct {
u32 packets;
u32 bytes;
u32 fragments;
u32 hsplit;
};
DECLARE_FLEX_ARRAY(u32, raw);
};
};
/**
* struct libeth_sq_napi_stats - "hot" counters to update in Tx completion loop
* @packets: completed frames counter
* @bytes: sum of bytes of completed frames above
* @raw: alias to access all the fields as an array
*/
struct libeth_sq_napi_stats {
union {
struct {
u32 packets;
u32 bytes;
};
DECLARE_FLEX_ARRAY(u32, raw);
};
};
/**
* struct libeth_xdpsq_napi_stats - "hot" counters to update in XDP Tx
* completion loop
* @packets: completed frames counter
* @bytes: sum of bytes of completed frames above
* @fragments: sum of fragments of completed S/G frames
* @raw: alias to access all the fields as an array
*/
struct libeth_xdpsq_napi_stats {
union {
struct {
u32 packets;
u32 bytes;
u32 fragments;
};
DECLARE_FLEX_ARRAY(u32, raw);
};
};
/* XDP */
/*
* The following structures should be embedded into driver's queue structure
* and passed to the libeth_xdp helpers, never used directly.
*/
/* XDPSQ sharing */
/**
* struct libeth_xdpsq_lock - locking primitive for sharing XDPSQs
* @lock: spinlock for locking the queue
* @share: whether this particular queue is shared
*/
struct libeth_xdpsq_lock {
spinlock_t lock;
bool share;
};
/* XDPSQ clean-up timers */
/**
* struct libeth_xdpsq_timer - timer for cleaning up XDPSQs w/o interrupts
* @xdpsq: queue this timer belongs to
* @lock: lock for the queue
* @dwork: work performing cleanups
*
* XDPSQs not using interrupts but lazy cleaning, i.e. only when there's no
* space for sending the current queued frame/bulk, must fire up timers to
* make sure there are no stale buffers to free.
*/
struct libeth_xdpsq_timer {
void *xdpsq;
struct libeth_xdpsq_lock *lock;
struct delayed_work dwork;
};
/* Rx polling path */
/**
* struct libeth_xdp_buff_stash - struct for stashing &xdp_buff onto a queue
* @data: pointer to the start of the frame, xdp_buff.data
Annotation
- Immediate include surface: `linux/workqueue.h`.
- Detected declarations: `struct libeth_rq_napi_stats`, `struct libeth_sq_napi_stats`, `struct libeth_xdpsq_napi_stats`, `struct libeth_xdpsq_lock`, `struct libeth_xdpsq_timer`, `struct libeth_xdp_buff_stash`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.