From: Leon Hwang <leon.hwang@linux.dev>
To: chenyuan_fl@163.com, alexei.starovoitov@gmail.com,
ast@kernel.org, leon.hwang@linux.dev
Cc: bpf@vger.kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
yonghong.song@linux.dev, john.fastabend@gmail.com,
song@kernel.org, ihor.solodrai@linux.dev,
Yuan Chen <chenyuan@kylinos.cn>
Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Verify is_extended with multiple freplace links
Date: Thu, 24 Sep 2026 15:06:28 +0800 [thread overview]
Message-ID: <99f01c64-cc16-4ab8-8bb5-c8eaa6cd6e77@linux.dev> (raw)
In-Reply-To: <20260924023737.1140521-3-chenyuan_fl@163.com>
On 24/9/26 10:37, chenyuan_fl@163.com wrote:
> From: Yuan Chen <chenyuan@kylinos.cn>
>
> Extend tc_bpf2bpf with two freplace links, one on entry_tc and one on
> subprog_tc, and detach the one on the entry: while subprog_tc is still
> extended, updating entry_tc into a prog_array map must keep failing
> with -EBUSY, and succeed again once the last link detaches. The test
> asserts the rejection instead of running the prog, as the update
> succeeds and the prog loops unbounded on an unfixed kernel.
>
> Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
> ---
> .../selftests/bpf/prog_tests/tailcalls.c | 74 +++++++++++++++++++
> .../bpf/progs/tailcall_freplace_multi.c | 27 +++++++
> 2 files changed, 101 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/progs/tailcall_freplace_multi.c
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/tailcalls.c b/tools/testing/selftests/bpf/prog_tests/tailcalls.c
> index c5c9d6c359bb..aefb46778307 100644
> --- a/tools/testing/selftests/bpf/prog_tests/tailcalls.c
> +++ b/tools/testing/selftests/bpf/prog_tests/tailcalls.c
> @@ -6,6 +6,7 @@
> #include "tailcall_bpf2bpf_hierarchy2.skel.h"
> #include "tailcall_bpf2bpf_hierarchy3.skel.h"
> #include "tailcall_freplace.skel.h"
> +#include "tailcall_freplace_multi.skel.h"
> #include "tc_bpf2bpf.skel.h"
> #include "tailcall_fail.skel.h"
> #include "tailcall_cgrp_storage_owner.skel.h"
> @@ -1655,6 +1656,77 @@ static void test_tailcall_bpf2bpf_freplace(void)
> tc_bpf2bpf__destroy(tc_skel);
> }
>
> +static void test_tailcall_freplace_multi(void)
> +{
> + struct tailcall_freplace_multi *freplace_skel = NULL;
> + struct bpf_link *link_subprog = NULL, *link_entry = NULL;
> + struct tc_bpf2bpf *tc_skel = NULL;
> + int tc_prog_fd, map_fd, key = 0, err;
Pls keep the above lines with inverted Christmas tree style.
And, drop '= NULL' for tc_skel, because tc_skel is the first variable to
be initialized.
Thanks,
Leon
> +
> + tc_skel = tc_bpf2bpf__open_and_load();
> + if (!ASSERT_OK_PTR(tc_skel, "tc_bpf2bpf__open_and_load"))
> + return;
> [...]
next prev parent reply other threads:[~2026-09-24 7:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 2:37 [PATCH bpf-next v2 0/2] bpf: Keep target extended until its last freplace link detaches chenyuan_fl
2026-09-24 2:37 ` [PATCH bpf-next v2 1/2] " chenyuan_fl
2026-09-24 7:06 ` Leon Hwang
2026-09-24 9:48 ` Jiri Olsa
2026-09-24 9:58 ` chenyuan
2026-09-25 4:35 ` [PATCH bpf-next] bpf: Roll back freplace link state when bpf_arch_text_poke() fails chenyuan_fl
2026-09-25 5:18 ` bot+bpf-ci
2026-09-25 6:05 ` Leon Hwang
2026-09-28 9:08 ` chenyuan
2026-09-24 2:37 ` [PATCH bpf-next v2 2/2] selftests/bpf: Verify is_extended with multiple freplace links chenyuan_fl
2026-09-24 7:06 ` Leon Hwang [this message]
2026-09-24 8:42 ` [PATCH bpf-next v2 0/2] bpf: Keep target extended until its last freplace link detaches Jiri Olsa
2026-09-24 9:00 ` patchwork-bot+netdevbpf
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=99f01c64-cc16-4ab8-8bb5-c8eaa6cd6e77@linux.dev \
--to=leon.hwang@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chenyuan@kylinos.cn \
--cc=chenyuan_fl@163.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=yonghong.song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox