Message ID | 20240226100155.31286-1-roxana.nicolescu@canonical.com |
---|---|
Headers | show |
Series | Fix bpf selftests build failure after v5.15.139 update | expand |
On 26.02.24 11:01, Roxana Nicolescu wrote: > BugLink: https://bugs.launchpad.net/bugs/2054567 > > SRU justification > > [Impact] > Upstream v5.15.139 (#lp2049432) brought commit > "selftests/bpf: Test tail call counting with bpf2bpf and data on stack" > that affects one of the bpf kselftests (tailcall_bpf2bpf6). > because LIBBPF_OPTS macro does not exists, it does not compile. Error below. > > [Fix] > Initially, I thought cherry-picking commit > "libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS" would be the best, > but upstream stable just reverted the commit that broke it. Hence the fix > consists of cherry-picking this commit from stable upstream 5.15.49: I think you meant 5.15.149 above (this is also in the cherry picked line of the patch). I would adjust this when applying, probably to linux-5.15.y as that is the branch name upstream uses. > Commit 62900d358c48 (Revert "selftests/bpf: Test tail call counting with bpf2bpf and data on stack") > > [Test] > This should be solved soon, but compileselftests debian rule does not > compile bpf selftests. > I tested it by using our regression testing tooling, but same results can > be achieved by running: > $ make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= clean all KDIR=/usr/src/linux-headers-5.15.0-<verson>-generic > from the linux tree directory > > Without the fix, it fails to compile: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c: In function ‘test_tailcall_bpf2bpf_6’: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:9: warning: implicit declaration of function ‘LIBBPF_OPTS’; did you mean ‘LIBBPF_API’? [-Wimplicit-function-declaration] > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~ > | LIBBPF_API > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: error: ‘bpf_test_run_opts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~~~~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: note: each undeclared identifier is reported only once for each function it appears in > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:40: error: ‘topts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:823:17: error: expected expression before ‘.’ token > 823 | .data_in = &pkt_v4, > | ^ > make[1]: *** [Makefile:471: /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tailcalls.test.o] Error 1 > make: *** [Makefile:172: all] Error 2 > > With the fix, it compiles. > > [Regression potential] > The only place this is being used is selftests, so the risk is very low. > > Samasth Norway Ananda (1): > Revert "selftests/bpf: Test tail call counting with bpf2bpf and data > on stack" > > .../selftests/bpf/prog_tests/tailcalls.c | 55 ------------------- > .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 42 -------------- > 2 files changed, 97 deletions(-) > delete mode 100644 tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c > Acked-by: Stefan Bader <stefan.bader@canonical.com>
On 26/02/2024 12:11, Stefan Bader wrote: > On 26.02.24 11:01, Roxana Nicolescu wrote: >> BugLink: https://bugs.launchpad.net/bugs/2054567 >> >> SRU justification >> >> [Impact] >> Upstream v5.15.139 (#lp2049432) brought commit >> "selftests/bpf: Test tail call counting with bpf2bpf and data on stack" >> that affects one of the bpf kselftests (tailcall_bpf2bpf6). >> because LIBBPF_OPTS macro does not exists, it does not compile. Error >> below. >> >> [Fix] >> Initially, I thought cherry-picking commit >> "libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS" would be the best, >> but upstream stable just reverted the commit that broke it. Hence the >> fix >> consists of cherry-picking this commit from stable upstream 5.15.49: > > I think you meant 5.15.149 above (this is also in the cherry picked > line of the patch). I would adjust this when applying, probably to > linux-5.15.y as that is the branch name upstream uses. > Yes, indeed. Thanks! >> Commit 62900d358c48 (Revert "selftests/bpf: Test tail call counting >> with bpf2bpf and data on stack") >> >> [Test] >> This should be solved soon, but compileselftests debian rule does not >> compile bpf selftests. >> I tested it by using our regression testing tooling, but same results >> can >> be achieved by running: >> $ make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= >> clean all KDIR=/usr/src/linux-headers-5.15.0-<verson>-generic >> from the linux tree directory >> >> Without the fix, it fails to compile: >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c: >> In function ‘test_tailcall_bpf2bpf_6’: >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:9: >> warning: implicit declaration of function ‘LIBBPF_OPTS’; did you mean >> ‘LIBBPF_API’? [-Wimplicit-function-declaration] >> 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, >> | ^~~~~~~~~~~ >> | LIBBPF_API >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: >> error: ‘bpf_test_run_opts’ undeclared (first use in this function) >> 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, >> | ^~~~~~~~~~~~~~~~~ >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: >> note: each undeclared identifier is reported only once for each >> function it appears in >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:40: >> error: ‘topts’ undeclared (first use in this function) >> 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, >> | ^~~~~ >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:823:17: >> error: expected expression before ‘.’ token >> 823 | .data_in = &pkt_v4, >> | ^ >> make[1]: *** [Makefile:471: >> /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tailcalls.test.o] >> Error 1 >> make: *** [Makefile:172: all] Error 2 >> >> With the fix, it compiles. >> >> [Regression potential] >> The only place this is being used is selftests, so the risk is very low. >> >> Samasth Norway Ananda (1): >> Revert "selftests/bpf: Test tail call counting with bpf2bpf and data >> on stack" >> >> .../selftests/bpf/prog_tests/tailcalls.c | 55 ------------------- >> .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 42 -------------- >> 2 files changed, 97 deletions(-) >> delete mode 100644 >> tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c >> > > Acked-by: Stefan Bader <stefan.bader@canonical.com>
On 2/26/24 3:01 AM, Roxana Nicolescu wrote: > BugLink: https://bugs.launchpad.net/bugs/2054567 > > SRU justification > > [Impact] > Upstream v5.15.139 (#lp2049432) brought commit > "selftests/bpf: Test tail call counting with bpf2bpf and data on stack" > that affects one of the bpf kselftests (tailcall_bpf2bpf6). > because LIBBPF_OPTS macro does not exists, it does not compile. Error below. > > [Fix] > Initially, I thought cherry-picking commit > "libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS" would be the best, > but upstream stable just reverted the commit that broke it. Hence the fix > consists of cherry-picking this commit from stable upstream 5.15.49: > Commit 62900d358c48 (Revert "selftests/bpf: Test tail call counting with bpf2bpf and data on stack") > > [Test] > This should be solved soon, but compileselftests debian rule does not > compile bpf selftests. > I tested it by using our regression testing tooling, but same results can > be achieved by running: > $ make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= clean all KDIR=/usr/src/linux-headers-5.15.0-<verson>-generic > from the linux tree directory > > Without the fix, it fails to compile: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c: In function ‘test_tailcall_bpf2bpf_6’: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:9: warning: implicit declaration of function ‘LIBBPF_OPTS’; did you mean ‘LIBBPF_API’? [-Wimplicit-function-declaration] > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~ > | LIBBPF_API > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: error: ‘bpf_test_run_opts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~~~~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: note: each undeclared identifier is reported only once for each function it appears in > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:40: error: ‘topts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:823:17: error: expected expression before ‘.’ token > 823 | .data_in = &pkt_v4, > | ^ > make[1]: *** [Makefile:471: /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tailcalls.test.o] Error 1 > make: *** [Makefile:172: all] Error 2 > > With the fix, it compiles. > > [Regression potential] > The only place this is being used is selftests, so the risk is very low. > > Samasth Norway Ananda (1): > Revert "selftests/bpf: Test tail call counting with bpf2bpf and data > on stack" > > .../selftests/bpf/prog_tests/tailcalls.c | 55 ------------------- > .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 42 -------------- > 2 files changed, 97 deletions(-) > delete mode 100644 tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c > Acked-by: Tim Gardner <tim.gardner@canonical.com>
On 26.02.24 11:01, Roxana Nicolescu wrote: > BugLink: https://bugs.launchpad.net/bugs/2054567 > > SRU justification > > [Impact] > Upstream v5.15.139 (#lp2049432) brought commit > "selftests/bpf: Test tail call counting with bpf2bpf and data on stack" > that affects one of the bpf kselftests (tailcall_bpf2bpf6). > because LIBBPF_OPTS macro does not exists, it does not compile. Error below. > > [Fix] > Initially, I thought cherry-picking commit > "libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS" would be the best, > but upstream stable just reverted the commit that broke it. Hence the fix > consists of cherry-picking this commit from stable upstream 5.15.49: > Commit 62900d358c48 (Revert "selftests/bpf: Test tail call counting with bpf2bpf and data on stack") > > [Test] > This should be solved soon, but compileselftests debian rule does not > compile bpf selftests. > I tested it by using our regression testing tooling, but same results can > be achieved by running: > $ make -C linux/tools/testing/selftests TARGETS=bpf SKIP_TARGETS= clean all KDIR=/usr/src/linux-headers-5.15.0-<verson>-generic > from the linux tree directory > > Without the fix, it fails to compile: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c: In function ‘test_tailcall_bpf2bpf_6’: > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:9: warning: implicit declaration of function ‘LIBBPF_OPTS’; did you mean ‘LIBBPF_API’? [-Wimplicit-function-declaration] > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~ > | LIBBPF_API > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: error: ‘bpf_test_run_opts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~~~~~~~~~~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:21: note: each undeclared identifier is reported only once for each function it appears in > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:822:40: error: ‘topts’ undeclared (first use in this function) > 822 | LIBBPF_OPTS(bpf_test_run_opts, topts, > | ^~~~~ > /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/prog_tests/tailcalls.c:823:17: error: expected expression before ‘.’ token > 823 | .data_in = &pkt_v4, > | ^ > make[1]: *** [Makefile:471: /root/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tailcalls.test.o] Error 1 > make: *** [Makefile:172: all] Error 2 > > With the fix, it compiles. > > [Regression potential] > The only place this is being used is selftests, so the risk is very low. > > Samasth Norway Ananda (1): > Revert "selftests/bpf: Test tail call counting with bpf2bpf and data > on stack" > > .../selftests/bpf/prog_tests/tailcalls.c | 55 ------------------- > .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 42 -------------- > 2 files changed, 97 deletions(-) > delete mode 100644 tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c > Applied to jammy:linux/master-next (with adjusted reference to linux-5.15.y). Thanks. -Stefan