bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Stringer <joe@cilium.io>
To: Yonghong Song <yhs@fb.com>
Cc: "Joe Stringer" <joe@cilium.io>, bpf <bpf@vger.kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	linux-doc@vger.kernel.org, linux-man@vger.kernel.org,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Quentin Monnet" <quentin@isovalent.com>,
	"Michael Kerrisk" <mtk.manpages@gmail.com>
Subject: Re: [PATCHv2 bpf-next 13/15] selftests/bpf: Test syscall command parsing
Date: Wed, 3 Mar 2021 15:50:56 -0800	[thread overview]
Message-ID: <CADa=Ryw+qV=bVYkGj+9WkS6T_pGCBc4cpg6KnkoQg1wRfwwXNQ@mail.gmail.com> (raw)
In-Reply-To: <0c5a3a41-2df2-2d54-80d5-00a9951074fb@fb.com>

On Wed, Mar 3, 2021 at 2:23 PM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 3/2/21 9:19 AM, Joe Stringer wrote:
> > Add building of the bpf(2) syscall commands documentation as part of the
> > docs building step in the build. This allows us to pick up on potential
> > parse errors from the docs generator script as part of selftests.
> >
> > The generated manual pages here are not intended for distribution, they
> > are just a fragment that can be integrated into the other static text of
> > bpf(2) to form the full manual page.
>
> I tried and the generated bpf(2) man page looks like:
>
> BPF(2)
>
>                           BPF(2)
>
> NAME
>         bpf - Perform a command on an extended BPF object
>
> COMMANDS
>         BPF_MAP_CREATE
>
>                Description
>                       Create  a map and return a file descriptor that
> refers to the map. The close-on-exec file descriptor flag (see fcntl(2))
> is automatically enabled for the
>                       new file descriptor.
>
>                       Applying close(2) to the file descriptor returned
> by BPF_MAP_CREATE will delete the map (but see NOTES).
>
>                Return A new file descriptor (a nonnegative integer), or
> -1 if an error occurred (in which case, errno is set appropriately).
>
>         BPF_MAP_LOOKUP_ELEM
> ...
>         BPF_PROG_BIND_MAP
>
>                Description
>                       Bind a map to the lifetime of an eBPF program.
>
>                       The map identified by map_fd is bound to the
> program identified by prog_fd and only released when prog_fd is
> released. This may be used  in  cases  where
>                       metadata  should  be  associated  with  a  program
>   which otherwise does not contain any references to the map (for
> example, embedded in the eBPF program
>                       instructions).
>
>                Return Returns zero on success. On error, -1 is returned
> and errno is set appropriately.
>
>
> Yes, this needs to be integrated into the real man page. But this is
> already great so people can see latest bpf latest features without
> going to the source code. Thanks!

:party-parrot:

Yeah I think the step around integrating into the real man page is an
area that folks may have opinions on and I'm CC'ing Michael here in
particular, but ultimately that manual is currently managed in the
upstream manpages tree so nothing actionable from this series,
absolute simplest is for someone (is that me?) to just package this
hunk up and submit it to the upstream tree every once in a while.
Slightly more elaborate would involve integrating the static text with
this generated text somewhere (either kernel tree or manpages tree)
and have someone run a cron job to generate & submit the changes.
Could be another option, these are the obvious ones that come to mind.

> >
> > Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
> > Reviewed-by: Quentin Monnet <quentin@isovalent.com>
> > Signed-off-by: Joe Stringer <joe@cilium.io>
>
> Acked-by: Yonghong Song <yhs@fb.com>

  reply	other threads:[~2021-03-04  1:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 17:19 [PATCHv2 bpf-next 00/15] Improve BPF syscall command documentation Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 01/15] bpf: Import syscall arg documentation Joe Stringer
2021-03-03 19:38   ` Yonghong Song
2021-03-03 20:20     ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 02/15] bpf: Add minimal bpf() command documentation Joe Stringer
2021-03-03 19:44   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 03/15] bpf: Document BPF_F_LOCK in syscall commands Joe Stringer
2021-03-03 20:16   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 04/15] bpf: Document BPF_PROG_PIN syscall command Joe Stringer
2021-03-03 20:21   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 05/15] bpf: Document BPF_PROG_ATTACH " Joe Stringer
2021-03-03 20:23   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 06/15] bpf: Document BPF_PROG_TEST_RUN " Joe Stringer
2021-03-03 20:29   ` Yonghong Song
2021-03-03 23:53     ` Joe Stringer
2021-04-10 18:12       ` Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 07/15] bpf: Document BPF_PROG_QUERY " Joe Stringer
2021-03-03 20:31   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 08/15] bpf: Document BPF_MAP_*_BATCH syscall commands Joe Stringer
2021-03-03 17:38   ` Brian Vazquez
2021-03-03 20:44   ` Yonghong Song
2021-03-02 17:19 ` [PATCHv2 bpf-next 09/15] scripts/bpf: Abstract eBPF API target parameter Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 10/15] scripts/bpf: Add syscall commands printer Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 11/15] tools/bpf: Remove bpf-helpers from bpftool docs Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 12/15] selftests/bpf: Templatize man page generation Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 13/15] selftests/bpf: Test syscall command parsing Joe Stringer
2021-03-03 22:23   ` Yonghong Song
2021-03-03 23:50     ` Joe Stringer [this message]
2021-03-02 17:19 ` [PATCHv2 bpf-next 14/15] docs/bpf: Add bpf() syscall command reference Joe Stringer
2021-03-02 17:19 ` [PATCHv2 bpf-next 15/15] tools: Sync uapi bpf.h header with latest changes Joe Stringer
2021-03-03 17:25 ` [PATCHv2 bpf-next 00/15] Improve BPF syscall command documentation Jonathan Corbet
2021-03-03 18:50   ` Joe Stringer
2021-03-05  2:51 ` Alexei Starovoitov

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='CADa=Ryw+qV=bVYkGj+9WkS6T_pGCBc4cpg6KnkoQg1wRfwwXNQ@mail.gmail.com' \
    --to=joe@cilium.io \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=quentin@isovalent.com \
    --cc=toke@redhat.com \
    --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).