From: sashiko-bot@kernel.org
To: "Andrey Grodzovsky" <andrey.grodzovsky@crowdstrike.com>,
bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v8 5/7] selftests/bpf: Cover BPF program load strategy transitions
Date: Sat, 24 Oct 2026 01:54:52 +0000 [thread overview]
Message-ID: <sashiko-outbox-183497@kernel.org> (raw)
In-Reply-To: <20261024014514.2959514-6-andrey.grodzovsky@crowdstrike.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/bpf: redundant standalone load_type test duplicates autoload test
--
commit a706cefdc370f05d909294879af1c74efbca1c5c
Author: Slava Imameev <slava.imameev@crowdstrike.com>
selftests/bpf: Cover BPF program load strategy transitions
This commit adds a standalone load_type selftest covering BPF program load
strategy transitions between disabled, auto, and manual modes,
bpf_program__set_autoload() compatibility, and the manual load and attach
cycle after the object is loaded.
> diff --git a/tools/testing/selftests/bpf/prog_tests/load_type.c b/tools/testing/selftests/bpf/prog_tests/load_type.c
> new file mode 100644
> index 0000000000000..7e344c0b04450
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/load_type.c
> @@ -0,0 +1,154 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <test_progs.h>
> +#include <time.h>
> +#include "test_load_type.skel.h"
> +
> +void test_load_type(void)
> +{
> + struct bpf_link *link = NULL;
> + struct test_load_type *skel;
> + int err;
> +
> + skel = test_load_type__open();
> + if (!ASSERT_OK_PTR(skel, "skel_open"))
> + return;
[ ... ]
> diff --git a/tools/testing/selftests/bpf/progs/test_load_type.c b/tools/testing/selftests/bpf/progs/test_load_type.c
> new file mode 100644
> index 0000000000000..3d9b81691d7ad
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_load_type.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include "vmlinux.h"
> +#include <bpf/bpf_helpers.h>
> +
> +bool prog1_called = false;
> +bool prog2_called = false;
> +bool prog3_called = false;
> +
> +SEC("raw_tp/sys_enter")
> +int prog1(const void *ctx)
> +{
> + prog1_called = true;
> + return 0;
> +}
[Severity: Low]
tools/testing/selftests/bpf/prog_tests/autoload.c and
tools/testing/selftests/bpf/progs/test_autoload.c already exist in the same
directories to test bpf_program__set_autoload() and selective program
loading using prog1, prog2, prog3 and prog1_called, prog2_called,
prog3_called:
tools/testing/selftests/bpf/prog_tests/autoload.c:test_autoload() {
int duration = 0, err;
struct test_autoload* skel;
...
/* don't load prog3 */
bpf_program__set_autoload(skel->progs.prog3, false);
}
Since bpf_program__set_autoload() is a thin wrapper around
bpf_program__set_load_strategy(), and commit ("selftests/bpf: Cover BPF
program manual loading") in the same series also adds
tools/testing/selftests/bpf/prog_tests/manual_load.c and
tools/testing/selftests/bpf/progs/test_manual_load.c with the same
prog1, prog2, prog3 raw_tp/sys_enter programs and post-load manual
load/attach sequence in manual_load_verify_main_cycle(), could these
bpf_program__set_load_strategy() transition checks extend test_autoload()
in prog_tests/autoload.c or be consolidated as a subtest in
prog_tests/manual_load.c instead of adding standalone prog_tests/load_type.c
and progs/test_load_type.c files?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261024014514.2959514-1-andrey.grodzovsky@crowdstrike.com?part=5
next prev parent reply other threads:[~2026-10-24 1:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 1:45 [PATCH bpf-next v8 0/7] libbpf: BPF program manual loading Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 1/7] libbpf: Reject gen_loader set after PREPARE step Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 2/7] libbpf: BPF program load strategy enum Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 3/7] libbpf: BPF programs manual loading and attaching Andrey Grodzovsky
2026-10-24 2:03 ` sashiko-bot
2026-10-24 3:43 ` Alexei Starovoitov
2026-10-28 2:06 ` Andrey Grodzovsky
2026-10-29 17:59 ` Andrii Nakryiko
2026-10-29 22:41 ` Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 4/7] libbpf: Support declarative manual load via SEC("!...") prefix Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 5/7] selftests/bpf: Cover BPF program load strategy transitions Andrey Grodzovsky
2026-10-24 1:54 ` sashiko-bot [this message]
2026-10-24 2:23 ` bot+bpf-ci
2026-10-24 1:45 ` [PATCH bpf-next v8 6/7] selftests/bpf: Cover BPF program manual loading Andrey Grodzovsky
2026-10-24 1:45 ` [PATCH bpf-next v8 7/7] selftests/bpf: Convert veristat to BPF_PROG_LOAD_STRATEGY_MANUAL Andrey Grodzovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-183497@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andrey.grodzovsky@crowdstrike.com \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.