]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Convert glob_match() to bpf arena
authorAlexei Starovoitov <ast@kernel.org>
Tue, 11 Nov 2025 03:29:31 +0000 (19:29 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 14 Nov 2025 21:57:28 +0000 (13:57 -0800)
commit63066b7a8ed544592005c66c261625204d2ec99a
treebc301b7452b5fa2b88dcf1bc3f3518eb58e0b4b0
parentfea3f5e83c5cd80a76d97343023a2f2e6bd862bf
selftests/bpf: Convert glob_match() to bpf arena

Increase arena test coverage.
Convert glob_match() to bpf arena in two steps:
1.
Copy paste lib/glob.c into bpf_arena_strsearch.h
Copy paste lib/globtests.c into progs/arena_strsearch.c

2.
Add __arena to pointers
Add __arg_arena to global functions that accept arena pointers
Add cond_break to loops

The test also serves as a good example of what's possible
with bpf arena and how existing algorithms can be converted.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251111032931.21430-1-alexei.starovoitov@gmail.com
tools/testing/selftests/bpf/bpf_arena_strsearch.h [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/arena_strsearch.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/arena_strsearch.c [new file with mode: 0644]