Skip to main content

Module ring

Module ring 

Source
Expand description

Zero-Copy SPSC Ring Buffer with AF_XDP Integration

This implementation uses pinned allocations and proper memory ordering for single-producer/single-consumer DMA-style hand-off.

Optimizations:

  • 4x larger capacity (4096) for better batching
  • Prefetching in hot paths for cache-friendly access
  • Optimal cache-line padding (128 bytes) to avoid false sharing

Structsยง

RingConfig
Ring buffer configuration with backpressure thresholds
SpscRingBuffer
Zero-copy SPSC ring buffer with proper memory ordering