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

Message ID 20220216160610.475242-2-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series idxd driver update fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Feb. 16, 2022, 4:06 p.m. UTC
  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@intel.com
Cc: stable@dpdk.org

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

Comments

Conor Walsh Feb. 17, 2022, 12:02 p.m. UTC | #1
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
  
Kevin Laatz Feb. 17, 2022, 5:48 p.m. UTC | #2
On 16/02/2022 16:06, Bruce Richardson wrote:
> 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@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   app/test/test_dmadev.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
  

Patch

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