Cloudflare

A deep dive into BPF LPM trie performance and optimization

Oct 21, 2025Matt Fleming, Jesper Brouer
A deep dive into BPF LPM trie performance and optimization
SummaryAI, from the source post

This post dives deep into the performance of BPF LPM tries, a critical data structure used for IP and IP+Port matching in network packet routing and firewall rules. It explains the mechanics of tries, highlights the shortcomings of the current BPF LPM trie implementation (limited branching, lack of level compression), and presents benchmark data showing performance degradation with increasing entry counts. The post identifies specific bottlenecks like slow lookups, updates, deletes, and particularly map freeing, which can lead to production issues like soft lockups and packet loss, setting the stage for future optimization efforts.

More from the Hardware Infrastructure & Performance Optimization trail