Mykyta Yatsenko
bca2b74ea9
selftests/bpf: Add more bpf_wq tests
...
Add bpf_wq selftests to verify:
* BPF program using non-constant offset of struct bpf_wq is rejected
* BPF program using map with no BTF for storing struct bpf_wq is rejected
Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com >
Tested-by: Eduard Zingerman <eddyz87@gmail.com >
Link: https://lore.kernel.org/r/20251010164606.147298-2-mykyta.yatsenko5@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2025-10-10 11:12:51 -07:00
Benjamin Tissoires
05cbc217aa
selftests/bpf: Drop an unused local variable
...
Some copy/paste leftover, this is never used.
Fixes: e3d9eac99a ("selftests/bpf: wq: add bpf_wq_init() checks")
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com >
Link: https://lore.kernel.org/bpf/20240430-bpf-next-v3-3-27afe7f3b17c@kernel.org
2024-04-30 16:28:58 +02:00
Alexei Starovoitov
82e38a505c
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: 8290dba519 ("selftests/bpf: wq: add bpf_wq_start() checks")
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2024-04-24 14:05:05 -07:00
Benjamin Tissoires
8290dba519
selftests/bpf: wq: add bpf_wq_start() checks
...
Allows to test if allocation/free works
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org >
Link: https://lore.kernel.org/r/20240420-bpf_wq-v2-16-6c986a5a741f@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2024-04-23 19:46:57 -07:00
Benjamin Tissoires
e3d9eac99a
selftests/bpf: wq: add bpf_wq_init() checks
...
Allows to test if allocation/free works
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org >
Link: https://lore.kernel.org/r/20240420-bpf_wq-v2-12-6c986a5a741f@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2024-04-23 19:46:57 -07:00
Benjamin Tissoires
b4abee7c1a
selftests/bpf: add bpf_wq tests
...
We simply try in all supported map types if we can store/load a bpf_wq.
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org >
Link: https://lore.kernel.org/r/20240420-bpf_wq-v2-10-6c986a5a741f@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2024-04-23 19:46:53 -07:00