[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQJdt5K3o6SrnVzzBVf+5BmJ3Wo5TTLvULE7rKJPkKqmbQ@mail.gmail.com>
Date: Tue, 11 Jun 2024 09:03:56 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Daniel Xu <dxu@...uu.xyz>
Cc: Jiri Olsa <olsajiri@...il.com>, Shuah Khan <shuah@...nel.org>,
Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>, Eddy Z <eddyz87@...il.com>,
Daniel Borkmann <daniel@...earbox.net>, Quentin Monnet <quentin@...valent.com>,
Alan Maguire <alan.maguire@...cle.com>, Arnaldo Carvalho de Melo <acme@...nel.org>,
Mykola Lysenko <mykolal@...com>, Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
bpf <bpf@...r.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Kernel Team <kernel-team@...a.com>
Subject: Re: [PATCH bpf-next v4 06/12] bpf: selftests: Fix bpf_session_cookie()
kfunc prototype
On Tue, Jun 11, 2024 at 8:54 AM Daniel Xu <dxu@...uu.xyz> wrote:
>
> Hi Jiri,
>
> On Mon, Jun 10, 2024 at 03:04:25PM GMT, Jiri Olsa wrote:
> > On Sat, Jun 08, 2024 at 03:16:02PM -0600, Daniel Xu wrote:
> > > The prototype defined in bpf_kfuncs.h was not in line with how the
> > > actual kfunc was defined. This causes compilation errors when kfunc
> > > prototypes are generated from BTF.
> > >
> > > Fix by aligning with actual kfunc definition.
> > >
> > > Signed-off-by: Daniel Xu <dxu@...uu.xyz>
> > > ---
> > > tools/testing/selftests/bpf/bpf_kfuncs.h | 2 +-
> > > tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c | 2 +-
> > > 2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/bpf_kfuncs.h b/tools/testing/selftests/bpf/bpf_kfuncs.h
> > > index be91a6919315..3b6675ab4086 100644
> > > --- a/tools/testing/selftests/bpf/bpf_kfuncs.h
> > > +++ b/tools/testing/selftests/bpf/bpf_kfuncs.h
> > > @@ -77,5 +77,5 @@ extern int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_ptr,
> > > struct bpf_key *trusted_keyring) __ksym;
> > >
> > > extern bool bpf_session_is_return(void) __ksym __weak;
> > > -extern long *bpf_session_cookie(void) __ksym __weak;
> > > +extern __u64 *bpf_session_cookie(void) __ksym __weak;
> >
> > the original intent was to expose long instead of __u64 :-\
> >
> > could we rather change the bpf_session_cookie function to return long?
> > should be just return value type change
>
> Sounds reasonable to me. I don't think the kfunc has made it to a
> release yet, so perhaps if we extract this commit out as a fix to bpf
> tree it can still make it into 6.10. That way we won't have to worry
> about any ABI changes.
kfunc-s can be changed at any time. Keep targeting bpf-next for everything.
Powered by blists - more mailing lists