Re: [PATCH net-next v2 03/14] bpf: Make BPF skb extension survive packet scrubbing
flat view
From: Jakub Sitnicki <jakub@cloudflare.com>
Date: 2026-10-02 12:37:55
Also in:
bpf
On Wed, Sep 30, 2026 at 09:00 AM GMT, Alexei Starovoitov wrote:
On Tue Sep 29, 2026 at 8:32 PM UTC, Jakub Sitnicki wrote:quoted
Everything pushed to: https://github.com/jsitnicki/skb-metadata-bench/tree/main/profilelooks like you had lockdep on, so all the data and conclusions likely do not correlate to production. Pls fix and remeasure everything.
Thanks. This makes much more sense now.
1) Lockdep was on. Fixed. Configs published to [1].
2) Switched from mpstat to bpf_stats since bpf-skb-ext cost was so low
now that it was drowning in the noise. skb extension teardown is not
accounted for.
3) With rhash, I noticed churn from auto-shrinking in map_update_elem
(can be seen in gtpchurn profile [2]). LLM suggested a one-line fix to
set min_size from map_extra hint. Benchmarks ran with this patch [3].
New results (prog runtime from bpf_stats in nsec):
~/bench $ just bpfstats
python3 tools/bpfstats.py --agg results-1 results-2 results-3
variant prog results-1 results-2 results-3 total mean ± spread
-------------------------------------------------------------------------------------------
ext-cnt cnt_ingress 35.9 35.6 35.5 106.7 ± 2.2
cnt_egress 70.3 73.5 69.2
ext-ext ext_write 199.3 198.9 203.0 263.8 ± 1.9
ext_read 63.1 64.1 63.2
gtp-cnt cnt_ingress 34.4 34.3 34.6 94.6 ± 2.5
cnt_egress 59.9 58.1 62.7
gtp-gtp gtp_write 531.0 555.9 567.2 920.9 ± 34.5
gtp_read 85.1 87.5 91.2
gtp_skb_free 267.1 283.9 293.9
gtp-gtpchurn gtp_write 784.9 782.6 830.6 1190.8 ± 44.2
gtp_read 82.5 82.3 88.6
gtp_skb_free 297.5 294.7 328.7
gtp-gtplru gtplru_write 394.9 391.9 394.5 542.8 ± 1.1
gtplru_read 48.2 49.4 48.9
gtplru_skb_free 99.9 100.4 100.5
gtp-gtp is with nelem_hint+min_size hint set.
gtp-gtpchurn is without it (map_extra=0).
perf reports and flamegraphs also updated [4].
[1] https://github.com/jsitnicki/skb-metadata-bench/tree/main/configs
[2] https://raw.githubusercontent.com/jsitnicki/skb-metadata-bench/refs/heads/main/profile/perf.gtp-gtpchurn.svg
[3] https://github.com/jsitnicki/skb-metadata-bench/blob/main/patches/rht-no-shrink-churn.patch
[4] https://github.com/jsitnicki/skb-metadata-bench/tree/main/profile