test/dma: fix api testuite teardown

Message ID 20240311152550.1406686-1-kevin.laatz@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series test/dma: fix api testuite teardown |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Kevin Laatz March 11, 2024, 3:25 p.m. UTC
  The API testsuite previously only used the dmadev skeleton. Now that real
devices are being used for the API tests, the DMA stats need to be reset
during testsuite teardown to ensure a known, clean state before continuing.

Fixes: 14b477ed1740 ("test/dma: use unit test framework")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
 app/test/test_dmadev_api.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

fengchengwen March 12, 2024, 1:29 a.m. UTC | #1
It's not a bugfix, but a best practice for test (clean state before continuing).

The other is LGTM,
Acked-by: Chengwen Feng <fengchengwen@huawei.com>


On 2024/3/11 23:25, Kevin Laatz wrote:
> The API testsuite previously only used the dmadev skeleton. Now that real
> devices are being used for the API tests, the DMA stats need to be reset
> during testsuite teardown to ensure a known, clean state before continuing.
> 
> Fixes: 14b477ed1740 ("test/dma: use unit test framework")
> 
> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
> ---
>  app/test/test_dmadev_api.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c
> index a130e74b51..d40c05cfbf 100644
> --- a/app/test/test_dmadev_api.c
> +++ b/app/test/test_dmadev_api.c
> @@ -82,6 +82,7 @@ testsuite_teardown(void)
>  	dst = NULL;
>  	/* Ensure the dmadev is stopped. */
>  	rte_dma_stop(test_dev_id);
> +	rte_dma_stats_reset(test_dev_id, RTE_DMA_ALL_VCHAN);
>  
>  	rte_log_set_level_pattern("lib.dmadev", RTE_LOG_INFO);
>  }
>
  
Thomas Monjalon March 15, 2024, 12:34 p.m. UTC | #2
12/03/2024 02:29, fengchengwen:
> It's not a bugfix, but a best practice for test (clean state before continuing).
> 
> The other is LGTM,
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> 
> 
> On 2024/3/11 23:25, Kevin Laatz wrote:
> > The API testsuite previously only used the dmadev skeleton. Now that real
> > devices are being used for the API tests, the DMA stats need to be reset
> > during testsuite teardown to ensure a known, clean state before continuing.
> > 
> > Fixes: 14b477ed1740 ("test/dma: use unit test framework")
> > 
> > Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>

Applied, thanks.
  

Patch

diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c
index a130e74b51..d40c05cfbf 100644
--- a/app/test/test_dmadev_api.c
+++ b/app/test/test_dmadev_api.c
@@ -82,6 +82,7 @@  testsuite_teardown(void)
 	dst = NULL;
 	/* Ensure the dmadev is stopped. */
 	rte_dma_stop(test_dev_id);
+	rte_dma_stats_reset(test_dev_id, RTE_DMA_ALL_VCHAN);
 
 	rte_log_set_level_pattern("lib.dmadev", RTE_LOG_INFO);
 }