bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Joe Stringer <joe@cilium.io>
Cc: bpf@vger.kernel.org, Joe Stringer <joe@cilium.io>,
	linux-man@vger.kernel.org, Networking <netdev@vger.kernel.org>,
	mtk.manpages@gmail.com, ast@kernel.org, brianvv@google.com,
	Daniel Borkmann <daniel@iogearbox.net>,
	daniel@zonque.org, john.fastabend@gmail.com, ppenkov@google.com,
	Quentin Monnet <quentin@isovalent.com>,
	sean@mess.org, yhs@fb.com, linux-doc@vger.kernel.org
Subject: Re: [PATCH bpf-next 00/17] Improve BPF syscall command documentation
Date: Thu, 18 Feb 2021 12:26:43 -0700	[thread overview]
Message-ID: <878s7lrxcc.fsf@meer.lwn.net> (raw)
In-Reply-To: <CADa=RyzDXeJeW7jAVce0zfGX2zN5ZcAv5nwYsX7EtAz=bgZYkg@mail.gmail.com>

Joe Stringer <joe@cilium.io> writes:

> Hey Jon, thanks for the feedback. Absolutely, what you say makes
> sense. The intent here wasn't to come up with something new. Based on
> your prompt from this email (and a quick look at your KR '19
> presentation), I'm hearing a few observations:
> * Storing the documentation in the code next to the things that
> contributors edit is a reasonable approach to documentation of this
> kind.

Yes.  At least, it's what we do for a lot of our other documentation in
the kernel.  The assumption is that it will encourage developers to keep
the docs current; in my experience that's somewhat optimistic, but
optimism is good...:)

> * This series currently proposes adding some new Makefile
> infrastructure. However, good use of the "kernel-doc" sphinx directive
> + "DOC: " incantations in the header should be able to achieve the
> same without adding such dedicated build system logic to the tree.

If it can, I would certainly prefer to see it used - or extended, if
need be, to meet your needs.

> * The changes in patch 16 here extended Documentation/bpf/index.rst,
> but to assist in improving the overall kernel documentation
> organisation / hierarchy, you would prefer to instead introduce a
> dedicated Documentation/userspace-api/bpf/ directory where the bpf
> uAPI portions can be documented.

An objective I've been working on for some years is reorienting the
documentation with a focus on who the readers are.  We've tended to
organize it by subsystem, requiring people to wade through a lot of
stuff that isn't useful to them.  So yes, my preference would be to
document the kernel's user-space API in the relevant manual.

That said, I do tend to get pushback here at times, and the BPF API is
arguably a bit different that much of the rest.  So while the above
preference exists and is reasonably strong, the higher priority is to
get good, current documentation in *somewhere* so that it's available to
users.  I don't want to make life too difficult for people working
toward that goal, even if I would paint it a different color.

> In addition to this, today the bpf helpers documentation is built
> through the bpftool build process as well as the runtime bpf
> selftests, mostly as a way to ensure that the API documentation
> conforms to a particular style, which then assists with the generation
> of ReStructured Text and troff output. I can probably simplify the
> make infrastructure involved in triggering the bpf docs build for bpf
> subsystem developers and maintainers. I think there's likely still
> interest from bpf folks to keep that particular dependency in the
> selftests like today and even extend it to include this new
> Documentation, so that we don't either introduce text that fails
> against the parser or in some other way break the parser. Whether that
> validation is done by scripts/kernel-doc or scripts/bpf_helpers_doc.py
> doesn't make a big difference to me, other than I have zero experience
> with Perl. My first impressions are that the bpf_helpers_doc.py is
> providing stricter formatting requirements than what "DOC: " +
> kernel-doc would provide, so my baseline inclination would be to keep
> those patches to enhance that script and use that for the validation
> side (help developers with stronger linting feedback), then use
> kernel-doc for the actual html docs generation side, which would help
> to satisfy your concern around duplication of the documentation build
> systems.

This doesn't sound entirely unreasonable.  I wonder if the BPF helper
could be built into an sphinx extension to make it easy to pull that
information into the docs build.  The advantage there is that it can be
done in Python :)

Looking forward to the next set.

Thanks,

jon

  reply	other threads:[~2021-02-18 19:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  1:08 [PATCH bpf-next 00/17] Improve BPF syscall command documentation Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 01/17] bpf: Import syscall arg documentation Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 02/17] bpf: Add minimal bpf() command documentation Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 03/17] bpf: Document BPF_F_LOCK in syscall commands Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 04/17] bpf: Document BPF_PROG_PIN syscall command Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 05/17] bpf: Document BPF_PROG_ATTACH " Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 06/17] bpf: Document BPF_PROG_TEST_RUN " Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 07/17] bpf: Document BPF_PROG_QUERY " Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 08/17] bpf: Document BPF_MAP_*_BATCH syscall commands Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 09/17] scripts/bpf: Rename bpf_helpers_doc.py -> bpf_doc.py Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 10/17] scripts/bpf: Abstract eBPF API target parameter Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 11/17] scripts/bpf: Add syscall commands printer Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 12/17] tools/bpf: Rename Makefile.{helpers,docs} Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 13/17] tools/bpf: Templatize man page generation Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 14/17] tools/bpf: Build bpf-sycall.2 in Makefile.docs Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 15/17] selftests/bpf: Add docs target Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 16/17] docs/bpf: Add bpf() syscall command reference Joe Stringer
2021-02-17  1:08 ` [PATCH bpf-next 17/17] tools: Sync uapi bpf.h header with latest changes Joe Stringer
2021-02-17 13:55 ` [PATCH bpf-next 00/17] Improve BPF syscall command documentation Toke Høiland-Jørgensen
2021-02-18  4:08   ` Joe Stringer
2021-02-18 11:33     ` Toke Høiland-Jørgensen
2021-02-17 17:32 ` Jonathan Corbet
2021-02-18  4:22   ` Joe Stringer
2021-02-18 19:26     ` Jonathan Corbet [this message]
2021-02-18 21:53       ` Joe Stringer

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=878s7lrxcc.fsf@meer.lwn.net \
    --to=corbet@lwn.net \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brianvv@google.com \
    --cc=daniel@iogearbox.net \
    --cc=daniel@zonque.org \
    --cc=joe@cilium.io \
    --cc=john.fastabend@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ppenkov@google.com \
    --cc=quentin@isovalent.com \
    --cc=sean@mess.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;
as well as URLs for NNTP newsgroup(s).