Session

AF_XDP copy mode needs more love

Speakers

Jason Xing

Label

Nuts and Bolts

Session Type

Talk

Description

In practice, only a handful of drivers (e.g., ice, bnxt, mlx5) benefit from AF_XDP’s zero-copy mode. For the vast majority of deployments — virtual machines on virtio-net, containers interconnected via veth, and the long tail of hardware without dedicated XSK support — zero-copy is simply not an option. Copy mode thus serves as the de facto universal data path, yet it has received far less attention than its zero-copy counterpart. This talk covers both the correctness fixes recently merged into mainline (multi-buffer TX buffer leaks, continuation descriptor handling, TOCTOU in metadata) and a set of ongoing performance optimizations that, taken together, deliver close to a 2× throughput improvement. These gains did not come from a single silver bullet. They are the result of methodical, fine-grained profiling — cycle-level perf analysis, lock contention tracing, cache-line bouncing detection, and structure layout heat-mapping — applied across every layer of the copy-mode TX path. The optimizations include:

  1. remove limited budget per sendto
  2. use fine grained locks
  3. re-organize of hot structures
  4. introduce batch xmit mechanism
  5. coalesce doorbell writes
  6. accelerate skb memory allocation
  7. minimize IRQ disable/enable pairs …