From: John Fastabend <john.fastabend@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>,
"Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
"Jiri Olsa" <jolsa@redhat.com>
Cc: "Björn Töpel" <bjorn.topel@gmail.com>,
"Magnus Karlsson" <magnus.karlsson@gmail.com>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Network Development" <netdev@vger.kernel.org>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
bpf <bpf@vger.kernel.org>,
degeneloy@gmail.com, "John Fastabend" <john.fastabend@gmail.com>
Subject: Re: [PATCH bpf-next v3] libbpf: fix compatibility for kernels without need_wakeup
Date: Fri, 01 Nov 2019 07:51:54 -0700 [thread overview]
Message-ID: <5dbc468adbc4c_e4e2b12b10265b88@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <87tv7olzwd.fsf@toke.dk>
Toke Høiland-Jørgensen wrote:
> Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:
>
> > On Thu, Oct 31, 2019 at 12:18 PM Jiri Olsa <jolsa@redhat.com> wrote:
> >> >
> >> > yes. older vmlinux and newer installed libbpf.so
> >> > or any version of libbpf.a that is statically linked into apps
> >> > is something that libbpf code has to support.
> >> > The server can be rebooted into older than libbpf kernel and
> >> > into newer than libbpf kernel. libbpf has to recognize all these
> >> > combinations and work appropriately.
> >> > That's what backward and forward compatibility is.
> >> > That's what makes libbpf so difficult to test, develop and code review.
> >> > What that particular server has in /usr/include is irrelevant.
> >>
> >> sure, anyway we can't compile following:
> >>
> >> tredaell@aldebaran ~ $ echo "#include <bpf/xsk.h>" | gcc -x c -
> >> In file included from <stdin>:1:
> >> /usr/include/bpf/xsk.h: In function ‘xsk_ring_prod__needs_wakeup’:
> >> /usr/include/bpf/xsk.h:82:21: error: ‘XDP_RING_NEED_WAKEUP’ undeclared (first use in this function)
> >> 82 | return *r->flags & XDP_RING_NEED_WAKEUP;
> >> ...
> >>
> >> XDP_RING_NEED_WAKEUP is defined in kernel v5.4-rc1 (77cd0d7b3f257fd0e3096b4fdcff1a7d38e99e10).
> >> XSK_UNALIGNED_BUF_ADDR_MASK and XSK_UNALIGNED_BUF_OFFSET_SHIFT are defined in kernel v5.4-rc1 (c05cd3645814724bdeb32a2b4d953b12bdea5f8c).
> >>
> >> with:
> >> kernel-headers-5.3.6-300.fc31.x86_64
> >> libbpf-0.0.5-1.fc31.x86_64
> >>
> >> if you're saying this is not supported, I guess we could be postponing
> >> libbpf rpm releases until we have the related fedora kernel released
> >
> > why? github/libbpf is the source of truth for building packages
> > and afaik it builds fine.
> >
> >> or how about inluding uapi headers in libbpf-devel.. but that might
> >> actualy cause more confusion
> >
> > Libraries (libbpf or any other) should not install headers that
> > typically go into /usr/include/
> > if_xdp.h case is not unique.
> > We'll surely add another #define, enum, etc to uapi/linux/bpf.h tomorrow.
> > And we will not copy paste these constants and types into tools/lib/bpf/.
> > In kernel tree libbpf development is using kernel tree headers.
> > No problem there for libbpf developers.
> > Packages are built out of github/libbpf that has a copy of uapi headers
> > necessary to create packages.
> > No problem there for package builders either.
> > But libbpf package is not going to install those uapi headers.
> > libbpf package installs only libbpf own headers (like libbpf.h)
> > The users that want to build against the latest libbpf package need
> > to install corresponding uapi headers package.
> > I don't think such dependency is specified in rpm scripts.
> > May be it is something to fix? Or may be not.
> > Some folks might not want to update all of /usr/include to bring libbpf-devel.
> > Then it would be their responsibility to get fresh /usr/include headers.
>
> We can certainly tie libbpf to the kernel version. The obvious way to do
> that is to just ship the version of libbpf that's in the kernel tree of
> whatever kernel version the distro ships. But how will we handle
> bugfixes, then? You've explicitly stated that libbpf gets no bugfixes
> outside of bpf-next...
>
> -Toke
We use libbpf and build for a wide variety of kernels so I don't think we
want to make libbpf kernel version specific. I always want the latest libbpf
features even when building on older kernels. I generally use the bpf-next
version though so maybe I'm not the target user.
.John
next prev parent reply other threads:[~2019-11-01 14:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 9:17 [PATCH bpf-next v3] libbpf: fix compatibility for kernels without need_wakeup Magnus Karlsson
2019-10-25 19:30 ` Jonathan Lemon
2019-10-29 3:27 ` Alexei Starovoitov
2019-10-30 13:33 ` Toke Høiland-Jørgensen
2019-10-31 7:17 ` Magnus Karlsson
2019-10-31 8:02 ` Björn Töpel
2019-10-31 8:17 ` Magnus Karlsson
2019-10-31 9:50 ` Toke Høiland-Jørgensen
2019-10-31 14:00 ` Alexei Starovoitov
2019-10-31 14:13 ` Toke Høiland-Jørgensen
2019-10-31 14:17 ` Alexei Starovoitov
2019-10-31 14:26 ` Toke Høiland-Jørgensen
2019-10-31 14:44 ` Alexei Starovoitov
2019-10-31 14:52 ` Toke Høiland-Jørgensen
2019-10-31 15:17 ` Alexei Starovoitov
2019-10-31 17:42 ` Jiri Olsa
2019-10-31 18:19 ` Alexei Starovoitov
2019-10-31 19:18 ` Jiri Olsa
2019-10-31 20:39 ` Alexei Starovoitov
2019-11-01 7:27 ` Jiri Olsa
2019-11-01 15:51 ` Alexei Starovoitov
2019-11-01 19:36 ` Toke Høiland-Jørgensen
2019-11-01 20:41 ` Alexei Starovoitov
2019-11-01 21:41 ` Toke Høiland-Jørgensen
2019-11-01 22:08 ` Alexei Starovoitov
2019-11-01 9:16 ` Toke Høiland-Jørgensen
2019-11-01 14:51 ` John Fastabend [this message]
2019-10-31 20:23 ` Andrii Nakryiko
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=5dbc468adbc4c_e4e2b12b10265b88@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=degeneloy@gmail.com \
--cc=jolsa@redhat.com \
--cc=jonathan.lemon@gmail.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).