On 7/22/22 8:06 PM, Paul E. McKenney wrote:
This patch updates bpf_design_QA.rst to clarify that the ability to attach a BPF program to a given function in the kernel does not make that function become part of the Linux kernel's ABI. Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> --- Documentation/bpf/bpf_design_QA.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/bpf/bpf_design_QA.rst b/Documentation/bpf/bpf_design_QA.rst index 2ed9128cfbec8..46337a60255e9 100644 --- a/Documentation/bpf/bpf_design_QA.rst +++ b/Documentation/bpf/bpf_design_QA.rst @@ -279,3 +279,15 @@ cc (congestion-control) implementations. If any of these kernel functions has changed, both the in-tree and out-of-tree kernel tcp cc implementations have to be changed. The same goes for the bpf programs and they have to be adjusted accordingly. + +Q: Attaching to kernel functions is an ABI?
small nit, I'd change to: Attaching to arbitrary kernel functions [...] Otherwise I think this could be a bit misunderstood, e.g. most of the networking programs (e.g. XDP, tc, sock_addr) have a fixed framework around them where attaching programs is part of ABI. Rest looks good, thanks for writing this up, Paul!
+------------------------------------------- +Q: BPF programs can be attached to many kernel functions. Do these +kernel functions become part of the ABI? + +A: NO. + +The kernel function prototypes will change, and BPF programs attaching to +them will need to change. The BPF compile-once-run-everywhere (CO-RE) +should be used in order to make it easier to adapt your BPF programs to +different versions of the kernel.