| .. | .. |
|---|
| 20 | 20 | Q: How do I report bugs for BPF kernel code? |
|---|
| 21 | 21 | -------------------------------------------- |
|---|
| 22 | 22 | A: Since all BPF kernel development as well as bpftool and iproute2 BPF |
|---|
| 23 | | -loader development happens through the netdev kernel mailing list, |
|---|
| 23 | +loader development happens through the bpf kernel mailing list, |
|---|
| 24 | 24 | please report any found issues around BPF to the following mailing |
|---|
| 25 | 25 | list: |
|---|
| 26 | 26 | |
|---|
| 27 | | - netdev@vger.kernel.org |
|---|
| 27 | + bpf@vger.kernel.org |
|---|
| 28 | 28 | |
|---|
| 29 | 29 | This may also include issues related to XDP, BPF tracing, etc. |
|---|
| 30 | 30 | |
|---|
| .. | .. |
|---|
| 46 | 46 | |
|---|
| 47 | 47 | Q: To which mailing list do I need to submit my BPF patches? |
|---|
| 48 | 48 | ------------------------------------------------------------ |
|---|
| 49 | | -A: Please submit your BPF patches to the netdev kernel mailing list: |
|---|
| 49 | +A: Please submit your BPF patches to the bpf kernel mailing list: |
|---|
| 50 | 50 | |
|---|
| 51 | | - netdev@vger.kernel.org |
|---|
| 52 | | - |
|---|
| 53 | | -Historically, BPF came out of networking and has always been maintained |
|---|
| 54 | | -by the kernel networking community. Although these days BPF touches |
|---|
| 55 | | -many other subsystems as well, the patches are still routed mainly |
|---|
| 56 | | -through the networking community. |
|---|
| 51 | + bpf@vger.kernel.org |
|---|
| 57 | 52 | |
|---|
| 58 | 53 | In case your patch has changes in various different subsystems (e.g. |
|---|
| 59 | | -tracing, security, etc), make sure to Cc the related kernel mailing |
|---|
| 54 | +networking, tracing, security, etc), make sure to Cc the related kernel mailing |
|---|
| 60 | 55 | lists and maintainers from there as well, so they are able to review |
|---|
| 61 | 56 | the changes and provide their Acked-by's to the patches. |
|---|
| 62 | 57 | |
|---|
| .. | .. |
|---|
| 65 | 60 | A: All patches that are Cc'ed to netdev are queued for review under netdev |
|---|
| 66 | 61 | patchwork project: |
|---|
| 67 | 62 | |
|---|
| 68 | | - http://patchwork.ozlabs.org/project/netdev/list/ |
|---|
| 63 | + https://patchwork.kernel.org/project/netdevbpf/list/ |
|---|
| 69 | 64 | |
|---|
| 70 | 65 | Those patches which target BPF, are assigned to a 'bpf' delegate for |
|---|
| 71 | 66 | further processing from BPF maintainers. The current queue with |
|---|
| 72 | 67 | patches under review can be found at: |
|---|
| 73 | 68 | |
|---|
| 74 | | - https://patchwork.ozlabs.org/project/netdev/list/?delegate=77147 |
|---|
| 69 | + https://patchwork.kernel.org/project/netdevbpf/list/?delegate=121173 |
|---|
| 75 | 70 | |
|---|
| 76 | 71 | Once the patches have been reviewed by the BPF community as a whole |
|---|
| 77 | 72 | and approved by the BPF maintainers, their status in patchwork will be |
|---|
| .. | .. |
|---|
| 154 | 149 | again in a second or later revision, it is also required to add a |
|---|
| 155 | 150 | version number (``v2``, ``v3``, ...) into the subject prefix:: |
|---|
| 156 | 151 | |
|---|
| 157 | | - git format-patch --subject-prefix='PATCH net-next v2' start..finish |
|---|
| 152 | + git format-patch --subject-prefix='PATCH bpf-next v2' start..finish |
|---|
| 158 | 153 | |
|---|
| 159 | 154 | When changes have been requested to the patch series, always send the |
|---|
| 160 | 155 | whole patch series again with the feedback incorporated (never send |
|---|
| .. | .. |
|---|
| 168 | 163 | Be aware that this is not a final verdict that the patch will |
|---|
| 169 | 164 | automatically get accepted into net or net-next trees eventually: |
|---|
| 170 | 165 | |
|---|
| 171 | | -On the netdev kernel mailing list reviews can come in at any point |
|---|
| 166 | +On the bpf kernel mailing list reviews can come in at any point |
|---|
| 172 | 167 | in time. If discussions around a patch conclude that they cannot |
|---|
| 173 | 168 | get included as-is, we will either apply a follow-up fix or drop |
|---|
| 174 | 169 | them from the trees entirely. Therefore, we also reserve to rebase |
|---|
| .. | .. |
|---|
| 442 | 437 | See the kernels selftest `Documentation/dev-tools/kselftest.rst`_ |
|---|
| 443 | 438 | document for further documentation. |
|---|
| 444 | 439 | |
|---|
| 440 | +To maximize the number of tests passing, the .config of the kernel |
|---|
| 441 | +under test should match the config file fragment in |
|---|
| 442 | +tools/testing/selftests/bpf as closely as possible. |
|---|
| 443 | + |
|---|
| 444 | +Finally to ensure support for latest BPF Type Format features - |
|---|
| 445 | +discussed in `Documentation/bpf/btf.rst`_ - pahole version 1.16 |
|---|
| 446 | +is required for kernels built with CONFIG_DEBUG_INFO_BTF=y. |
|---|
| 447 | +pahole is delivered in the dwarves package or can be built |
|---|
| 448 | +from source at |
|---|
| 449 | + |
|---|
| 450 | +https://github.com/acmel/dwarves |
|---|
| 451 | + |
|---|
| 452 | +Some distros have pahole version 1.16 packaged already, e.g. |
|---|
| 453 | +Fedora, Gentoo. |
|---|
| 454 | + |
|---|
| 445 | 455 | Q: Which BPF kernel selftests version should I run my kernel against? |
|---|
| 446 | 456 | --------------------------------------------------------------------- |
|---|
| 447 | 457 | A: If you run a kernel ``xyz``, then always run the BPF kernel selftests |
|---|
| .. | .. |
|---|
| 469 | 479 | |
|---|
| 470 | 480 | $ llc --version |
|---|
| 471 | 481 | LLVM (http://llvm.org/): |
|---|
| 472 | | - LLVM version 6.0.0svn |
|---|
| 482 | + LLVM version 10.0.0 |
|---|
| 473 | 483 | Optimized build. |
|---|
| 474 | 484 | Default target: x86_64-unknown-linux-gnu |
|---|
| 475 | 485 | Host CPU: skylake |
|---|
| 476 | 486 | |
|---|
| 477 | 487 | Registered Targets: |
|---|
| 478 | | - bpf - BPF (host endian) |
|---|
| 479 | | - bpfeb - BPF (big endian) |
|---|
| 480 | | - bpfel - BPF (little endian) |
|---|
| 481 | | - x86 - 32-bit X86: Pentium-Pro and above |
|---|
| 482 | | - x86-64 - 64-bit X86: EM64T and AMD64 |
|---|
| 488 | + aarch64 - AArch64 (little endian) |
|---|
| 489 | + bpf - BPF (host endian) |
|---|
| 490 | + bpfeb - BPF (big endian) |
|---|
| 491 | + bpfel - BPF (little endian) |
|---|
| 492 | + x86 - 32-bit X86: Pentium-Pro and above |
|---|
| 493 | + x86-64 - 64-bit X86: EM64T and AMD64 |
|---|
| 483 | 494 | |
|---|
| 484 | 495 | For developers in order to utilize the latest features added to LLVM's |
|---|
| 485 | 496 | BPF back end, it is advisable to run the latest LLVM releases. Support |
|---|
| .. | .. |
|---|
| 494 | 505 | that set up, proceed with building the latest LLVM and clang version |
|---|
| 495 | 506 | from the git repositories:: |
|---|
| 496 | 507 | |
|---|
| 497 | | - $ git clone http://llvm.org/git/llvm.git |
|---|
| 498 | | - $ cd llvm/tools |
|---|
| 499 | | - $ git clone --depth 1 http://llvm.org/git/clang.git |
|---|
| 500 | | - $ cd ..; mkdir build; cd build |
|---|
| 501 | | - $ cmake .. -DLLVM_TARGETS_TO_BUILD="BPF;X86" \ |
|---|
| 508 | + $ git clone https://github.com/llvm/llvm-project.git |
|---|
| 509 | + $ mkdir -p llvm-project/llvm/build/install |
|---|
| 510 | + $ cd llvm-project/llvm/build |
|---|
| 511 | + $ cmake .. -G "Ninja" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \ |
|---|
| 512 | + -DLLVM_ENABLE_PROJECTS="clang" \ |
|---|
| 502 | 513 | -DBUILD_SHARED_LIBS=OFF \ |
|---|
| 503 | 514 | -DCMAKE_BUILD_TYPE=Release \ |
|---|
| 504 | 515 | -DLLVM_BUILD_RUNTIME=OFF |
|---|
| 505 | | - $ make -j $(getconf _NPROCESSORS_ONLN) |
|---|
| 516 | + $ ninja |
|---|
| 506 | 517 | |
|---|
| 507 | 518 | The built binaries can then be found in the build/bin/ directory, where |
|---|
| 508 | 519 | you can point the PATH variable to. |
|---|
| 520 | + |
|---|
| 521 | +Set ``-DLLVM_TARGETS_TO_BUILD`` equal to the target you wish to build, you |
|---|
| 522 | +will find a full list of targets within the llvm-project/llvm/lib/Target |
|---|
| 523 | +directory. |
|---|
| 509 | 524 | |
|---|
| 510 | 525 | Q: Reporting LLVM BPF issues |
|---|
| 511 | 526 | ---------------------------- |
|---|
| .. | .. |
|---|
| 633 | 648 | .. _selftests: ../../tools/testing/selftests/bpf/ |
|---|
| 634 | 649 | .. _Documentation/dev-tools/kselftest.rst: |
|---|
| 635 | 650 | https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html |
|---|
| 651 | +.. _Documentation/bpf/btf.rst: btf.rst |
|---|
| 636 | 652 | |
|---|
| 637 | 653 | Happy BPF hacking! |
|---|