hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/bpf/bpf_devel_QA.rst
....@@ -20,11 +20,11 @@
2020 Q: How do I report bugs for BPF kernel code?
2121 --------------------------------------------
2222 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,
2424 please report any found issues around BPF to the following mailing
2525 list:
2626
27
- netdev@vger.kernel.org
27
+ bpf@vger.kernel.org
2828
2929 This may also include issues related to XDP, BPF tracing, etc.
3030
....@@ -46,17 +46,12 @@
4646
4747 Q: To which mailing list do I need to submit my BPF patches?
4848 ------------------------------------------------------------
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:
5050
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
5752
5853 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
6055 lists and maintainers from there as well, so they are able to review
6156 the changes and provide their Acked-by's to the patches.
6257
....@@ -65,13 +60,13 @@
6560 A: All patches that are Cc'ed to netdev are queued for review under netdev
6661 patchwork project:
6762
68
- http://patchwork.ozlabs.org/project/netdev/list/
63
+ https://patchwork.kernel.org/project/netdevbpf/list/
6964
7065 Those patches which target BPF, are assigned to a 'bpf' delegate for
7166 further processing from BPF maintainers. The current queue with
7267 patches under review can be found at:
7368
74
- https://patchwork.ozlabs.org/project/netdev/list/?delegate=77147
69
+ https://patchwork.kernel.org/project/netdevbpf/list/?delegate=121173
7570
7671 Once the patches have been reviewed by the BPF community as a whole
7772 and approved by the BPF maintainers, their status in patchwork will be
....@@ -154,7 +149,7 @@
154149 again in a second or later revision, it is also required to add a
155150 version number (``v2``, ``v3``, ...) into the subject prefix::
156151
157
- git format-patch --subject-prefix='PATCH net-next v2' start..finish
152
+ git format-patch --subject-prefix='PATCH bpf-next v2' start..finish
158153
159154 When changes have been requested to the patch series, always send the
160155 whole patch series again with the feedback incorporated (never send
....@@ -168,7 +163,7 @@
168163 Be aware that this is not a final verdict that the patch will
169164 automatically get accepted into net or net-next trees eventually:
170165
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
172167 in time. If discussions around a patch conclude that they cannot
173168 get included as-is, we will either apply a follow-up fix or drop
174169 them from the trees entirely. Therefore, we also reserve to rebase
....@@ -442,6 +437,21 @@
442437 See the kernels selftest `Documentation/dev-tools/kselftest.rst`_
443438 document for further documentation.
444439
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
+
445455 Q: Which BPF kernel selftests version should I run my kernel against?
446456 ---------------------------------------------------------------------
447457 A: If you run a kernel ``xyz``, then always run the BPF kernel selftests
....@@ -469,17 +479,18 @@
469479
470480 $ llc --version
471481 LLVM (http://llvm.org/):
472
- LLVM version 6.0.0svn
482
+ LLVM version 10.0.0
473483 Optimized build.
474484 Default target: x86_64-unknown-linux-gnu
475485 Host CPU: skylake
476486
477487 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
483494
484495 For developers in order to utilize the latest features added to LLVM's
485496 BPF back end, it is advisable to run the latest LLVM releases. Support
....@@ -494,18 +505,22 @@
494505 that set up, proceed with building the latest LLVM and clang version
495506 from the git repositories::
496507
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" \
502513 -DBUILD_SHARED_LIBS=OFF \
503514 -DCMAKE_BUILD_TYPE=Release \
504515 -DLLVM_BUILD_RUNTIME=OFF
505
- $ make -j $(getconf _NPROCESSORS_ONLN)
516
+ $ ninja
506517
507518 The built binaries can then be found in the build/bin/ directory, where
508519 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.
509524
510525 Q: Reporting LLVM BPF issues
511526 ----------------------------
....@@ -633,5 +648,6 @@
633648 .. _selftests: ../../tools/testing/selftests/bpf/
634649 .. _Documentation/dev-tools/kselftest.rst:
635650 https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html
651
+.. _Documentation/bpf/btf.rst: btf.rst
636652
637653 Happy BPF hacking!