Re: [PATCH v3 bpf-next 6/6] Documentation/bpf: Update btf doc with updated vlen, kind sizes

bot+bpf-ci
2026-04-17T15:39:13Z

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

> diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst
> index 3b60583f5db2..3f05f17990ad 100644
> --- a/Documentation/bpf/btf.rst
> +++ b/Documentation/bpf/btf.rst
> @@ -97,10 +97,8 @@ Each type contains the following common data::
> struct btf_type {
> __u32 name_off;
> /* "info" bits arrangement
> - * bits 0-15: vlen (e.g. # of struct's members)
> - * bits 16-23: unused
> - * bits 24-28: kind (e.g. int, ptr, array...etc)
> - * bits 29-30: unused
> + * bits 0-23: vlen (e.g. # of struct's members)
> + * bits 24-30: kind (e.g. int, ptr, array...etc)

Does the kind field documentation accurately match the UAPI implementation?
The UAPI defines BTF_INFO_KIND as:

#define BTF_INFO_KIND(info) (((info) >> 24) & 0x7f)

The mask 0x7f is 7 bits, which means kind occupies bits 24-30. This
documentation shows "bits 24-30" which appears correct.

However, checking the actual implementation confirms the kind field uses
only 7 bits (0x7f mask), leaving bit 31 exclusively for kind_flag.

Should the documentation have removed the "bits 16-23: unused" description?
The previous documentation listed bits 16-23 as unused, but after expanding
vlen to bits 0-23, these bits are now part of vlen. The current bit
allocation is:

- Bits 0-23: vlen (24 bits)
- Bits 24-30: kind (7 bits)
- Bit 31: kind_flag (1 bit)

The patch removes the "bits 16-23: unused" line from the struct comment,
which correctly reflects that these bits are now part of the expanded vlen
field.

> * bit 31: kind_flag, currently used by
> * struct, union, enum, fwd, enum64,
> * decl_tag and type_tag

---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/24570998051