From: Yonghong Song <yonghong.song@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kernel Team <kernel-team@fb.com>,
Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v2 3/4] selftests/bpf: Fix ringbuf/ringbuf_write test failure with arm64 64KB page size
Date: Fri, 6 Jun 2025 14:23:31 -0700 [thread overview]
Message-ID: <2afefc5b-5bb9-416e-894d-e604f39d7ab7@linux.dev> (raw)
In-Reply-To: <CAADnVQJ+eOP7N4ihV6fkOQHiEc6fkH4qkcJnHogUoLWexsj-PA@mail.gmail.com>
On 6/6/25 1:53 PM, Alexei Starovoitov wrote:
> On Fri, Jun 6, 2025 at 10:42 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>> The ringbuf max_entries must be PAGE_ALIGNED. See kernel function
>> ringbuf_map_alloc(). So for arm64 64KB page size, adjust max_entries
>> properly.
>>
>> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
>> ---
>> tools/testing/selftests/bpf/prog_tests/ringbuf.c | 5 +++--
>> tools/testing/selftests/bpf/progs/test_ringbuf_write.c | 5 +++--
>> 2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/testing/selftests/bpf/prog_tests/ringbuf.c b/tools/testing/selftests/bpf/prog_tests/ringbuf.c
>> index da430df45aa4..89fd3401a23e 100644
>> --- a/tools/testing/selftests/bpf/prog_tests/ringbuf.c
>> +++ b/tools/testing/selftests/bpf/prog_tests/ringbuf.c
>> @@ -97,7 +97,8 @@ static void ringbuf_write_subtest(void)
>> if (!ASSERT_OK_PTR(skel, "skel_open"))
>> return;
>>
>> - skel->maps.ringbuf.max_entries = 0x4000;
>> + skel->maps.ringbuf.max_entries = 4 * page_size;
>> + skel->rodata->reserve_size = 3 * page_size;
>>
>> err = test_ringbuf_write_lskel__load(skel);
>> if (!ASSERT_OK(err, "skel_load"))
>> @@ -108,7 +109,7 @@ static void ringbuf_write_subtest(void)
>> mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0);
>> if (!ASSERT_OK_PTR(mmap_ptr, "rw_cons_pos"))
>> goto cleanup;
>> - *mmap_ptr = 0x3000;
>> + *mmap_ptr = 3 * page_size;
>> ASSERT_OK(munmap(mmap_ptr, page_size), "unmap_rw");
>>
>> skel->bss->pid = getpid();
>> diff --git a/tools/testing/selftests/bpf/progs/test_ringbuf_write.c b/tools/testing/selftests/bpf/progs/test_ringbuf_write.c
>> index 350513c0e4c9..9acef7afbe8a 100644
>> --- a/tools/testing/selftests/bpf/progs/test_ringbuf_write.c
>> +++ b/tools/testing/selftests/bpf/progs/test_ringbuf_write.c
>> @@ -12,6 +12,7 @@ struct {
>>
>> /* inputs */
>> int pid = 0;
>> +const volatile int reserve_size = 0;
> See CI failure:
> |test_ringbuf_write.bpf.o|test_ringbuf_write|success -> failure (!!)|+0.00 % |
>
> I think it's better to init reserve_size with some reasonable
> constant to keep veristat happy.
Yes, I am aware of this and actually fixed locally already. Will send out v3 soon.
>
> pw-bot: cr
next prev parent reply other threads:[~2025-06-06 21:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 17:41 [PATCH bpf-next v2 0/4] selftests/bpf: Fix a few test failures with arm64 64KB page Yonghong Song
2025-06-06 17:41 ` [PATCH bpf-next v2 1/4] selftests/bpf: Reduce test_xdp_adjust_frags_tail_grow logs Yonghong Song
2025-06-06 17:41 ` [PATCH bpf-next v2 2/4] selftests/bpf: Fix bpf_mod_race test failure with arm64 64KB page size Yonghong Song
2025-06-06 17:41 ` [PATCH bpf-next v2 3/4] selftests/bpf: Fix ringbuf/ringbuf_write " Yonghong Song
2025-06-06 20:53 ` Alexei Starovoitov
2025-06-06 21:23 ` Yonghong Song [this message]
2025-06-06 17:42 ` [PATCH bpf-next v2 4/4] selftests/bpf: Fix a user_ringbuf " Yonghong Song
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=2afefc5b-5bb9-416e-894d-e604f39d7ab7@linux.dev \
--to=yonghong.song@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
/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.