Remove the hidden assumption that options are allocated at the end of the struct, and teach the compiler about them using a flexible array.
First patch is converting hard-coded 'info + 1' to use ip_tunnel_info() helper. Second patch adds the 'options' flexible array and changes the helper to use it. Changelog - v3=>v4: https://lore.kernel.org/netdev/20250217202503.265318-1-...@nvidia.com/ * Remove the casts in first patch (Jakub). v2->v3: https://lore.kernel.org/netdev/20250212140953.107533-1-...@nvidia.com/ * Add a precursory patch to convert hard-coded user of options. * Keep ip_tunnel_info() macro (Alexander). * Use __aligned_largest (Alexander). v1->v2: https://lore.kernel.org/netdev/20250209101853.15828-1-...@nvidia.com/ * Remove change in struct layout, align 'options' field explicitly (Ilya, Kees, Jakub). * Change allocation I missed in v1 in metadata_dst_alloc_percpu(). Thanks, Gal Gal Pressman (2): ip_tunnel: Use ip_tunnel_info() helper instead of 'info + 1' net: Add options as a flexible array to struct ip_tunnel_info include/net/dst_metadata.h | 7 ++----- include/net/ip_tunnels.h | 7 ++++--- net/core/dst.c | 6 ++++-- net/sched/act_tunnel_key.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) -- 2.40.1