Re: [PATCH bpf-next v2 12/16] selftests/bpf: wq: add bpf_wq_init() checks

From: Andrii Nakryiko
Date: Wed Apr 24 2024 - 20:29:13 EST


On Sat, Apr 20, 2024 at 2:10 AM Benjamin Tissoires <bentiss@xxxxxxxxxx> wrote:
>
> Allows to test if allocation/free works
>
> Signed-off-by: Benjamin Tissoires <bentiss@xxxxxxxxxx>
>
> ---
>
> changes in v2:
> - dropped mark_precise checks
> ---
> tools/testing/selftests/bpf/bpf_experimental.h | 1 +
> tools/testing/selftests/bpf/prog_tests/wq.c | 8 +++
> tools/testing/selftests/bpf/progs/wq.c | 10 ++++
> tools/testing/selftests/bpf/progs/wq_failures.c | 78 +++++++++++++++++++++++++
> 4 files changed, 97 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h
> index 3329ea080865..785b91b629be 100644
> --- a/tools/testing/selftests/bpf/bpf_experimental.h
> +++ b/tools/testing/selftests/bpf/bpf_experimental.h
> @@ -470,4 +470,5 @@ extern int bpf_iter_css_new(struct bpf_iter_css *it,
> extern struct cgroup_subsys_state *bpf_iter_css_next(struct bpf_iter_css *it) __weak __ksym;
> extern void bpf_iter_css_destroy(struct bpf_iter_css *it) __weak __ksym;
>
> +extern int bpf_wq_init(struct bpf_wq *wq, void *p__map, unsigned int flags) __weak __ksym;
> #endif
> diff --git a/tools/testing/selftests/bpf/prog_tests/wq.c b/tools/testing/selftests/bpf/prog_tests/wq.c
> index 9a07b8bc2c52..26ab69796103 100644
> --- a/tools/testing/selftests/bpf/prog_tests/wq.c
> +++ b/tools/testing/selftests/bpf/prog_tests/wq.c
> @@ -2,6 +2,7 @@
> /* Copyright (c) 2024 Benjamin Tissoires */
> #include <test_progs.h>
> #include "wq.skel.h"
> +#include "wq_failures.skel.h"
>
> void serial_test_wq(void)
> {
> @@ -9,3 +10,10 @@ void serial_test_wq(void)
>
> RUN_TESTS(wq);
> }
> +
> +void serial_test_failures_wq(void)
> +{
> + LIBBPF_OPTS(bpf_test_run_opts, topts);
> +

unused leftover?

> + RUN_TESTS(wq_failures);
> +}

[...]