[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADxym3bLP1kSzXgCakRMtGGp_jk1DR-nZA=jafZdemzLe3omtA@mail.gmail.com>
Date: Thu, 8 Jun 2023 12:39:13 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: davem@...emloft.net, dsahern@...nel.org, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, martin.lau@...ux.dev,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...gle.com, x86@...nel.org,
imagedong@...cent.com, benbjiang@...cent.com,
netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 3/3] selftests/bpf: add testcase for
FENTRY/FEXIT with 6+ arguments
On Thu, Jun 8, 2023 at 4:10 AM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Wed, Jun 07, 2023 at 08:59:11PM +0800, menglong8.dong@...il.com wrote:
> > From: Menglong Dong <imagedong@...cent.com>
> >
> > Add test9/test10 in fexit_test.c and fentry_test.c to test the fentry
> > and fexit whose target function have 7/12 arguments.
> >
> > Correspondingly, add bpf_testmod_fentry_test7() and
> > bpf_testmod_fentry_test12() to bpf_testmod.c
> >
> > And the testcases passed:
> >
> > ./test_progs -t fexit
> > Summary: 5/12 PASSED, 0 SKIPPED, 0 FAILED
> >
> > ./test_progs -t fentry
> > Summary: 3/0 PASSED, 0 SKIPPED, 0 FAILED
> >
> > Reviewed-by: Jiang Biao <benbjiang@...cent.com>
> > Signed-off-by: Menglong Dong <imagedong@...cent.com>
> > ---
> > v3:
> > - move bpf_fentry_test{7,12} to bpf_testmod.c and rename them to
> > bpf_testmod_fentry_test{7,12} meanwhile
> > - get return value by bpf_get_func_ret() in
> > "fexit/bpf_testmod_fentry_test12", as we don't change ___bpf_ctx_cast()
> > in this version
> > ---
> > .../selftests/bpf/bpf_testmod/bpf_testmod.c | 19 ++++++++++-
> > .../selftests/bpf/prog_tests/fentry_fexit.c | 4 ++-
> > .../selftests/bpf/prog_tests/fentry_test.c | 2 ++
> > .../selftests/bpf/prog_tests/fexit_test.c | 2 ++
> > .../testing/selftests/bpf/progs/fentry_test.c | 21 ++++++++++++
> > .../testing/selftests/bpf/progs/fexit_test.c | 33 +++++++++++++++++++
> > 6 files changed, 79 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
> > index cf216041876c..66615fdbe3df 100644
> > --- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
> > +++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
> > @@ -191,6 +191,19 @@ noinline int bpf_testmod_fentry_test3(char a, int b, u64 c)
> > return a + b + c;
> > }
> >
> > +noinline int bpf_testmod_fentry_test7(u64 a, void *b, short c, int d,
> > + void *e, u64 f, u64 g)
> > +{
> > + return a + (long)b + c + d + (long)e + f + g;
> > +}
> > +
> > +noinline int bpf_testmod_fentry_test12(u64 a, void *b, short c, int d,
> > + void *e, u64 f, u64 g, u64 h,
> > + u64 i, u64 j, u64 k, u64 l)
>
> Please switch args to a combination of u8,u16,u32,u64.
> u64 only args might hide bugs.
Okay, that makes sense.
Powered by blists - more mailing lists