Skip to content

Commit

Permalink
test: sched_latency: honor pool capability limits
Browse files Browse the repository at this point in the history
Check maximum pool size from pool capability.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
  • Loading branch information
Petri Savolainen authored and muvarov committed Oct 15, 2018
1 parent cd76015 commit bbe8e53
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/performance/odp_sched_latency.c
Expand Up @@ -641,11 +641,13 @@ int main(int argc, char *argv[])
odph_odpthread_params_t thr_params;
odp_cpumask_t cpumask;
odp_pool_t pool;
odp_pool_capability_t pool_capa;
odp_pool_param_t params;
odp_shm_t shm;
test_globals_t *globals;
test_args_t args;
char cpumaskstr[ODP_CPUMASK_STR_SIZE];
uint32_t pool_size;
int i, j;
int ret = 0;
int num_workers = 0;
Expand Down Expand Up @@ -706,10 +708,19 @@ int main(int argc, char *argv[])
/*
* Create event pool
*/
if (odp_pool_capability(&pool_capa)) {
LOG_ERR("pool capa failed\n");
return -1;
}

pool_size = EVENT_POOL_SIZE;
if (pool_capa.buf.max_num && pool_capa.buf.max_num < EVENT_POOL_SIZE)
pool_size = pool_capa.buf.max_num;

odp_pool_param_init(&params);
params.buf.size = sizeof(test_event_t);
params.buf.align = 0;
params.buf.num = EVENT_POOL_SIZE;
params.buf.num = pool_size;
params.type = ODP_POOL_BUFFER;

pool = odp_pool_create("event_pool", &params);
Expand Down

0 comments on commit bbe8e53

Please sign in to comment.