Re: [PATCH bpf-next] selftests/bpf: test access to ringbuf position with map pointer
From: Menglong Dong
Date: Sun Mar 22 2026 - 22:06:41 EST
On 2026/3/22 09:51 Emil Tsalapatis <emil@xxxxxxxxxxxxxxx> write:
> On Fri Mar 20, 2026 at 4:41 AM EDT, 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.
> >
> > Signed-off-by: Menglong Dong <dongml2@xxxxxxxxxxxxxxx>
>
> Once Jiri's feedback is addressed feel free to add:
>
> Reviewed-by: Emil Tsalapatis <emil@xxxxxxxxxxxxxxx>
>
> One nit below.
[...]
> > + VERIFY(rb->consumer_pos == 0);
>
> Nit: Can you repeat here the explanation from the cover letter
> as to why this is 128 + 8?
OK, I'll add a comment here.
Thanks!
Menglong Dong
>
> > + VERIFY(rb->producer_pos == 128 + 8);
> > +
> > return 1;
> > }
>
> >
>