From 40d7ec3d83bece90157e309be9b799ae32e9ddef Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 24 Sep 2024 08:25:38 +0300 Subject: [PATCH] test: queue_perf: check worker count with sp/sc queues Using single consumer/producer queues simultaneously with multiple threads is against the API specification, so prevent it. Also, print used sp/sc command line option. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/performance/odp_queue_perf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/performance/odp_queue_perf.c b/test/performance/odp_queue_perf.c index c69d0751d7..13eb32aafb 100644 --- a/test/performance/odp_queue_perf.c +++ b/test/performance/odp_queue_perf.c @@ -153,6 +153,11 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) return -1; } + if (test_options->single && test_options->num_cpu != 1) { + ODPH_ERR("Using single prod/cons queue(s) with multiple workers not supported.\n"); + return -1; + } + return ret; } @@ -178,6 +183,7 @@ static int create_queues(test_global_t *global) nonblock == ODP_BLOCKING ? "NORMAL" : (nonblock == ODP_NONBLOCKING_LF ? "LOCKFREE" : (nonblock == ODP_NONBLOCKING_WF ? "WAITFREE" : "???"))); + printf(" single prod/cons %d\n", test_options->single); printf(" num rounds %u\n", num_round); printf(" num queues %u\n", num_queue); printf(" num events per queue %u\n", num_event);