Commit c4f96053 authored by Tushar Vyavahare's avatar Tushar Vyavahare Committed by Daniel Borkmann

selftests/xsk: Test AF_XDP functionality under minimal ring configurations

Add a new test case that stresses AF_XDP and the driver by configuring
small hardware and software ring sizes. This verifies that AF_XDP continues
to function properly even with insufficient ring space that could lead
to frequent producer/consumer throttling. The test procedure involves:

1. Set the minimum possible ring configuration(tx 64 and rx 128).
2. Run tests with various batch sizes(1 and 63) to validate the system's
   behavior under different configurations.

Update Makefile to include network_helpers.o in the build process for
xskxceiver.
Signed-off-by: default avatarTushar Vyavahare <tushar.vyavahare@intel.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20240402114529.545475-7-tushar.vyavahare@intel.com
parent 776021e0
......@@ -2419,6 +2419,26 @@ static int testapp_xdp_metadata_mb(struct test_spec *test)
return testapp_xdp_metadata_copy(test);
}
static int testapp_hw_sw_min_ring_size(struct test_spec *test)
{
int ret;
test->set_ring = true;
test->total_steps = 2;
test->ifobj_tx->ring.tx_pending = DEFAULT_BATCH_SIZE;
test->ifobj_tx->ring.rx_pending = DEFAULT_BATCH_SIZE * 2;
test->ifobj_tx->xsk->batch_size = 1;
test->ifobj_rx->xsk->batch_size = 1;
ret = testapp_validate_traffic(test);
if (ret)
return ret;
/* Set batch size to hw_ring_size - 1 */
test->ifobj_tx->xsk->batch_size = DEFAULT_BATCH_SIZE - 1;
test->ifobj_rx->xsk->batch_size = DEFAULT_BATCH_SIZE - 1;
return testapp_validate_traffic(test);
}
static void run_pkt_test(struct test_spec *test)
{
int ret;
......@@ -2523,6 +2543,7 @@ static const struct test_spec tests[] = {
{.name = "ALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_aligned_inv_desc_mb},
{.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb},
{.name = "TOO_MANY_FRAGS", .test_func = testapp_too_many_frags},
{.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size},
};
static void print_tests(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment