Re: [PATCH v5 bpf-next 3/3] selftests/bpf: Add testcases for tailcall hierarchy fixing

Eduard Zingerman
2024-07-11T02:01:54Z

On Mon, 2024-06-24 at 00:15 +0800, Leon Hwang wrote:
> Add some test cases to confirm the tailcall hierarchy issue has been fixed.
>
> On x64, the selftests result is:
>
> cd tools/testing/selftests/bpf && ./test_progs -t tailcalls
> 327/18 tailcalls/tailcall_bpf2bpf_hierarchy_1:OK
> 327/19 tailcalls/tailcall_bpf2bpf_hierarchy_fentry:OK
> 327/20 tailcalls/tailcall_bpf2bpf_hierarchy_fexit:OK
> 327/21 tailcalls/tailcall_bpf2bpf_hierarchy_fentry_fexit:OK
> 327/22 tailcalls/tailcall_bpf2bpf_hierarchy_fentry_entry:OK
> 327/23 tailcalls/tailcall_bpf2bpf_hierarchy_2:OK
> 327/24 tailcalls/tailcall_bpf2bpf_hierarchy_3:OK
> 327 tailcalls:OK
> Summary: 1/24 PASSED, 0 SKIPPED, 0 FAILED
>
> On arm64, the selftests result is:
>
> cd tools/testing/selftests/bpf && ./test_progs -t tailcalls
> 327/18 tailcalls/tailcall_bpf2bpf_hierarchy_1:OK
> 327/19 tailcalls/tailcall_bpf2bpf_hierarchy_fentry:OK
> 327/20 tailcalls/tailcall_bpf2bpf_hierarchy_fexit:OK
> 327/21 tailcalls/tailcall_bpf2bpf_hierarchy_fentry_fexit:OK
> 327/22 tailcalls/tailcall_bpf2bpf_hierarchy_fentry_entry:OK
> 327/23 tailcalls/tailcall_bpf2bpf_hierarchy_2:OK
> 327/24 tailcalls/tailcall_bpf2bpf_hierarchy_3:OK
> 327 tailcalls:OK
> Summary: 1/24 PASSED, 0 SKIPPED, 0 FAILED
>
> Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
> ---

Nitpick:
I think that test cases *_hierarchy_{2,3} could be rewritten as
example by this link:
https://gist.github.com/eddyz87/af9b50d0ff3802b43f0e148591790017
It uses test_loader.c machinery, you can use RUN_TESTS macro from any
prog_tests/*.c file to run test cases from a specific binary file.

Otherwise these test cases look good to me.

Acked-by: Eduard Zingerman <eddyz87@gmail.com> …