Re: [PATCH v2 0/4] bpf/selftests: page size fixes

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

 



On Sun, Mar 28, 2021 at 10:06 AM Yauheni Kaliuta
<yauheni.kaliuta@xxxxxxxxxx> wrote:
>
> Hi, Andrii,
>
> On Sun, Mar 28, 2021 at 8:05 AM Andrii Nakryiko
> <andrii.nakryiko@xxxxxxxxx> wrote:
> >
> > On Fri, Mar 26, 2021 at 5:24 AM Yauheni Kaliuta
> > <yauheni.kaliuta@xxxxxxxxxx> wrote:
> > >
> > > A set of fixes for selftests to make them working on systems with PAGE_SIZE > 4K
> > >
> > > 2 questions left:
> > >
> > > - about `nit: if (!ASSERT_OK(err, "setsockopt_attach"))`. I left
> > >   CHECK() for now since otherwise it has too many negations. But
> > >   should I anyway use ASSERT?
> >
> > CHECK itself is a negation as much more confusing, IMO. if
> > (!ASSERT_OK(err)) is pretty clear, as for me.
> >
> > >
> > > - https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/mmap.c#L41
> > >   and below -- it works now as is, but should be switched also to page_size?
> >
> > replied on another patch, it is possible to set all that at runtime
> > with bpf_map__set_max_entries().
>
> For both mmap and ringbuf or only for mmap?
>
> But the question is about the mmap userspace part. In the test for
> some reason both hardcoded 4096 and runtime page_size are used. I'm a
> bit confused, should I replace that 4096 with page size.

everywhere where 4096 is hard-coded, it was supposed to match page
size, so switching to page size would be best. for test_mmap, in
particular, I was trying to validate mmap refcounting, so each
separate 4096 bytes page was supposed to trigger as separate mmap
operation (with corresponding refcnt bump).


>
> >
> >
> > Overall, please specify the [PATCH bpf-next] prefix to denote that it
> > targets bpf-next.
>
> thanks for the review, I'll prepare v3 then.
>
> >
> >
> > >
> > > --
> > > v1->v2:
> > >
> > > - add missed 'selftests/bpf: test_progs/sockopt_sk: Convert to use BPF skeleton'
> > >
> > > Yauheni Kaliuta (4):
> > >
> > >   selftests/bpf: test_progs/sockopt_sk: pass page size from userspace
> > >   bpf: selftests: test_progs/sockopt_sk: remove version
> > >   selftests/bpf: ringbuf, mmap: bump up page size to 64K
> > >
> > >  .../selftests/bpf/prog_tests/ringbuf.c        |  9 ++-
> > >  .../selftests/bpf/prog_tests/sockopt_sk.c     | 68 ++++++-------------
> > >  .../selftests/bpf/progs/map_ptr_kern.c        |  9 ++-
> > >  .../testing/selftests/bpf/progs/sockopt_sk.c  | 11 ++-
> > >  tools/testing/selftests/bpf/progs/test_mmap.c | 10 ++-
> > >  .../selftests/bpf/progs/test_ringbuf.c        |  8 ++-
> > >  .../selftests/bpf/progs/test_ringbuf_multi.c  |  7 +-
> > >  7 files changed, 61 insertions(+), 61 deletions(-)
> > >
> > > --
> > > 2.29.2
> > >
> >
>
>
> --
> WBR, Yauheni
>



[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