-
Notifications
You must be signed in to change notification settings - Fork 146
selftests/bpf: Add LPM trie microbenchmarks #9323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: 0768e98 |
2bf6e60
to
63bd3e4
Compare
Upstream branch: 0ee30d9 |
48e40bc
to
df75244
Compare
63bd3e4
to
1c4f46e
Compare
Upstream branch: 0ee30d9 |
df75244
to
0a6ba87
Compare
1c4f46e
to
b5a617e
Compare
Upstream branch: beb1097 |
0a6ba87
to
bdd660e
Compare
b5a617e
to
ffefc6d
Compare
Upstream branch: 42be23e |
bdd660e
to
748bd14
Compare
Upstream branch: 42be23e |
748bd14
to
a17a12c
Compare
Upstream branch: 42be23e |
a17a12c
to
3d9af35
Compare
ffefc6d
to
4ccf98a
Compare
Upstream branch: 42be23e |
Add benchmarks for the standard set of operations: lookup, update, delete. Also, include a benchmark for trie_free() which is known to have terrible performance for maps with many entries. Benchmarks operate on tries without gaps in the key range, i.e. each test begins with a trie with valid keys in the range [0, nr_entries). This is intended to cause maximum branching when traversing the trie. All measurements are recorded inside the kernel to remove syscall overhead. Most benchmarks run an XDP program to generate stats but free needs to collect latencies using fentry/fexit on map_free_deferred() because it's not possible to use fentry directly on lpm_trie.c since commit c83508d ("bpf: Avoid deadlock caused by nested kprobe and fentry bpf programs") and there's no way to create/destroy a map from within an XDP program. Here is example output from an AMD EPYC 9684X 96-Core machine for each of the benchmarks using a trie with 10K entries and a 32-bit prefix length, e.g. $ ./bench lpm-trie-$op \ --prefix_len=32 \ --producers=1 \ --nr_entries=10000 lookup: throughput 7.423 ± 0.023 M ops/s ( 7.423M ops/prod), latency 134.710 ns/op update: throughput 2.643 ± 0.015 M ops/s ( 2.643M ops/prod), latency 378.310 ns/op delete: throughput 0.712 ± 0.008 M ops/s ( 0.712M ops/prod), latency 1405.152 ns/op free: throughput 0.574 ± 0.003 K ops/s ( 0.574K ops/prod), latency 1.743 ms/op Tested-by: Jesper Dangaard Brouer <[email protected]> Reviewed-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
3d9af35
to
ed411d8
Compare
Pull request for series with
subject: selftests/bpf: Add LPM trie microbenchmarks
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=983797