Message ID | 20230915091329.619306-1-po-hsu.lin@canonical.com |
---|---|
Headers | show |
Series | Fix bpf build failure on Jammy | expand |
On 15.09.23 11:13, Po-Hsu Lin wrote: > BugLink: https://bugs.launchpad.net/bugs/2035181 > > [Impact] > Commit bdeeed3498c7 ("libbpf: fix offsetof() and container_of() to work > with CO-RE") from stable update breaks the ubuntu_bpf test build and > cause net:udpgro_bench.sh, net:udpgro.sh, net:veth.sh in > ubuntu_kernel_selftests stopped working, as they require bpf selftest > to be built first. > > The following is extracted from the commit message: > The problem is the new offsetof() does not play nice with static asserts. > Given that the context is a static assert (and CO-RE relocation is not > needed at compile time), offsetof() usage can be replaced by restoring > the original offsetof() definition as __builtin_offsetof(). > > [Test Plan] > Build bpf selftest in tools/testing/selftests with the following command: > make headers; make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS= \ > clean all KDIR=/usr/src/linux-headers-5.15.0-85-generic/ > > The build can finish successfully with patched kernel source code. > > [Where problems could occur] > Fix limited to testing tool, if this fix is incorrect the bpf selftest > build will remain broken. > > > Alan Maguire (1): > selftests/bpf: fix static assert compilation issue for test_cls_*.c > > tools/testing/selftests/bpf/progs/test_cls_redirect.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > Acked-by: Stefan Bader <stefan.bader@canonical.com>
On 15/09/2023 11:13, Po-Hsu Lin wrote: > BugLink: https://bugs.launchpad.net/bugs/2035181 > > [Impact] > Commit bdeeed3498c7 ("libbpf: fix offsetof() and container_of() to work > with CO-RE") from stable update breaks the ubuntu_bpf test build and > cause net:udpgro_bench.sh, net:udpgro.sh, net:veth.sh in > ubuntu_kernel_selftests stopped working, as they require bpf selftest > to be built first. > > The following is extracted from the commit message: > The problem is the new offsetof() does not play nice with static asserts. > Given that the context is a static assert (and CO-RE relocation is not > needed at compile time), offsetof() usage can be replaced by restoring > the original offsetof() definition as __builtin_offsetof(). > > [Test Plan] > Build bpf selftest in tools/testing/selftests with the following command: > make headers; make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS= \ > clean all KDIR=/usr/src/linux-headers-5.15.0-85-generic/ > > The build can finish successfully with patched kernel source code. > > [Where problems could occur] > Fix limited to testing tool, if this fix is incorrect the bpf selftest > build will remain broken. > > > Alan Maguire (1): > selftests/bpf: fix static assert compilation issue for test_cls_*.c > > tools/testing/selftests/bpf/progs/test_cls_redirect.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
On 15.09.23 11:13, Po-Hsu Lin wrote: > BugLink: https://bugs.launchpad.net/bugs/2035181 > > [Impact] > Commit bdeeed3498c7 ("libbpf: fix offsetof() and container_of() to work > with CO-RE") from stable update breaks the ubuntu_bpf test build and > cause net:udpgro_bench.sh, net:udpgro.sh, net:veth.sh in > ubuntu_kernel_selftests stopped working, as they require bpf selftest > to be built first. > > The following is extracted from the commit message: > The problem is the new offsetof() does not play nice with static asserts. > Given that the context is a static assert (and CO-RE relocation is not > needed at compile time), offsetof() usage can be replaced by restoring > the original offsetof() definition as __builtin_offsetof(). > > [Test Plan] > Build bpf selftest in tools/testing/selftests with the following command: > make headers; make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS= \ > clean all KDIR=/usr/src/linux-headers-5.15.0-85-generic/ > > The build can finish successfully with patched kernel source code. > > [Where problems could occur] > Fix limited to testing tool, if this fix is incorrect the bpf selftest > build will remain broken. > > > Alan Maguire (1): > selftests/bpf: fix static assert compilation issue for test_cls_*.c > > tools/testing/selftests/bpf/progs/test_cls_redirect.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > Applied to jammy:linux/master-prep (for re-spin). Thanks. -Stefan