[v3,4/6] test/dmadev: check result for device stop
Checks
Commit Message
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@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
app/test/test_dmadev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2023/2/16 19:09, 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@intel.com>
> Reviewed-by: Conor Walsh <conor.walsh@intel.com>
> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
> ---
> app/test/test_dmadev.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
> index fe62e98af8..65226004d8 100644
> --- a/app/test/test_dmadev.c
> +++ b/app/test/test_dmadev.c
> @@ -837,7 +837,10 @@ 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)
> + ERR_RETURN("Error stopping device %u\n", dev_id);
> +
> rte_dma_stats_reset(dev_id, vchan);
> return 0;
>
>
@@ -837,7 +837,10 @@ 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)
+ ERR_RETURN("Error stopping device %u\n", dev_id);
+
rte_dma_stats_reset(dev_id, vchan);
return 0;