From: Menglong Dong <menglong.dong@linux.dev>
To: Menglong Dong <menglong8.dong@gmail.com>,
ast@kernel.org, olsajiri@gmail.com,
Leon Hwang <leon.hwang@linux.dev>
Cc: daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev,
eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, shuah@kernel.org,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2] selftests/bpf: test access to ringbuf position with map pointer
Date: Tue, 24 Mar 2026 17:24:43 +0800 [thread overview]
Message-ID: <1949963.tdWV9SEqCh@7940hx> (raw)
In-Reply-To: <d749228d-15b8-4487-8c2f-604b9d5d4316@linux.dev>
On 2026/3/24 10:53 Leon Hwang <leon.hwang@linux.dev> write:
> On 23/3/26 10:18, Menglong Dong wrote:
> > Add the testing to access the bpf_ringbuf with the map pointer.
> > "consumer_pos" and "producer_pos" is accessed in this testing. We reserve
> > 128 bytes in the ringbuf to test the producer_pos, which should be
> > "128 + 8", and the "8" is BPF_RINGBUF_HDR_SZ.
> >
> > It will be helpful if we want to evaluate the usage of the ringbuf in bpf
> > prog with the consumer and producer position.
> >
>
> 128 is a plain test for ringbuf, like those in
> ringbuf_overwrite_mode_subtest().
>
> The reserved size can be 0; however, a test for it is missing. It would
> be better to add a test against 0-size here or there.
>
> > Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
> > Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
>
> Acked-by: Leon Hwang <leon.hwang@linux.dev>
>
> One nit below.
>
> > ---
[...]
> > +
>
> NIT: Use BPF_RINGBUF_HDR_SZ directly. Is it missing in vmlinux.h?
Yeah, it is available in vmlinux.h, I should use it directly. I'll
respin a V3.
Thanks!
Menglong Dong
>
> Thanks,
> Leon
>
> > return 1;
> > }
> >
>
>
>
prev parent reply other threads:[~2026-03-24 9:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 2:18 [PATCH bpf-next v2] selftests/bpf: test access to ringbuf position with map pointer Menglong Dong
2026-03-23 10:59 ` Jiri Olsa
2026-03-24 9:21 ` Menglong Dong
2026-03-24 2:53 ` Leon Hwang
2026-03-24 9:24 ` Menglong Dong [this message]
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=1949963.tdWV9SEqCh@7940hx \
--to=menglong.dong@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=leon.hwang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=menglong8.dong@gmail.com \
--cc=olsajiri@gmail.com \
--cc=sdf@fomichev.me \
--cc=shuah@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