Re: [PATCH bpf-next 3/3] selftests/bpf: add tests for bpf_dynptr_copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2025 at 4:08 AM Mykyta Yatsenko
<mykyta.yatsenko5@xxxxxxxxx> wrote:
>
> On 21/02/2025 00:52, Andrii Nakryiko wrote:
> > On Tue, Feb 18, 2025 at 11:01 AM Mykyta Yatsenko
> > <mykyta.yatsenko5@xxxxxxxxx> wrote:
> >> From: Mykyta Yatsenko <yatsenko@xxxxxxxx>
> >>
> >> Add XDP setup type for dynptr tests, enabling testing for
> >> non-contiguous buffer.
> >> Add 2 tests:
> >>   - test_dynptr_copy - verify correctness for the fast (contiguous
> >>   buffer) code path.
> >>   - test_dynptr_copy_xdp - verifies code paths that handle
> >>   non-contiguous buffer.
> >>
> >> Signed-off-by: Mykyta Yatsenko <yatsenko@xxxxxxxx>
> >> ---
> >>   tools/testing/selftests/bpf/bpf_kfuncs.h      |  8 ++
> >>   .../testing/selftests/bpf/prog_tests/dynptr.c | 25 ++++++
> >>   .../selftests/bpf/progs/dynptr_success.c      | 77 +++++++++++++++++++
> >>   3 files changed, 110 insertions(+)
> >>

[...]

> >
> > BTW, more questions to networking folks (maybe Martin knows). Is there
> > a way to setup SKB or XDP packet with a non-linear region for testing?
> The setup I made in dynptr.c for XDP makes non-linear region.
> It looks like maximum linear mem size is 4k, so when going above that,
> it creates multiple frags in xdp_buff:
>
> ```
>
> char data[5000];
> ...
> .data_in = &data,
>
> ```
>
> I verified that in this test xdp_buff is non-linear, and all non-fast
> code paths of
> the bpf_dynptr_copy are tested.

Ah, awesome, great job!

>
> >
> >> +
> >> +       return XDP_DROP;
> >> +}
> >> --
> >> 2.48.1
> >>
> Thanks for findings, fixing them in v2.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux