BPF List
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf 2/2] bpf: Update bpf_design_QA.rst to clarify that attaching to functions is not ABI
Date: Tue, 2 Aug 2022 10:42:52 -0700	[thread overview]
Message-ID: <20220802174252.GG2860372@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <CAADnVQKcRv5RJh0aLEg4+xsBepf=24nyHtbN2Q1t8dgZ9U1jRQ@mail.gmail.com>

On Mon, Aug 01, 2022 at 10:34:16PM -0700, Alexei Starovoitov wrote:
> On Mon, Jul 25, 2022 at 9:40 AM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Mon, Jul 25, 2022 at 01:15:49PM +0100, Matthew Wilcox wrote:
> > > On Fri, Jul 22, 2022 at 02:23:46PM -0700, Paul E. McKenney wrote:
> > > > On Fri, Jul 22, 2022 at 10:17:57PM +0200, Daniel Borkmann wrote:
> > > > > 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.
> > > >
> > > > Excellent point, thank you!
> > > >
> > > > Apologies for the newbie question, but does BTF_ID() mark a function as
> > > > ABI from the viewpoing of a BPF program calling that function, attaching
> > > > to that function, or both?  Either way, is it worth mentioning this
> > > > in this QA entry?
> > >
> > > Not necessarily.  For example, __filemap_add_folio has a BTF_ID(), but
> > > it is not ABI (it's error injection).
> >
> > OK, sounds like something to leave out of the QA, then.
> 
> Obviously, BTF_ID marking doesn't make the kernel function an abi
> in any way. Just like EXPORT_SYMBOL_GPL doesn't do it.
> Documentation/bpf/kfuncs.rst already explains it.
> Probably worth repeating in the QA part of the doc.

Like this?

							Thanx, Paul

------------------------------------------------------------------------

commit 9346b452b92fc520a59da655b55d6bc40f9d1d14
Author: Paul E. McKenney <paulmck@kernel.org>
Date:   Tue Aug 2 10:31:17 2022 -0700

    bpf: Update bpf_design_QA.rst to clarify that BTF_ID does not ABIify a function
    
    This patch updates bpf_design_QA.rst to clarify that mentioning a function
    to the BTF_ID macro does not make that function become part of the Linux
    kernel's ABI.
    
    Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/Documentation/bpf/bpf_design_QA.rst b/Documentation/bpf/bpf_design_QA.rst
index a06ae8a828e3d..a210b8a4df005 100644
--- a/Documentation/bpf/bpf_design_QA.rst
+++ b/Documentation/bpf/bpf_design_QA.rst
@@ -291,3 +291,10 @@ 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.
+
+Q: Marking a function with BTF_ID makes that function an ABI?
+-------------------------------------------------------------
+A: NO.
+
+The BTF_ID macro does not cause a function to become part of the ABI
+any more than does the EXPORT_SYMBOL_GPL macro.

  reply	other threads:[~2022-08-02 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 18:06 [PATCH bpf 1/2] bpf: Update bpf_design_QA.rst to clarify that kprobes is not ABI Paul E. McKenney
2022-07-22 18:06 ` [PATCH bpf 2/2] bpf: Update bpf_design_QA.rst to clarify that attaching to functions " Paul E. McKenney
2022-07-22 20:17   ` Daniel Borkmann
2022-07-22 21:23     ` Paul E. McKenney
2022-07-25 12:15       ` Matthew Wilcox
2022-07-25 16:40         ` Paul E. McKenney
2022-08-02  5:34           ` Alexei Starovoitov
2022-08-02 17:42             ` Paul E. McKenney [this message]
2022-07-26 23:44       ` [PATCH v2 bpf 1/2] bpf: Update bpf_design_QA.rst to clarify that kprobes " Paul E. McKenney
2022-07-26 23:44         ` [PATCH v2 bpf 2/2] bpf: Update bpf_design_QA.rst to clarify that attaching to functions " Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802174252.GG2860372@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=willy@infradead.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox