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
This commit is contained in:
Tushar Vyavahare 2024-07-02 05:59:15 +00:00 committed by Daniel Borkmann
parent 03922e97bc
commit d80d61ab06

View File

@ -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);