Getting Started withXDP
Pick the minimum viable feature set
Packet read/write, drop/pass/forward, bpf table access
Pick a candidate driver
mlx4 40G (because I had it on hand)
Hack it together
XDP Benchmarks (singlecore)
Generated using pktgen - (scripts in $kernelsrc/samples/pktgen)
ip routing drop: ~3.6 Mpps
tc clsact drop using bpf: ~4.2 Mpps
xdp drop using bpf: 20 Mpps (<10 % cpu util)
xdp forward with rewrite: 10 Mpps
6.
Specific Challenges inmlx4
Need to find where to run BPF program - Before SKB Allocation
Multiple packets per page
good for memory density, bad for fast-reuse of pages
Pages are dma-mapped as read-only
XDP_TX feature needs lockless access to hardware tx ring
Fast enough packet rate stresses linux page allocator
7.
XDP Upstream Status
InitialAPI done!
Support for mlx4 driver (Mellanox Connect{3, 3-Pro})
Prototypes for mlx5, ixgbe, e1000 for testing
Ready in Linux 4.8
1200 LOC
Available now in http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git