Skip to content

Commit

Permalink
test: queue_perf: check worker count with sp/sc queues
Browse files Browse the repository at this point in the history
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 <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
  • Loading branch information
MatiasElo committed Oct 9, 2024
1 parent eeba4e4 commit 40d7ec3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/performance/odp_queue_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit 40d7ec3

Please sign in to comment.