From: Jiri Olsa <olsajiri@gmail.com>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: Jiri Olsa <olsajiri@gmail.com>,
shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, ast@kernel.org, quentin@isovalent.com,
alan.maguire@oracle.com, acme@kernel.org, martin.lau@linux.dev,
song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
haoluo@google.com, mykolal@fb.com, bpf@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH bpf-next v4 03/12] bpf: selftests: Fix fentry test kfunc prototypes
Date: Wed, 12 Jun 2024 14:41:59 +0200 [thread overview]
Message-ID: <ZmmXl1NHgwOEXy4F@krava> (raw)
In-Reply-To: <gwrlw7wtc72vz3ky2pltvpoadtjlezv6kdrs6wf3ptsecyu2sh@aexbk4rotm3x>
On Tue, Jun 11, 2024 at 10:58:26AM -0600, Daniel Xu wrote:
> On Mon, Jun 10, 2024 at 03:28:36PM GMT, Jiri Olsa wrote:
> > On Sat, Jun 08, 2024 at 03:15:59PM -0600, Daniel Xu wrote:
> > > The prototypes in progs/get_func_ip_test.c were not in line with how the
> > > actual kfuncs are defined in net/bpf/test_run.c. This causes compilation
> > > errors when kfunc prototypes are generated from BTF.
> > >
> > > Fix by aligning with actual kfunc definitions.
> > >
> > > Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> > > ---
> > > .../testing/selftests/bpf/progs/get_func_ip_test.c | 14 +++++++-------
> > > 1 file changed, 7 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> > > index 8956eb78a226..a89596f7585d 100644
> > > --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> > > +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> > > @@ -5,13 +5,13 @@
> > >
> > > char _license[] SEC("license") = "GPL";
> > >
> > > -extern const void bpf_fentry_test1 __ksym;
> > > -extern const void bpf_fentry_test2 __ksym;
> > > -extern const void bpf_fentry_test3 __ksym;
> > > -extern const void bpf_fentry_test4 __ksym;
> > > -extern const void bpf_modify_return_test __ksym;
> > > -extern const void bpf_fentry_test6 __ksym;
> > > -extern const void bpf_fentry_test7 __ksym;
> > > +extern int bpf_fentry_test1(int a) __ksym;
> >
> > hum, the only registered one as kfunc is bpf_fentry_test1, to allow fmodret
> > also there's bpf_fentry_test9 as kfunc, which AFAICS is not really needed
>
> I think bpf_modify_return_test() is also registered. But otherwise yeah,
> I think I was overaggressive here. Are you thinking something like this?
yes, looks good
>
>
> diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> index a89596f7585d..2011cacdeb18 100644
> --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c
> @@ -6,12 +6,11 @@
> char _license[] SEC("license") = "GPL";
>
> extern int bpf_fentry_test1(int a) __ksym;
> -extern int bpf_fentry_test2(int a, __u64 b) __ksym;
> -extern int bpf_fentry_test3(char a, int b, __u64 c) __ksym;
> -extern int bpf_fentry_test4(void *a, char b, int c, __u64 d) __ksym;
> extern int bpf_modify_return_test(int a, int *b) __ksym;
> -extern int bpf_fentry_test6(__u64 a, void *b, short c, int d, void *e, __u64 f) __ksym;
> -extern int bpf_fentry_test7(struct bpf_fentry_test_t *arg) __ksym;
I did not realize bpf_fentry_test6/7 are not used.. ok
thanks,
jirka
> +
> +extern const void bpf_fentry_test2 __ksym;
> +extern const void bpf_fentry_test3 __ksym;
> +extern const void bpf_fentry_test4 __ksym;
>
> extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
next prev parent reply other threads:[~2024-06-12 12:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-08 21:15 [PATCH bpf-next v4 00/12] bpf: Support dumping kfunc prototypes from BTF Daniel Xu
2024-06-08 21:15 ` [PATCH bpf-next v4 01/12] kbuild: bpf: Tell pahole to DECL_TAG kfuncs Daniel Xu
2024-06-08 21:15 ` [PATCH bpf-next v4 02/12] bpf: selftests: Fix bpf_iter_task_vma_new() prototype Daniel Xu
2024-06-08 21:15 ` [PATCH bpf-next v4 03/12] bpf: selftests: Fix fentry test kfunc prototypes Daniel Xu
2024-06-10 13:28 ` Jiri Olsa
2024-06-11 16:58 ` Daniel Xu
2024-06-12 12:41 ` Jiri Olsa [this message]
2024-06-08 21:16 ` [PATCH bpf-next v4 04/12] bpf: selftests: Fix bpf_cpumask_first_zero() kfunc prototype Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 05/12] bpf: selftests: Fix bpf_map_sum_elem_count() " Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 06/12] bpf: selftests: Fix bpf_session_cookie() " Daniel Xu
2024-06-10 13:04 ` Jiri Olsa
2024-06-11 15:54 ` Daniel Xu
2024-06-11 16:03 ` Alexei Starovoitov
2024-06-17 22:25 ` Andrii Nakryiko
2024-06-18 12:43 ` Jiri Olsa
2024-06-18 16:58 ` Andrii Nakryiko
2024-06-18 19:07 ` Jiri Olsa
2024-06-18 20:29 ` Andrii Nakryiko
2024-06-08 21:16 ` [PATCH bpf-next v4 07/12] bpf: selftests: Namespace struct_opt callbacks in bpf_dctcp Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 08/12] bpf: verifier: Relax caller requirements for kfunc projection type args Daniel Xu
2024-06-10 18:30 ` Alexei Starovoitov
2024-06-11 18:01 ` Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 09/12] bpf: treewide: Align kfunc signatures to prog point-of-view Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 10/12] bpf: selftests: nf: Opt out of using generated kfunc prototypes Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 11/12] bpf: selftests: xfrm: " Daniel Xu
2024-06-08 21:16 ` [PATCH bpf-next v4 12/12] bpftool: Support dumping kfunc prototypes from BTF Daniel Xu
2024-06-08 21:23 ` [PATCH bpf-next v4 00/12] bpf: " Daniel Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZmmXl1NHgwOEXy4F@krava \
--to=olsajiri@gmail.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dxu@dxuuu.xyz \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=quentin@isovalent.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox