xdp-tutorial icon indicating copy to clipboard operation
xdp-tutorial copied to clipboard

Tutorial: advanced BTF example

Open netoptimizer opened this issue 6 years ago • 7 comments

It didn't merge this branch with BTF examples as it failed...

It believe it now actually works, as it was a issue in libbpf that caused the BTF code to get rejected on load.

netoptimizer avatar Jun 05 '19 13:06 netoptimizer

Jesper Dangaard Brouer [email protected] writes:

It didn't merge this branch with BTF examples as it failed...

It believe it now actually works, as it was a issue in libbpf that caused the BTF code to get rejected on load. You can view, comment on, or merge this pull request online at:

So no issue on the kernel side? We are currently recommending people to use 4.20 or higher when running the tutorial...

tohojo avatar Jun 06 '19 09:06 tohojo

BTF in the kernel tree have moved away from BPF_ANNOTATE_KV_PAIR define system (which is used in this PR branch)

In kernel v5.5 it will be placed in: tools/testing/selftests/bpf/bpf_legacy.h

We should instead have a tutorial that uses the new BTF method... but AFAIK it depends on LLVM version 9, which is not adopted by many distros ...yet.

netoptimizer avatar Nov 27 '19 09:11 netoptimizer

Yeah, the lack of LLVM9 is a problem; we also want to use the new BTF syntax for map pinning. Should we just tell people to install it? :)

tohojo avatar Nov 27 '19 09:11 tohojo

@tohojo, with LLVM9 you also won't need pahole for BTF generation, so that's a double win: you can get rid of a good chunk of sample Makefile ;)

anakryiko avatar Nov 27 '19 20:11 anakryiko

In lack of places to put this, let me link a really advanced example by @chaudron https://lore.kernel.org/bpf/[email protected]/

We unfortunately have to wait for a LLVM release to use this in the tutorial...

netoptimizer avatar Dec 06 '19 14:12 netoptimizer

My plan is to drop this PR, and create a new one based on LLVM9 and use the new ELF-maps style as an example. I also want to detect the LLVM version, to give users a more clear expectations when compiling the example.

netoptimizer avatar Dec 06 '19 14:12 netoptimizer

Jesper Dangaard Brouer [email protected] writes:

My plan is to drop this PR, and create a new one based on LLVM9 and use the new ELF-maps style as an example. I also want to detect the LLVM version, to give users a more clear expectations when compiling the example.

SGTM

tohojo avatar Dec 06 '19 14:12 tohojo