diff options
author | Eyal Birger <eyal.birger@gmail.com> | 2022-08-24 20:10:43 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-08-25 20:49:14 +0200 |
commit | 0a0d55ef3e61d9f14e803cacb644fcc890f16774 (patch) | |
tree | 44b5afde26d144c2fe6132a7a74d74a70f21a876 /kernel/bpf | |
parent | bpftool: Fix a wrong type cast in btf_dumper_int (diff) | |
download | linux-0a0d55ef3e61d9f14e803cacb644fcc890f16774.tar.xz linux-0a0d55ef3e61d9f14e803cacb644fcc890f16774.zip |
bpf/scripts: Assert helper enum value is aligned with comment order
The helper value is ABI as defined by enum bpf_func_id.
As bpf_helper_defs.h is used for the userpace part, it must be consistent
with this enum.
Before this change the comments order was used by the bpf_doc script in
order to set the helper values defined in the helpers file.
When adding new helpers it is very puzzling when the userspace application
breaks in weird places if the comment is inserted instead of appended -
because the generated helper ABI is incorrect and shifted.
This commit sets the helper value to the enum value.
In addition it is currently the practice to have the comments appended
and kept in the same order as the enum. As such, add an assertion
validating the comment order is consistent with enum value.
In case a different comments ordering is desired, this assertion can
be lifted.
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220824181043.1601429-1-eyal.birger@gmail.com
Diffstat (limited to 'kernel/bpf')
0 files changed, 0 insertions, 0 deletions