From: Bastien Curutchet (eBPF Foundation) Date: Fri, 31 Oct 2025 08:04:39 +0000 (+0100) Subject: selftests/bpf: test_xsk: Fix __testapp_validate_traffic()'s return value X-Git-Tag: v6.19-rc1~171^2~61^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cadc0c1fd79c8603d655f729cd6ae2b7fcccffbf;p=thirdparty%2Fkernel%2Flinux.git selftests/bpf: test_xsk: Fix __testapp_validate_traffic()'s return value __testapp_validate_traffic is supposed to return an integer value that tells if the test passed (0), failed (-1) or was skiped (2). It actually returns a boolean in the end. This doesn't harm when the test is successful but can lead to misinterpretation in case of failure as 1 will be returned instead of -1. Return TEST_FAILURE (-1) in case of failure, TEST_PASS (0) otherwise. Reviewed-by: Maciej Fijalkowski Signed-off-by: Bastien Curutchet (eBPF Foundation) Link: https://lore.kernel.org/r/20251031-xsk-v7-3-39fe486593a3@bootlin.com Signed-off-by: Alexei Starovoitov --- diff --git a/tools/testing/selftests/bpf/test_xsk.c b/tools/testing/selftests/bpf/test_xsk.c index 679491b6b9dd8..8d7c38eb32ca3 100644 --- a/tools/testing/selftests/bpf/test_xsk.c +++ b/tools/testing/selftests/bpf/test_xsk.c @@ -1725,7 +1725,10 @@ static int __testapp_validate_traffic(struct test_spec *test, struct ifobject *i testapp_clean_xsk_umem(ifobj2); } - return !!test->fail; + if (test->fail) + return TEST_FAILURE; + + return TEST_PASS; } static int testapp_validate_traffic(struct test_spec *test)