Bug 2019616 - request for samples/bpf directory packaging
Summary: request for samples/bpf directory packaging
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-tools
Version: 35
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-02 23:50 UTC by Jesse Brandeburg
Modified: 2022-12-13 15:45 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-12-13 15:45:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jesse Brandeburg 2021-11-02 23:50:31 UTC
Description of problem:
Please package up the utilities in the linux/samples/bpf directory so that users don't have to try to build them, themselves in order to run simple xdp tests.

the RPM .spec file would be very similar to the kernel-tools.spec, and I heard from inside sources that there may already be something available.

The reason for doing this is that these tools can be very difficult to build for an end user, yet allow teams like mine to perform basic validation and functional tests on a driver / kernel combo.

Version-Release number of selected component (if applicable):
in-kernel

Additional info:
see this thread for a related discussion:
https://lore.kernel.org/xdp-newbies/875ca290-95ad-c5ed-bc4d-550a35f9bd12@intel.com/

Comment 1 Toke Høiland-Jørgensen 2021-11-03 10:13:24 UTC
We already have the option to build this in the kernel .spec:

https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel.spec#_1046

But it's turned off for Fedora. So enabling it would (I think) just be a matter of setting this flag for Fedora builds, and maybe renaming the package if it's to be included in the repositories...

Comment 2 Justin M. Forbes 2021-11-04 12:12:08 UTC
(In reply to Toke Høiland-Jørgensen from comment #1)
> We already have the option to build this in the kernel .spec:
> 
> https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel.spec#_1046
> 
> But it's turned off for Fedora. So enabling it would (I think) just be a
> matter of setting this flag for Fedora builds, and maybe renaming the
> package if it's to be included in the repositories...

Not exactly, Fedora doesn't build bpf or any of the kernel-tools as a part of the kernel.spec, it is a different package/dist-git called kernel-tools. Though I can enable them there.

Comment 3 Jiri Benc 2021-11-04 13:15:39 UTC
(In reply to Justin M. Forbes from comment #2)
> Not exactly, Fedora doesn't build bpf or any of the kernel-tools as a part
> of the kernel.spec, it is a different package/dist-git called kernel-tools.
> Though I can enable them there.

Note that the build of bpf selftests requires access to some files from the kernel build. If you build selftests standalone, you'll have to make sure the necessary files are packaged in kernel-devel or in other package and call the selftests makefile with appropriate paths.

I'm aware of vmlinux.h and bpftool but there may be more. The bpf selftests build is not well separated from the kernel build.

Comment 4 Jesse Brandeburg 2021-12-21 16:45:42 UTC
I everyone, thanks for the comments, I still think this is a valuable thing to do, is there way to push further on this? Especially for fedora and developers, this would be a useful extension. In particular I think this is a perfect opportunity for Fedora to excel here, as the integration of the libbpf, the kernel, the toolchain (gcc/clang) and the samples code is what makes this so hard to do as an end user.

In particular I'm asking for the XDP samples which can validate that a user's drivers and hardware work correctly before going down the rathole of developing a BPF/XDP program just to test basic functionality.  I don't believe that these XDP samples fit nicely in either kernel-tools (with cpupower) OR with selftests. Can we create a new RPM spec for kernel-xdp-samples ?

@thoiland or @jbrouer do you have any comments or further suggestions here?

Comment 5 Jesper Brouer 2022-01-03 11:30:06 UTC
I agree, that it would bring great value to package up the utilities in Kernel's
samples/bpf directory, as it is indeed very difficult to build for end-users.
This build work/"pain" could be taken over by a distro package maintainer.

The question is do we have someone that can take on this build work?

With the current bit-rotting state of samples/bpf/ it will require a lot of work
initially, and on-going work is also required, as I've seem repeated cases of
kernel patches getting applied that break the samples/bpf build, and BPF
maintainer don't prioritize fixing samples build issues. If build issue is
related to newer LLVM features, then the build issues isn't fixed, as BPF
maintainers want people to use latest devel LLVM version.

Sure, it would be great if Fedora does this, as we would catch build issues
earlier, stabilize samples/bpf/ and generally make Fedora more BPF "ready". I
doubt we can find the person resources to take on this task, as it is a
constantly moving target of dependencies (especially on versions of LLVM).


You primarily want XDP samples (which makes a lot of sense, given this cannot be
covered by BPF selftests, as it need to be tested on actual NIC drivers).

I propose an alternative:
 * Move the Kernel's XDP related samples into XDP-tools (which is already
   packaged).  Or into another kernel dir under tools.

This would requires some devel work, but would be much easier to maintain.

Toke and I have already discussed something along these lines upstream, and BPF
maintainers seems eager to remove things from samples/bpf as it bit-rots.
Toke's XDP redirect packet generator sample would be a useful tool in itself.

Comment 6 Toke Høiland-Jørgensen 2022-01-03 12:47:40 UTC
Yup, I agree, moving the samples to xdp-tools is the right thing to do. Alexei already agreed upstream: https://lore.kernel.org/r/CAADnVQKM81Jf0b-m=VeuVES7K11uksVrzQtCksoyCq3mZ-=L5w@mail.gmail.com and Kartikeya has volunteered to work on it :)

Comment 7 Ben Cotton 2022-11-29 17:13:18 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Ben Cotton 2022-12-13 15:45:17 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.