diff options
author | Tushar Vyavahare <tushar.vyavahare@intel.com> | 2024-07-02 05:59:15 +0000 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2024-07-02 15:12:30 +0200 |
commit | d80d61ab0609f7f7168d59ec82ee5f055a4b6be7 (patch) | |
tree | de7b370e9840bbcf7a6c1e17951b507a5367cf65 | |
parent | 03922e97bc305c6b2e8bc4b7cc765959ca63b05d (diff) |
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 <tushar.vyavahare@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20240702055916.48071-2-tushar.vyavahare@intel.com
-rw-r--r-- | tools/testing/selftests/bpf/xskxceiver.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index 2eac0895b0a1..088df53869e8 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); |