Skip to main content

Module af_xdp

Module af_xdp 

Source
Expand description

AF_XDP (XSK) kernel-bypass driver and UMEM shared memory pool.

Provides zero-copy memory buffers (UmemPool) and ring buffer descriptors (FillRing, CompletionRing) for kernel-bypass packet I/O.

Low-level libc XSK/XDP structures and unsafe memory mappings are quarantined within this module, with explicit // SAFETY: justifications on all unsafe blocks.

Structs§

CompletionRing
Ring buffer for UMEM completion descriptors (chunk addresses pushed by kernel/NIC after TX completion).
FillRing
Ring buffer for UMEM fill descriptors (chunk addresses pushed by userspace for the kernel/NIC to fill).
RxRing
Circular descriptor ring for AF_XDP RX packets.
TxRing
Circular descriptor ring for AF_XDP TX packets.
UmemPool
Pre-allocated page-aligned shared memory pool for AF_XDP kernel-bypass I/O.
UmemPoolConfig
Configuration parameters for allocating an AF_XDP UmemPool.
UmemSlab
Dedicated per-core / per-queue UMEM chunk slab for lock-free AF_XDP multi-worker scaling.
XskDesc
Descriptor for AF_XDP packets in RX and TX rings.
XskSocket
AF_XDP socket with three-tier opportunistic fallback engine.

Enums§

XskBindMode
The operational mode for AF_XDP binding, with automatic fallback.

Constants§

ENOTSUPP
Linux internal errno for unsupported operation (ENOTSUPP).
UMEM_CHUNK_SIZE
Default UMEM chunk size in bytes (2 KiB aligns with MTU 1500 + wire overhead).
UMEM_RING_SIZE
Default ring size in descriptors (must be a power of two).
XDP_COPY
Flag for copy-mode bind in AF_XDP (XDP_COPY).
XDP_ZEROCOPY
Alias for XDP_ZERO_COPY matching kernel naming XDP_ZEROCOPY.
XDP_ZERO_COPY
Flag for zero-copy mode bind in AF_XDP (XDP_ZEROCOPY).