Re: [PATCH bpf-next] bpf: add helpers documentation about GPL compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ...
> >   * 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



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux