]> git.droids-corp.org - dpdk.git/commitdiff
test/dma: fix missing checks for device capacity
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 16 Feb 2022 16:06:07 +0000 (16:06 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 23 Feb 2022 15:30:18 +0000 (16:30 +0100)
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: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
app/test/test_dmadev.c

index db5aff701c1981f7918376371a8a0b5ba1de1f72..2b097e0f47571b41a5ae9338faaf247f36f9e99e 100644 (file)
@@ -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