bpf-helpers.7: Add new man page for eBPF helper functions
commit53666f6c30451cde022f65d35a8d448f5a7132ba
authorMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 1 Nov 2018 13:56:24 +0000 (1 14:56 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 1 Nov 2018 13:57:49 +0000 (1 14:57 +0100)
tree77765a2c47da819e9f56dea6f70cd2c1b343bcc4
parentdd63e15948a29c7a8aa083fd9b6e8b84459d9e85
bpf-helpers.7: Add new man page for eBPF helper functions

eBPF sub-system on Linux can use "helper functions", functions
implemented in the kernel that can be called from within a eBPF program
injected by a user on Linux. The kernel already supports a long list of
such helpers (sixty-seven at this time, new ones are under review).
Therefore, it is proposed to create a new manual page, separate from
bpf(2), to document those helpers for people willing to develop new eBPF
programs.

Additionally, in an effort to keep this documentation in synchronisation
with what is implemented in the kernel, it is further proposed to keep
the documentation itself in the kernel sources, as comments in file
"include/uapi/linux/bpf.h", and to generate the man page from there.

This patch adds the new man page, generated from kernel sources, to the
man-pages repository. For each eBPF helper function, a description of
the helper, of its arguments and of the return value is provided. The
idea is that all future changes for this page should be redirected to
the kernel file "include/uapi/linux/bpf.h", and the modified page
generated from there.

Generating the page itself is a two-step process. First, the
documentation is extracted from include/uapi/linux/bpf.h, and converted
to a RST (reStructuredText-formatted) page, with the relevant script
from Linux sources:

      $ ./scripts/bpf_helpers_doc.py > /tmp/bpf-helpers.rst

The second step consists in turning the RST document into the final man
page, with rst2man:

      $ rst2man /tmp/bpf-helpers.rst > bpf-helpers.7

The bpf.h file was taken as at kernel 4.19

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/bpf-helpers.7 [new file with mode: 0644]