Re: [PATCH] bpf: avoid padding in struct bpf_common_attr

From: bot+bpf-ci

Date: Tue May 19 2026 - 17:18:24 EST


> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index aec171ccb6ef..bec33bd807dd 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -1506,6 +1506,7 @@ struct bpf_common_attr {
> __u32 log_size;
> __u32 log_level;
> __u32 log_true_size;
> + __u32 __pad;
> };

Song Liu raised an alternative approach in his review: could we use
'__attribute__((aligned(8)))' on the struct instead of adding an
explicit padding field?

https://lore.kernel.org/bpf/CAPhsuW60EONo84VkYbYsLHdAPzpfZ+ig8z=+M6NEhiNj_--qtQ@xxxxxxxxxxxxxx/

This design question hasn't been addressed in the discussion. Was this
alternative considered, and if so, what made the explicit padding approach
preferable?


---
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/26124721051