]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/bpf: Ensure libbpf skip all-zeros fields of struct_ops maps.
authorKui-Feng Lee <thinker.li@gmail.com>
Wed, 13 Mar 2024 21:41:38 +0000 (14:41 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 14 Mar 2024 20:47:05 +0000 (13:47 -0700)
commit26a7cf2bbea656837583f9a1a0f9390db63d6cc3
tree23b3d167b14c63d771404758606aebfb8aaaa812
parentc911fc61a7ce367f9ea48e457f31bb171e80ca4d
selftests/bpf: Ensure libbpf skip all-zeros fields of struct_ops maps.

A new version of a type may have additional fields that do not exist in
older versions. Previously, libbpf would reject struct_ops maps with a new
version containing extra fields when running on a machine with an old
kernel. However, we have updated libbpf to ignore these fields if their
values are all zeros or null in order to provide backward compatibility.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240313214139.685112-3-thinker.li@gmail.com
tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c
tools/testing/selftests/bpf/progs/struct_ops_module.c