From: Jiri Olsa <olsajiri@gmail.com>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: Jiri Olsa <olsajiri@gmail.com>,
andrii@kernel.org, daniel@iogearbox.net, ast@kernel.org,
quentin@isovalent.com, alan.maguire@oracle.com,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 1/2] bpf: Have bpf_rdonly_cast() take a const pointer
Date: Tue, 6 Feb 2024 17:03:10 +0100 [thread overview]
Message-ID: <ZcJYPhiVoK-WIV6z@krava> (raw)
In-Reply-To: <cn7sqqtplcle3udyxsbywfxs25wqnwxoutdf7w7cbbucmxkfsm@x67uxj6ubmzk>
On Tue, Feb 06, 2024 at 08:44:18AM -0700, Daniel Xu wrote:
> Hi Jiri,
>
> On Tue, Feb 06, 2024 at 02:42:22PM +0100, Jiri Olsa wrote:
> > On Sun, Feb 04, 2024 at 02:06:34PM -0700, Daniel Xu wrote:
> > > Since 20d59ee55172 ("libbpf: add bpf_core_cast() macro"), libbpf is now
> > > exporting a const arg version of bpf_rdonly_cast(). This causes the
> > > following conflicting type error when generating kfunc prototypes from
> > > BTF:
> > >
> > > In file included from skeleton/pid_iter.bpf.c:5:
> > > /home/dxu/dev/linux/tools/bpf/bpftool/bootstrap/libbpf/include/bpf/bpf_core_read.h:297:14: error: conflicting types for 'bpf_rdonly_cast'
> > > extern void *bpf_rdonly_cast(const void *obj__ign, __u32 btf_id__k) __ksym __weak;
> > > ^
> > > ./vmlinux.h:135625:14: note: previous declaration is here
> > > extern void *bpf_rdonly_cast(void *obj__ign, u32 btf_id__k) __weak __ksym;
> >
> > hi,
> > I'm hiting more of these when compiling bpf selftests (attached),
> > it looks like some kfuncs declarations in bpf_kfuncs.h might be in conflict
>
> Yep, I was actually going to put that as an office hours topic on how we
> want to handle that for selftests. Marking kfuncs in bpf_kfuncs.h and
> bpf_experimental.h as __weak is an option. ifdef is another option.
> Final option I can think of is bumping required pahole version up and
> simply deleting all the kfunc definitions.
>
> But given that pahole changes come with the feature flag, I don't see
> this as a pressing issue. So I was planning on getting to that after
> current outstanding patchsets (just so there's less stuff for me to
> juggle).
ok, I guess if the fix goes in together with the scripts/Makefile.btf
change then we're fine
jirka
next prev parent reply other threads:[~2024-02-06 16:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 21:06 [PATCH bpf-next v2 0/2] bpf, bpftool: Support dumping kfunc prototypes from BTF Daniel Xu
2024-02-04 21:06 ` [PATCH bpf-next v2 1/2] bpf: Have bpf_rdonly_cast() take a const pointer Daniel Xu
2024-02-05 0:32 ` Yonghong Song
2024-02-06 13:42 ` Jiri Olsa
2024-02-06 15:44 ` Daniel Xu
2024-02-06 16:03 ` Jiri Olsa [this message]
2024-02-06 17:32 ` Andrii Nakryiko
2024-02-04 21:06 ` [PATCH bpf-next v2 2/2] bpftool: Support dumping kfunc prototypes from BTF Daniel Xu
2024-02-08 0:50 ` Andrii Nakryiko
2024-03-18 18:37 ` Daniel Xu
2024-02-13 19:09 ` [PATCH bpf-next v2 0/2] bpf, " Andrii Nakryiko
2024-02-13 21:08 ` 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=ZcJYPhiVoK-WIV6z@krava \
--to=olsajiri@gmail.com \
--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=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=quentin@isovalent.com \
--cc=sdf@google.com \
--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