Re: [PATCH bpf-next v2 18/18] docs/bpf: Update documentation for BTF_KIND_ENUM64 support

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

 



On Fri, May 13, 2022 at 8:14 PM Yonghong Song <yhs@xxxxxx> wrote:
>
> Add BTF_KIND_ENUM64 documentation in btf.rst.
> Also fixed a typo for section number for BTF_KIND_TYPE_TAG
> from 2.2.17 to 2.2.18.
>
> Signed-off-by: Yonghong Song <yhs@xxxxxx>
> ---

LGTM, but see pedantic note below

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

>  Documentation/bpf/btf.rst | 34 +++++++++++++++++++++++++++++-----
>  1 file changed, 29 insertions(+), 5 deletions(-)
>

[...]

> +2.2.19 BTF_KIND_ENUM64
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +``struct btf_type`` encoding requirement:
> +  * ``name_off``: 0 or offset to a valid C identifier
> +  * ``info.kind_flag``: 0 for unsigned, 1 for signed
> +  * ``info.kind``: BTF_KIND_ENUM64
> +  * ``info.vlen``: number of enum values
> +  * ``size``: 1/2/4/8
> +
> +``btf_type`` is followed by ``info.vlen`` number of ``struct btf_enum64``.::
> +
> +    struct btf_enum64 {
> +        __u32   name_off;
> +        __u32   val_lo32;
> +        __u32   val_hi32;
> +    };
> +
> +The ``btf_enum64`` encoding:
> +  * ``name_off``: offset to a valid C identifier
> +  * ``val_lo32``: lower 32-bit value for a 64-bit value
> +  * ``val_hi32``: high 32-bit value for a 64-bit value
> +

I presume if size is < 8 then val_hi32 will be sign-extended (i.e.,
0xffffffff for signed enum and negative enumerator values, 0
otherwise), right? Should it be specified here?

>  3. BTF Kernel API
>  =================
>
> --
> 2.30.2
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux