[PATCH 1/3] app/test: fix missing checks for DMA device capacity

Bruce Richardson bruce.richardson at intel.com
Wed Feb 16 17:06:07 CET 2022


For some DMA HW devices, e.g. those using the idxd driver, the maximum
burst size is configurable, which can lead to test failures if the value
is set too small. Add explicit check for this to give reasonable error
messages for devices which need their config adjusted.

Fixes: 1b86a66a30c2 ("test/dma: add more comprehensive copy tests")
Fixes: 8fa5d2683940 ("test/dma: add burst capacity test")
Cc: kevin.laatz at intel.com
Cc: stable at dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 app/test/test_dmadev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
index db5aff701c..2b097e0f47 100644
--- a/app/test/test_dmadev.c
+++ b/app/test/test_dmadev.c
@@ -775,6 +775,9 @@ test_dmadev_instance(int16_t dev_id)
 	if (rte_dma_stats_get(dev_id, vchan, &stats) != 0)
 		ERR_RETURN("Error with rte_dma_stats_get()\n");
 
+	if (rte_dma_burst_capacity(dev_id, vchan) < 32)
+		ERR_RETURN("Error: Device does not have sufficient burst capacity to run tests");
+
 	if (stats.completed != 0 || stats.submitted != 0 || stats.errors != 0)
 		ERR_RETURN("Error device stats are not all zero: completed = %"PRIu64", "
 				"submitted = %"PRIu64", errors = %"PRIu64"\n",
@@ -796,7 +799,10 @@ test_dmadev_instance(int16_t dev_id)
 		goto err;
 
 	/* run some burst capacity tests */
-	if (runtest("burst capacity", test_burst_capacity, 1, dev_id, vchan, CHECK_ERRS) < 0)
+	if (rte_dma_burst_capacity(dev_id, vchan) < 64)
+		printf("DMA Dev %u: insufficient burst capacity (64 required), skipping tests\n",
+				dev_id);
+	else if (runtest("burst capacity", test_burst_capacity, 1, dev_id, vchan, CHECK_ERRS) < 0)
 		goto err;
 
 	/* to test error handling we can provide null pointers for source or dest in copies. This
-- 
2.32.0



More information about the dev mailing list