XDP BFD Integrates with Stock FRR, Eliminates Flaps Under Stress
XDP-based BFD now integrates with stock FRR bfdd, cutting flaps to zero under stress and uncovering upstream FRR and kernel bugs along the way.
An open-source XDP-based BFD dataplane has been integrated with stock FRR's bfdd daemon, with session lifecycle managed through bfdd's existing bfddp dataplane socket while packets ride the XDP fast path. No FRR patches are required, and show bfd peers counters reads directly out of BPF maps.
Under identical SCHED_FIFO stress, unmodified bfdd logged 107 session flaps while the XDP-backed session recorded zero, with a mean per-packet processing cost around 701ns covering parsing, TTL/GTSM checks, demultiplexing, map updates, and rewrite/XDP_TX for echo packets. A --dp-hold mode keeps wire sessions alive across bfdd restarts by orphaning and re-adopting sessions by address pair, validated across repeated restarts with zero peer-visible events.
The integration work surfaced a real FRR bug: bfdd's dataplane socket passed an oversized connect() addrlen exceeding sockaddr_un's limit, causing EINVAL failures that were reported upstream and merged as a fix. Several XDP-side issues were also found and fixed, including a validation gap that let rejected packets leak to userspace via XDP_PASS instead of DROP, a bypass for IP-options packets, an echo-path length/checksum bug, and a cross-CPU timestamp wraparound bug that was independently reintroduced in a second code path.
The project remains limited to single sessions, IPv4, and VM-only benchmarks, with multi-session support, IPv6, and bare-metal testing planned next. For engineers building high-performance dataplanes, the writeup is a useful case study in the operational costs of merging kernel-bypass techniques with existing control-plane daemons.