DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	kevin.laatz@intel.com, stable@dpdk.org,
	Chengwen Feng <fengchengwen@huawei.com>,
	Conor Walsh <conor.walsh@intel.com>
Subject: [PATCH 1/3] app/test: fix missing checks for DMA device capacity
Date: Wed, 16 Feb 2022 16:06:07 +0000	[thread overview]
Message-ID: <20220216160610.475242-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20220216160610.475242-1-bruce.richardson@intel.com>

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(-)

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


  reply	other threads:[~2022-02-16 16:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 16:06 [PATCH 0/3] idxd driver update fixes Bruce Richardson
2022-02-16 16:06 ` Bruce Richardson [this message]
2022-02-17 12:02   ` [PATCH 1/3] app/test: fix missing checks for DMA device capacity Walsh, Conor
2022-02-17 17:48   ` Kevin Laatz
2022-02-16 16:06 ` [PATCH 2/3] dma/idxd: configure max batch size to high value Bruce Richardson
2022-02-17 17:48   ` Kevin Laatz
2022-02-16 16:06 ` [PATCH 3/3] doc/dmadev/idxd: improve configuration examples Bruce Richardson
2022-02-17 17:48   ` Kevin Laatz
2022-02-23 15:48 ` [PATCH 0/3] idxd driver update fixes Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220216160610.475242-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=kevin.laatz@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).