Skip to content

Commit

Permalink
test: dmafwd: tune DMA transfer buffer and completion event pool counts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
TuomasTaipale committed Sep 21, 2023
1 parent b5453b9 commit b2d5730
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/performance/odp_dmafwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,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",
Expand Down Expand Up @@ -438,6 +444,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),
Expand Down Expand Up @@ -838,7 +850,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;
Expand All @@ -862,7 +874,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);
Expand Down

0 comments on commit b2d5730

Please sign in to comment.