From: Tushar Vyavahare Date: Tue, 2 Jul 2024 05:59:15 +0000 (+0000) Subject: selftests/xsk: Ensure traffic validation proceeds after ring size adjustment in xskxc... X-Git-Tag: v6.11-rc1~163^2~68^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d80d61ab0609f7f7168d59ec82ee5f055a4b6be7;p=thirdparty%2Fkernel%2Flinux.git selftests/xsk: Ensure traffic validation proceeds after ring size adjustment in xskxceiver Previously, HW_SW_MIN_RING_SIZE and HW_SW_MAX_RING_SIZE test cases were not validating Tx/Rx traffic at all due to early return after changing HW ring size in testapp_validate_traffic(). Fix the flow by checking return value of set_ring_size() and act upon it rather than terminating the test case there. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Reviewed-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20240702055916.48071-2-tushar.vyavahare@intel.com --- diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index 2eac0895b0a16..088df53869e8c 100644 --- a/tools/testing/selftests/bpf/xskxceiver.c +++ b/tools/testing/selftests/bpf/xskxceiver.c @@ -1899,11 +1899,15 @@ static int testapp_validate_traffic(struct test_spec *test) } if (test->set_ring) { - if (ifobj_tx->hw_ring_size_supp) - return set_ring_size(ifobj_tx); - - ksft_test_result_skip("Changing HW ring size not supported.\n"); - return TEST_SKIP; + if (ifobj_tx->hw_ring_size_supp) { + if (set_ring_size(ifobj_tx)) { + ksft_test_result_skip("Failed to change HW ring size.\n"); + return TEST_FAILURE; + } + } else { + ksft_test_result_skip("Changing HW ring size not supported.\n"); + return TEST_SKIP; + } } xsk_attach_xdp_progs(test, ifobj_rx, ifobj_tx);