Re: [PATCHv2 bpf-next 13/15] selftests/bpf: Test syscall command parsing

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

 





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!


Acked-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>
Signed-off-by: Joe Stringer <joe@xxxxxxxxx>

Acked-by: Yonghong Song <yhs@xxxxxx>



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux