[PATCH v2 4/6] test/dmadev: check result for device stop
fengchengwen
fengchengwen at huawei.com
Wed Feb 15 02:26:01 CET 2023
Sorry late to see.
On 2023/1/17 1:37, Bruce Richardson wrote:
> The DMA device stop API can return an error value so check that return
> value when running dmadev unit tests.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> app/test/test_dmadev.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
> index fe62e98af8..4e1dbcaa19 100644
> --- a/app/test/test_dmadev.c
> +++ b/app/test/test_dmadev.c
> @@ -837,7 +837,11 @@ test_dmadev_instance(int16_t dev_id)
> goto err;
>
> rte_mempool_free(pool);
> - rte_dma_stop(dev_id);
> +
> + if (rte_dma_stop(dev_id) < 0) {
> + rte_mempool_free(pool);
The pool already freed in above.
I think just add ERR_RETURN here.
> + ERR_RETURN("Error stopping device %u\n", dev_id);
> + }
> rte_dma_stats_reset(dev_id, vchan);
> return 0;
>
>
More information about the dev
mailing list