On 2026/3/24 10:53 Leon Hwang <[email protected]> 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 <[email protected]>
> > Reviewed-by: Emil Tsalapatis <[email protected]>
> 
> Acked-by: Leon Hwang <[email protected]>
> 
> 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;
> >  }
> >  
> 
> 
> 





Reply via email to