selftests/bpf: BPF test_prog selftests for bpf_loop inlining
authorEduard Zingerman <eddyz87@gmail.com>
Mon, 20 Jun 2022 23:53:44 +0000 (02:53 +0300)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Jun 2022 00:40:52 +0000 (17:40 -0700)
commit0e1bf9ed2000c16fa8e0703e255a23d64a4adb27
tree08ba017f0e2d9b36b1ed98b1e324536be50e83a5
parentf8acfdd04410d26b096a7082444cdc402df10f89
selftests/bpf: BPF test_prog selftests for bpf_loop inlining

Two new test BPF programs for test_prog selftests checking bpf_loop
behavior. Both are corner cases for bpf_loop inlinig transformation:
 - check that bpf_loop behaves correctly when callback function is not
   a compile time constant
 - check that local function variables are not affected by allocating
   additional stack storage for registers spilled by loop inlining

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/r/20220620235344.569325-6-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_loop.c
tools/testing/selftests/bpf/progs/bpf_loop.c