Re: [PATCH bpf-next v2 2/3] bpftool: Add bpftool-token manpage

From: Quentin Monnet
Date: Tue Jul 22 2025 - 11:04:53 EST


2025-07-22 20:09 UTC+0800 ~ Tao Chen <chen.dylane@xxxxxxxxx>
> Add bpftool-token manpage with information and examples of token-related
> commands.
>
> Signed-off-by: Tao Chen <chen.dylane@xxxxxxxxx>
> ---
> .../bpftool/Documentation/bpftool-token.rst | 63 +++++++++++++++++++
> 1 file changed, 63 insertions(+)
> create mode 100644 tools/bpf/bpftool/Documentation/bpftool-token.rst
>
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-token.rst b/tools/bpf/bpftool/Documentation/bpftool-token.rst
> new file mode 100644
> index 00000000000..c5fe9292258
> --- /dev/null
> +++ b/tools/bpf/bpftool/Documentation/bpftool-token.rst
> @@ -0,0 +1,63 @@
> +.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +
> +================
> +bpftool-token
> +================
> +-------------------------------------------------------------------------------
> +tool for inspection and simple manipulation of eBPF tokens
> +-------------------------------------------------------------------------------
> +
> +:Manual section: 8
> +
> +.. include:: substitutions.rst
> +
> +SYNOPSIS
> +========
> +
> +**bpftool** [*OPTIONS*] **token** *COMMAND*
> +
> +*OPTIONS* := { |COMMON_OPTIONS| }
> +
> +*COMMANDS* := { **show** | **list** | **help** }
> +
> +TOKEN COMMANDS
> +===============
> +
> +| **bpftool** **token** { **show** | **list** }
> +| **bpftool** **token help**
> +|
> +
> +DESCRIPTION
> +===========
> +bpftool token { show | list }
> + List all the speciafic allowed types for **bpf**\ () system call


Typo: "speciafic".


> + commands, maps, programs, and attach types, as well as the
> + *bpffs* mount point used to set the token information.


This sentence needs to be adjusted now that you can print info for
several mountpoints.

How about:

List BPF token information for each *bpffs* mount point containing token
information on the system. Information include mount point path, allowed
**bpf**\ () system call commands, maps, programs, and attach types for the
token.


> +
> +bpftool prog help
> + Print short help message.
> +
> +OPTIONS
> +========
> +.. include:: common_options.rst
> +
> +EXAMPLES
> +========
> +|
> +| **# mkdir -p /sys/fs/bpf/token**
> +| **# mount -t bpf bpffs /sys/fs/bpf/token** \
> +| **-o delegate_cmds=prog_load:map_create** \
> +| **-o delegate_progs=kprobe** \
> +| **-o delegate_attachs=xdp**
> +| **# bpftool token list**
> +
> +::
> +
> + token_info /sys/fs/bpf/token
> + allowed_cmds:
> + map_create prog_load
> + allowed_maps:
> + allowed_progs:
> + kprobe
> + allowed_attachs:
> + xdp