test: split up BPF tests
RFC 1/1 test: split up BPF tests
The BPF tests have two sections. One is doing tests of the BPF interpreter and the other is for testing the ELF load part. The latter requires the null PMD to work, so only build it present.
--- app/test/meson.build | 1 + app/test/test_bpf.c | 475 ---------------------------------- app/test/test_bpf_elf.c | 560 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 561 insertions(+), 475 deletions(-) create mode 100644 app/test/test_bpf_elf.c
app/test/meson.build +1 -0
@@ -35,6 +35,7 @@ source_file_deps = { 'test_bitset.c': [], 'test_bitratestats.c': ['metrics', 'bitratestats', 'ethdev'] + sample_packet_forward_deps, 'test_bpf.c': ['bpf', 'net'], + 'test_bpf_elf.c': ['bpf', 'net_null'], 'test_byteorder.c': [], 'test_cfgfile.c': ['cfgfile'], 'test_cksum.c': ['net'],
app/test/test_bpf.c +0 -475
487 lines not on this page · raw message
app/test/test_bpf_elf.c new file +560 -0
560 lines not on this page · raw message
Signature · 1 line
2.51.0
Quoted 4 lines
The BPF tests have two sections. One is doing tests of the BPF interpreter and the other is for testing the ELF load part. The latter requires the null PMD to work, so only build it present.
Splitting BPF tests into multiple files makes sense, and not just because of dependencies.
Coupling ELF tests with the presence of null PMD is strange, there might be a lot of BPF ELF tests that do not depend on null or any PMD, and there might be other BPF tests depending on PMD. Maybe we should call the new file test_bpf_ethdev.c instead (following the header name rte_bpf_ethdev.h , regardless of what one thinks of the name), or something like this.
Quoted 5 lines · On Fri, 23 Jan 2026 10:44:19 +0000 Marat Khalili <[email protected]>…
Quoted 4 lines
The BPF tests have two sections. One is doing tests of the BPF interpreter and the other is for testing the ELF load part. The latter requires the null PMD to work, so only build it present.
Quoted 8 lines
Splitting BPF tests into multiple files makes sense, and not just because of dependencies.
Coupling ELF tests with the presence of null PMD is strange, there might be a lot of BPF ELF tests that do not depend on null or any PMD, and there might be other BPF tests depending on PMD. Maybe we should call the new file
test_bpf_ethdev.cinstead (following the header namerte_bpf_ethdev.h, regardless of what one thinks of the name), or something like this.
I did more experiments and a simplistic split up (via AI)
did not work because the filter test is using similar test to call DPDK function. There actually is a bunch of overlap, and duplicating code is worse.
But it is possible to just skip the filtering tests if null PMD is not compiled in. The filtering tests do need a device to hang their filters off of and null was used elsewhere already.
Working on a revision to do that.