diff options
author | Tuomas Taipale <tuomas.taipale@nokia.com> | 2023-03-06 09:52:23 +0000 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-03-09 08:39:45 +0200 |
commit | 22159fe3a293f60079646e04fc90976ea0154f5c (patch) | |
tree | 0c58dba47218bfae299594792aa781fb519356ee /test | |
parent | 9e946b10c10eccf331b1a54edb334ed9252ab509 (diff) |
validation: dma: verify maximum completion event allocation
Verify that maximum transfer amount of completion events can be
allocated from a DMA completion pool. To properly support the claimed
in-flight transfer amount, implementation should also support a matching
amount of in-flight completion events (in case of event completion).
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/validation/api/dma/dma.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c index d7e21890f..434cadae2 100644 --- a/test/validation/api/dma/dma.c +++ b/test/validation/api/dma/dma.c @@ -269,9 +269,10 @@ static void test_dma_compl_pool(void) { odp_pool_t pool; odp_pool_info_t pool_info; - odp_dma_compl_t compl; + odp_dma_compl_t compl[global.dma_capa.max_transfers]; uint64_t u64; int ret; + uint32_t i, j; const char *name = COMPL_POOL_NAME; CU_ASSERT_FATAL(global.compl_pool != ODP_POOL_INVALID); @@ -288,14 +289,21 @@ static void test_dma_compl_pool(void) CU_ASSERT(pool_info.dma_pool_param.num == global.dma_capa.max_transfers); CU_ASSERT(pool_info.dma_pool_param.cache_size == global.cache_size); - compl = odp_dma_compl_alloc(global.compl_pool); + for (i = 0; i < global.dma_capa.max_transfers; i++) { + compl[i] = odp_dma_compl_alloc(global.compl_pool); + + u64 = odp_dma_compl_to_u64(compl[i]); + CU_ASSERT(u64 != odp_dma_compl_to_u64(ODP_DMA_COMPL_INVALID)); - u64 = odp_dma_compl_to_u64(compl); - CU_ASSERT(u64 != odp_dma_compl_to_u64(ODP_DMA_COMPL_INVALID)); - printf("\n DMA compl handle: 0x%" PRIx64 "\n", u64); - odp_dma_compl_print(compl); + if (compl[i] == ODP_DMA_COMPL_INVALID) + break; + + printf("\n DMA compl handle: 0x%" PRIx64 "\n", u64); + odp_dma_compl_print(compl[i]); + } - odp_dma_compl_free(compl); + for (j = 0; j < i; j++) + odp_dma_compl_free(compl[j]); } static void test_dma_compl_pool_same_name(void) |