On Thu, 4 Apr 2024 at 16:51, Stephen Hemminger <step...@networkplumber.org> wrote: > > On Thu, 4 Apr 2024 01:49:56 +0100 > Luca Boccassi <bl...@debian.org> wrote: > > > On Thu, 4 Apr 2024 at 00:41, Stephen Hemminger > > <step...@networkplumber.org> wrote: > > > > > > On Wed, 3 Apr 2024 22:19:20 +0100 > > > Luca Boccassi <bl...@debian.org> wrote: > > > > > > > On Wed, 3 Apr 2024 at 16:55, Stephen Hemminger > > > > <step...@networkplumber.org> wrote: > > > > > > > > > > On Wed, 03 Apr 2024 12:50:35 +0100 > > > > > Luca Boccassi <bl...@debian.org> wrote: > > > > > > > > > > > Using bpftool to generate the header at build time is a bit icky, > > > > > > because it will look at sysfs on the build system, which is from the > > > > > > running kernel. But a build system's kernel might be some ancient > > > > > > LTS, > > > > > > and even be a completely different kconfig/build/distro from the > > > > > > actual > > > > > > runtime one. > > > > > > > > > > One other option would be to ship a pre-built skeleton file. > > > > > Which is what the method the old code did. > > > > > But that creates an implied dependency on the developers machine > > > > > build environment. > > > > > > > > That's what the distro-provided vmlinux.h should help with - by > > > > #include'ing that, it should be possible to build a co-re bpf program, > > > > no other artifacts needed. You can try it out locally by generating it > > > > from the local running kernel on your dev machine: > > > > > > > > bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h > > > > > > Not all distros are providing vmlinux.h. > > > And some like Ubuntu haven't figured out how to package bpftool and > > > libbpf correctly. > > > > Yes and for those the usual pattern is a fallback to generate at build > > time, if no pre-prepared vmlinux.h is configured > > Looks like vmlinux.h is not setup to handle tc programs. > > If vmlinux.h is included, it supersedes other kernel headers (ok). > But is missing some other things like IPv6 options, ether types, and > TC actions. To use it requires copy pasting from other headers > to fill in the missing pieces. Thats a mess. > > This little program only refers to skb and the fields that are problematic > are protocol, mark, and queue_mapping.
That's not good, could you please report that to the BPF folks? Pretty sure it should get fixed in bpftool?