Skip to content

Commit

Permalink
test: sched_latency: check queue count capability
Browse files Browse the repository at this point in the history
Check capability for the number of created queues.

Signed-off-by: Matias Elo <[email protected]>
Reviewed-by: Tuomas Taipale <[email protected]>
  • Loading branch information
MatiasElo committed Nov 20, 2024
1 parent cfb8102 commit 0109893
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/performance/odp_sched_latency.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ static int calc_queue_sizes(test_globals_t *globals, uint32_t queue_size[])
odp_schedule_capability_t capa;
test_args_t *args = &globals->args;
const uint32_t min_queue_size = 256;
uint32_t tot_queues = 0;

if (odp_schedule_capability(&capa)) {
ODPH_ERR("Schedule capability failed\n");
Expand Down Expand Up @@ -879,6 +880,13 @@ static int calc_queue_sizes(test_globals_t *globals, uint32_t queue_size[])
capa.max_queue_size);
queue_size[i] = capa.max_queue_size;
}
tot_queues += queues;
}

if (tot_queues > capa.max_queues) {
ODPH_ERR("Requested %" PRIu32 " queues, max %" PRIu32 " supported\n",
tot_queues, capa.max_queues);
return -1;
}

return 0;
Expand Down

0 comments on commit 0109893

Please sign in to comment.