selftests/bpf: Fix wq test.
authorAlexei Starovoitov <ast@kernel.org>
Wed, 24 Apr 2024 20:57:18 +0000 (13:57 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 24 Apr 2024 21:05:05 +0000 (14:05 -0700)
commit82e38a505c9868e784ec31e743fd8a9fa5ca1084
tree90df058db0db4dde730a1aff5fb2eb4119db8634
parent5305b378b351dc5fd55f5f1f37ef362ae0e11d7e
selftests/bpf: Fix wq test.

The wq test was missing destroy(skel) part which was causing bpf progs to stay
loaded. That was causing test_progs to complain with
"Failed to unload bpf_testmod.ko from kernel: -11" message, but adding
destroy() wasn't enough, since wq callback may be delayed, so loop on unload of
bpf_testmod if errno is EAGAIN.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Fixes: 8290dba51910 ("selftests/bpf: wq: add bpf_wq_start() checks")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/wq.c
tools/testing/selftests/bpf/testing_helpers.c