bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin@isovalent.com>
To: Dave Thaler <dthaler@microsoft.com>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>, Andrii Nakryiko <andrii@kernel.org>
Subject: Re: Bpftool mirror now available
Date: Mon, 24 Jan 2022 12:13:19 +0000	[thread overview]
Message-ID: <127cb5f6-a969-82df-3dff-a5ac288d7043@isovalent.com> (raw)
In-Reply-To: <CH2PR21MB14640448106792E7197A042CA35A9@CH2PR21MB1464.namprd21.prod.outlook.com>

2022-01-20 14:19 UTC+0000 ~ Dave Thaler <dthaler@microsoft.com>
> Quentin Monnet <quentin@isovalent.com> wrote:
>> Hi, I have the pleasure to announce the availability of a mirror for bpftool on GitHub, at the following URL:
>> [...]
>> 3. Another objective was to help other projects build on top of the existing sources for bpftool. I'm thinking in
>> particular of eBPF-for-Windows, which has been working on a proof-of-concept port of the tool for Windows [1]. 
>> Bpftool's mirror keeps the minimal amount of necessary headers, and stripped most of them from the definitions
>> that are not required in our context, which should make it easier to uncouple bpftool from Linux.
>> [...]
>> Just to make it clear, bpftool's mirror does not change the fact that all bpftool development happens on the
>> kernel mailing-lists (in particular, the BPF mailing-list), and that the sources hosted in the kernel repository
>> remain the reference for the tool. At this time the GitHub repository is just a mirror, and will not accept pull
>> requests on bpftool's sources.
> 
> Thanks Quentin, this is a great first step!   I can update the ebpf-for-windows project to use this as a submodule.
> 
> Longer term, is the goal to make the mirror be the authoritative reference, or to make the Linux kernel repository
> not be Linux-only but accept non-Linux patches to bpftool?

Hi Dave, longer term goals have not been established yet, and the
discussion about what happens to bpftool next still needs to happen. I
understand that you have been working on making bpftool cross-OS, and
that this raises the question of how to contribute Windows-related
patches upstream.

Moving bpftool out of the kernel and into its own tree (whether on
GitHub or on kernel.org) would make sense to me, although it comes with
a number of things to sort out. First, bpftool is now being used
directly by a number of components in the kernel, for loading programs
or for its ability to generate BPF skeletons for programs. As far as I
can tell, this concerns the following items:

- The kernel itself, when configured with CONFIG_BPF_PRELOAD, requires
bpftool to build, because BPF pre-loaded iterators rely on BPF skeletons
(see kernel/bpf/preload/iterators/Makefile).

- BPF samples and selftests (samples/bpf/Makefile,
tools/bpf/runqslower/Makefile) use BPF for a number of use cases.

- Other tools hosted in the kernel repository, in particular runqslower
(tools/bpf/runqslower/Makefile) and perf (tools/perf/Makefile.perf), use
bpftool to produce BPF skeletons as well.

As far as I can tell, the above do not rely on cutting-edge bpftool
features, and they could maybe be adjusted to consider bpftool as an
external dependency for BPF, somewhat like pahole or clang/LLVM have
been so far.

Another thing to consider is that keeping bpftool next to the kernel
sources has been useful to help keeping the tool in sync, for example
for adding new type names to bpftool's lists when the kernel get new
program/map types. We have recently introduced some CI checks that could
be adjusted to work with an external repo and mitigate this issue, but
still, it is harder to tell people to submit changes to a second
repository when what they want is just to update the kernel. I fear this
would result in a bit more maintenance on bpftool's side (but then
bpftool's requirements in terms of maintenance are not that big when
compared to bigger tools, and maybe some of it could be automated).

Then the other solution, as you mentioned, would be to take
Windows-related patches for bpftool in the Linux repo. For what it's
worth, I don't have any personal objection to it, but it raises the
problems of testing and ownership (who fixes bugs) for these patches.
I'm also unsure what it would mean in terms of development workflow:
would Windows-related contributions be reviewed and tested beforehand,
and treated somewhat like vendor code, or would all the discussions
(Windows-related bug reports, contributions to Windows support but
external to Microsoft, etc.) happen on the BPF mailing list?

If we want bpftool to become fully cross-OS, my feeling is that it would
be maybe more work, but more sensible to move it outside of the kernel
tree (although this does not have to be immediate, obviously - let's see
how the Windows port is doing first). However, this decision is not mine
alone to take, and the maintainers will surely have their say in it
(this could also be a topic for you to raise at the next BSC meeting, I
guess). I hope the considerations above can help for this discussion.

Best regards,
Quentin

  reply	other threads:[~2022-01-24 12:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 14:47 Bpftool mirror now available Quentin Monnet
2022-01-20  6:25 ` Andrii Nakryiko
2022-01-20 12:35   ` Quentin Monnet
2022-01-20 19:07     ` Andrii Nakryiko
2022-01-24 10:37       ` Quentin Monnet
2022-01-20 14:19 ` Dave Thaler
2022-01-24 12:13   ` Quentin Monnet [this message]
2022-01-25  3:39     ` Dave Thaler
2022-01-25 21:42       ` Daniel Borkmann

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=127cb5f6-a969-82df-3dff-a5ac288d7043@isovalent.com \
    --to=quentin@isovalent.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dthaler@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).