diff options
author | Tuomas Taipale <tuomas.taipale@nokia.com> | 2023-09-15 08:51:12 +0000 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-09-27 08:40:04 +0300 |
commit | df6b07e853430420e67b7f71c9b607393f0e9590 (patch) | |
tree | 04c4ddd175a6453a660b7c5c95cf7764fc38729d | |
parent | 4be8e050c4152b0a707e6d1c7c33a608139b1e3b (diff) |
test: dmafwd: tune DMA transfer buffer and completion event pool counts
Transfer buffer and DMA completion event pools should be able to
accommodate maximum inflight DMA transfer count of buffers/events.
Change relevant pool creations accordingly.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r-- | test/performance/odp_dmafwd.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 987313f1f..b36b81b6a 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -371,6 +371,12 @@ static parse_result_t check_options(prog_config_t *config) config->num_thrs, dma_capa.pool.max_pools); return PRS_NOK; } + + if (config->num_inflight > dma_capa.pool.max_num) { + ODPH_ERR("Invalid amount of DMA completion events: %u (max: %u)\n", + config->num_inflight, dma_capa.pool.max_num); + return PRS_NOK; + } } else if (config->copy_type == DMA_COPY_POLL) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) { ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n", @@ -439,6 +445,12 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } + if (config->num_inflight > pool_capa.buf.max_num) { + ODPH_ERR("Invalid pool buffer count: %u (max: %u)\n", config->num_inflight, + pool_capa.buf.max_num); + return PRS_NOK; + } + config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), pool_capa.buf.max_cache_size); config->compl_cache_size = MIN(MAX(config->cache_size, dma_capa.pool.min_cache_size), @@ -839,7 +851,7 @@ static odp_bool_t setup_copy(prog_config_t *config) return true; } - pool_param.buf.num = config->num_pkts; + pool_param.buf.num = config->num_inflight; pool_param.buf.size = sizeof(transfer_t); pool_param.buf.cache_size = config->trs_cache_size; pool_param.type = ODP_POOL_BUFFER; @@ -863,7 +875,7 @@ static odp_bool_t setup_copy(prog_config_t *config) if (config->copy_type == DMA_COPY_EV) { odp_dma_pool_param_init(&compl_pool_param); - compl_pool_param.num = config->num_pkts; + compl_pool_param.num = config->num_inflight; compl_pool_param.cache_size = config->compl_cache_size; thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", &compl_pool_param); |