From: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org
Cc: martin.lau@linux.dev, eddyz87@gmail.com, memxor@gmail.com,
song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org,
qmo@kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v3 bpf-next 5/6] selftests/bpf: Fix up __u16 vlen assumptions
Date: Fri, 17 Apr 2026 20:06:07 +0100 [thread overview]
Message-ID: <57c7dabe-6467-4e8c-b066-0cb62625286d@gmail.com> (raw)
In-Reply-To: <20260417143023.1551481-6-alan.maguire@oracle.com>
On 4/17/26 3:30 PM, Alan Maguire wrote:
> Fix up a few cases where we assume vlen is 16 bits.
>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
> tools/testing/selftests/bpf/prog_tests/btf.c | 2 +-
> tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c | 3 +--
> tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c | 3 +--
> tools/testing/selftests/bpf/test_progs.c | 2 +-
> 4 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/btf.c b/tools/testing/selftests/bpf/prog_tests/btf.c
> index 0cc347e32db3..a9de328a8697 100644
> --- a/tools/testing/selftests/bpf/prog_tests/btf.c
> +++ b/tools/testing/selftests/bpf/prog_tests/btf.c
> @@ -8092,7 +8092,7 @@ static struct btf_dedup_test dedup_tests[] = {
> static int btf_type_size(const struct btf_type *t)
> {
> int base_size = sizeof(struct btf_type);
> - __u16 vlen = BTF_INFO_VLEN(t->info);
> + __u32 vlen = BTF_INFO_VLEN(t->info);
> __u16 kind = BTF_INFO_KIND(t->info);
>
> switch (kind) {
> diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c b/tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c
> index 5bc15bb6b7ce..6bc31236805c 100644
> --- a/tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c
> +++ b/tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c
> @@ -487,9 +487,8 @@ static void test_split_module(void)
> for (i = 0; i < ARRAY_SIZE(mod_funcs); i++) {
> const struct btf_param *p;
> const struct btf_type *t;
> - __u16 vlen;
> + __u32 vlen, j;
> __u32 id;
> - int j;
>
> id = btf__find_by_name_kind(btf1, mod_funcs[i], BTF_KIND_FUNC);
> if (!ASSERT_GE(id, nr_base_types, "func_id"))
> diff --git a/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c b/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
> index 469e92869523..5064aeb8fe67 100644
> --- a/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
> +++ b/tools/testing/selftests/bpf/prog_tests/ctx_rewrite.c
> @@ -253,8 +253,7 @@ static int find_field_offset_aux(struct btf *btf, int btf_id, char *field_name,
> {
> const struct btf_type *type = btf__type_by_id(btf, btf_id);
> const struct btf_member *m;
> - __u16 mnum;
> - int i;
> + __u32 mnum, i;
>
> if (!type) {
> PRINT_FAIL("Can't find btf_type for id %d\n", btf_id);
> diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
> index 7fe16b5131b1..cc14b13e23fe 100644
> --- a/tools/testing/selftests/bpf/test_progs.c
> +++ b/tools/testing/selftests/bpf/test_progs.c
> @@ -1257,7 +1257,7 @@ int get_bpf_max_tramp_links_from(struct btf *btf)
> const struct btf_type *t;
> __u32 i, type_cnt;
> const char *name;
> - __u16 j, vlen;
> + __u32 j, vlen;
>
> for (i = 1, type_cnt = btf__type_cnt(btf); i < type_cnt; i++) {
> t = btf__type_by_id(btf, i);
next prev parent reply other threads:[~2026-04-17 19:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 14:30 [PATCH v3 bpf-next 0/6] bpf: Extend BTF UAPI vlen, kinds to use unused bits Alan Maguire
2026-04-17 14:30 ` [PATCH v3 bpf-next 1/6] " Alan Maguire
2026-04-17 18:11 ` Mykyta Yatsenko
2026-04-17 14:30 ` [PATCH v3 bpf-next 2/6] libbpf: Adjust btf_vlen() to return a __u32 Alan Maguire
2026-04-17 17:07 ` sashiko-bot
2026-04-17 18:26 ` Mykyta Yatsenko
2026-04-17 14:30 ` [PATCH v3 bpf-next 3/6] bpftool: Support 24-bit vlen Alan Maguire
2026-04-17 18:36 ` Mykyta Yatsenko
2026-04-17 14:30 ` [PATCH v3 bpf-next 4/6] selftests/bpf: Fix up btf/invalid test for extended kind Alan Maguire
2026-04-17 19:07 ` Mykyta Yatsenko
2026-04-17 14:30 ` [PATCH v3 bpf-next 5/6] selftests/bpf: Fix up __u16 vlen assumptions Alan Maguire
2026-04-17 19:06 ` Mykyta Yatsenko [this message]
2026-04-17 14:30 ` [PATCH v3 bpf-next 6/6] Documentation/bpf: Update btf doc with updated vlen, kind sizes Alan Maguire
2026-04-17 15:39 ` bot+bpf-ci
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=57c7dabe-6467-4e8c-b066-0cb62625286d@gmail.com \
--to=mykyta.yatsenko5@gmail.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=qmo@kernel.org \
--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