BPF List
 help / color / mirror / Atom feed
From: Lorenzo Fontana <fontanalorenz@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf@vger.kernel.org, Quentin Monnet <quentin@isovalent.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH bpf-next] bpf: add helpers documentation about GPL compatibility
Date: Sat, 4 Sep 2021 04:28:37 +0200	[thread overview]
Message-ID: <YTLZ1dEBdA+5fdat@riversong> (raw)
In-Reply-To: <20210824001013.mktbw4p6mn6desdv@ast-mbp.dhcp.thefacebook.com>

On Mon, Aug 23, 2021 at 05:10:13PM -0700, Alexei Starovoitov wrote:
> On Sun, Aug 22, 2021 at 01:59:00PM +0200, Lorenzo Fontana wrote:
> > When writing BPF programs one might refer to the man page
> > to lookup helpers. When you do so, however you don't have
> > a way to immediately know if you can use the helper
> > based on your program licensing requirements.
> > 
> > This patch adds a specific line in the man bpf-helpers
> > to show that information straight away.
> > 
> > Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
> ...
> >   * long bpf_trace_printk(const char *fmt, u32 fmt_size, ...)
> >   * 	Description
> > @@ -1613,6 +1621,8 @@ union bpf_attr {
> >   * 	Return
> >   * 		The number of bytes written to the buffer, or a negative error
> >   * 		in case of failure.
> > + * 	GPL Compatibility
> > + * 		Required
> 
> I think manually annotating the docs is too easy to get wrong.
> I think scripts/bpf_doc.py should be able to pick it up from the code somehow?
> or rely on dynamic discovery by bpftool?

Thanks for the review Alexei. I agree it's not the best but I followed
the same approach as for the other elements. It might seem that the
script parses those from code but in reality it just parses them from
a comment in the helpers file. I tried to accomplish this by looking at
the various C files containing this information but it would mean
changing a lot the way the script works. I can still do that but wanted
to also note that it will be very unlikely that an helper changes
licensing and since the helper makers will always need to annotate the
helpers header file with information I thought that adding this
immediately would've been enough.

I'll explore the possibility of doing this with bpftool instead, that's
a great suggestion. Thank you!


Lore

      reply	other threads:[~2021-09-04  2:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 11:59 [PATCH bpf-next] bpf: add helpers documentation about GPL compatibility Lorenzo Fontana
2021-08-24  0:10 ` Alexei Starovoitov
2021-09-04  2:28   ` Lorenzo Fontana [this message]

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=YTLZ1dEBdA+5fdat@riversong \
    --to=fontanalorenz@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=quentin@isovalent.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