DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>,
	Nipun Gupta <nipun.gupta@nxp.com>
Cc: dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 3/4] app/test: change rawdev autotest to run selftest on all devs
Date: Fri, 21 Aug 2020 16:59:44 +0100	[thread overview]
Message-ID: <20200821155945.29415-4-bruce.richardson@intel.com> (raw)
In-Reply-To: <20200821155945.29415-1-bruce.richardson@intel.com>

Rather than having each rawdev provide its own autotest command, we can
instead just use the generic rawdev_autotest to test any and all available
rawdevs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test_rawdev.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c
index d8d9595be1..0e25ccf8dc 100644
--- a/app/test/test_rawdev.c
+++ b/app/test/test_rawdev.c
@@ -14,14 +14,38 @@
 static int
 test_rawdev_selftest_impl(const char *pmd, const char *opts)
 {
+	int ret;
+
+	printf("\n### Test rawdev infrastructure using skeleton driver\n");
 	rte_vdev_init(pmd, opts);
-	return rte_rawdev_selftest(rte_rawdev_get_dev_id(pmd));
+	ret = rte_rawdev_selftest(rte_rawdev_get_dev_id(pmd));
+	rte_vdev_uninit(pmd);
+	return ret;
 }
 
 static int
 test_rawdev_selftest_skeleton(void)
 {
-	return test_rawdev_selftest_impl("rawdev_skeleton", "");
+	const int count = rte_rawdev_count();
+	int ret = 0;
+	int i;
+
+	/* basic sanity on rawdev infrastructure */
+	if (test_rawdev_selftest_impl("rawdev_skeleton", "") < 0)
+		return -1;
+
+	/* now run self-test on all rawdevs */
+	if (count > 0)
+		printf("\n### Run selftest on each available rawdev\n");
+	for (i = 0; i < count; i++) {
+		int result = rte_rawdev_selftest(i);
+		printf("Rawdev %u (%s) selftest: %s\n", i,
+				rte_rawdevs[i].name,
+				result == 0 ? "Passed" : "Failed");
+		ret |=  result;
+	}
+
+	return ret;
 }
 
 REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton);
-- 
2.25.1


  parent reply	other threads:[~2020-08-21 16:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 15:59 [dpdk-dev] [PATCH 0/4] simplify unit-testing of rawdevs Bruce Richardson
2020-08-21 15:59 ` [dpdk-dev] [PATCH 1/4] raw/ioat: support multiple devices being tested Bruce Richardson
2020-08-21 15:59 ` [dpdk-dev] [PATCH 2/4] raw/ioat: include extra info in error messages Bruce Richardson
2020-08-21 15:59 ` Bruce Richardson [this message]
2020-08-21 15:59 ` [dpdk-dev] [PATCH 4/4] app/test: remove ioat-specific autotest Bruce Richardson
2020-09-10 16:47 ` [dpdk-dev] [PATCH v2 0/3] simplify unit-testing of rawdevs Bruce Richardson
2020-09-10 16:47   ` [dpdk-dev] [PATCH v2 1/3] raw/ioat: support multiple devices being tested Bruce Richardson
2020-09-14 12:34     ` Laatz, Kevin
2020-09-10 16:47   ` [dpdk-dev] [PATCH v2 2/3] app/test: change rawdev autotest to run selftest on all devs Bruce Richardson
2020-09-14 12:28     ` Laatz, Kevin
2020-09-10 16:47   ` [dpdk-dev] [PATCH v2 3/3] app/test: remove ioat-specific autotest Bruce Richardson
2020-09-14 12:31     ` Laatz, Kevin
2020-10-06  7:28   ` [dpdk-dev] [PATCH v2 0/3] simplify unit-testing of rawdevs 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=20200821155945.29415-4-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=nipun.gupta@nxp.com \
    /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).