lkml.org 
[lkml]   [2022]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next v10 01/23] selftests/bpf: regroup and declare similar kfuncs selftests in an array
On Tue, 6 Sept 2022 at 05:25, Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote:
>
> On Fri, 2 Sept 2022 at 15:29, Benjamin Tissoires
> <benjamin.tissoires@redhat.com> wrote:
> >
> > Similar to tools/testing/selftests/bpf/prog_tests/dynptr.c:
> > we declare an array of tests that we run one by one in a for loop.
> >
> > Followup patches will add more similar-ish tests, so avoid a lot of copy
> > paste by grouping the declaration in an array.
> >
> > To be able to call bpf_object__find_program_by_name(), we need to use
> > plain libbpf calls, and not light skeletons. So also change the Makefile
> > to not generate light skeletons.
> >
> > Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> >
> > ---
>
> I see your point, but this is also a test so that we keep verifying
> kfunc call in light skeleton.
> Code for relocating both is different in libbpf (we generate BPF ASM
> for light skeleton so it is done inside a loader BPF program instead
> of userspace).

Err, hit send too early.
We can probably use a macro to hide how program is called, then do
X(prog1)
X(prog2)
in a series, won't look too bad and avoids duplication at the same time.

> You might then be able to make it work for both light and normal skeleton.
>
WDYT?

\
 
 \ /
  Last update: 2022-09-06 05:29    [W:0.055 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site