From patchwork Thu Sep 10 16:47:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 77206 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1863A04B5; Thu, 10 Sep 2020 18:47:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DEAA1C116; Thu, 10 Sep 2020 18:47:33 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DE1941C114 for ; Thu, 10 Sep 2020 18:47:31 +0200 (CEST) IronPort-SDR: rLVDkoWT3GWwTCL6w89LZI8KfdQl88Uq/nempwLwbl+DkL4MlppboXynyG+N/nhJqM/iaHV2Fp 5xB+jEimhHhQ== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="243402255" X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="243402255" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 09:47:30 -0700 IronPort-SDR: BAwZmXBSEYbzTEI67ZT14tic8BduK1Iy2tBrSFlM5UvkugTMige5SkBv4EItc2P3mSF0Hs8I6g Qt548GzkDupA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="304939244" Received: from silpixa00399126.ir.intel.com ([10.237.222.27]) by orsmga006.jf.intel.com with ESMTP; 10 Sep 2020 09:47:29 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Thu, 10 Sep 2020 17:47:14 +0100 Message-Id: <20200910164716.1011901-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910164716.1011901-1-bruce.richardson@intel.com> References: <20200821155945.29415-1-bruce.richardson@intel.com> <20200910164716.1011901-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/3] raw/ioat: support multiple devices being tested X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The current selftest function uses a single global variable to track state which implies that only a single instance can have the selftest function called on it. Change this to an array to allow multiple instances to be tested. Signed-off-by: Bruce Richardson Reviewed-by: Kevin Laatz --- drivers/raw/ioat/ioat_rawdev_test.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c index c463a82ad6..e5b50ae9f4 100644 --- a/drivers/raw/ioat/ioat_rawdev_test.c +++ b/drivers/raw/ioat/ioat_rawdev_test.c @@ -8,10 +8,13 @@ #include "rte_rawdev.h" #include "rte_ioat_rawdev.h" +#define MAX_SUPPORTED_RAWDEVS 64 +#define TEST_SKIPPED 77 + int ioat_rawdev_test(uint16_t dev_id); /* pre-define to keep compiler happy */ static struct rte_mempool *pool; -static unsigned short expected_ring_size; +static unsigned short expected_ring_size[MAX_SUPPORTED_RAWDEVS]; static int test_enqueue_copies(int dev_id) @@ -148,10 +151,16 @@ ioat_rawdev_test(uint16_t dev_id) unsigned int nb_xstats; unsigned int i; + if (dev_id >= MAX_SUPPORTED_RAWDEVS) { + printf("Skipping test. Cannot test rawdevs with id's greater than %d\n", + MAX_SUPPORTED_RAWDEVS); + return TEST_SKIPPED; + } + rte_rawdev_info_get(dev_id, &info, sizeof(p)); - if (p.ring_size != expected_ring_size) { + if (p.ring_size != expected_ring_size[dev_id]) { printf("Error, initial ring size is not as expected (Actual: %d, Expected: %d)\n", - (int)p.ring_size, expected_ring_size); + (int)p.ring_size, expected_ring_size[dev_id]); return -1; } @@ -166,7 +175,7 @@ ioat_rawdev_test(uint16_t dev_id) IOAT_TEST_RINGSIZE, (int)p.ring_size); return -1; } - expected_ring_size = p.ring_size; + expected_ring_size[dev_id] = p.ring_size; if (rte_rawdev_start(dev_id) != 0) { printf("Error with rte_rawdev_start()\n"); From patchwork Thu Sep 10 16:47:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 77207 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A974A04B5; Thu, 10 Sep 2020 18:47:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACBC81C11D; Thu, 10 Sep 2020 18:47:39 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 91F521C11C for ; Thu, 10 Sep 2020 18:47:37 +0200 (CEST) IronPort-SDR: owbiN7vLxDenLKuqFZrGqlQApt69VEkjAz77GqDT59eNrqO2TgI7qNOS42tcMzkAEYPbFF1BmH Fb9jgrjrnxWQ== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="158618980" X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="158618980" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 09:47:36 -0700 IronPort-SDR: isJ7vemeCHB0ydkfHAm1tdzQM1Pt0nCk5+aJUOZepb55WyoDEL9C2jskF66AV5AbVZrI8XIw8E PzVx4lA7tDbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="304939284" Received: from silpixa00399126.ir.intel.com ([10.237.222.27]) by orsmga006.jf.intel.com with ESMTP; 10 Sep 2020 09:47:34 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Nipun Gupta , Hemant Agrawal , John McNamara , Marko Kovacevic Date: Thu, 10 Sep 2020 17:47:15 +0100 Message-Id: <20200910164716.1011901-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910164716.1011901-1-bruce.richardson@intel.com> References: <20200821155945.29415-1-bruce.richardson@intel.com> <20200910164716.1011901-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/3] app/test: change rawdev autotest to run selftest on all devs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Kevin Laatz --- app/test/test_rawdev.c | 34 ++++++++++++++++++++++++-- doc/guides/rel_notes/release_20_11.rst | 5 ++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c index d8d9595be1..7e2fb2cf27 100644 --- a/app/test/test_rawdev.c +++ b/app/test/test_rawdev.c @@ -14,8 +14,13 @@ 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 @@ -24,7 +29,32 @@ test_rawdev_selftest_skeleton(void) return test_rawdev_selftest_impl("rawdev_skeleton", ""); } -REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton); +static int +test_rawdev_selftests(void) +{ + const int count = rte_rawdev_count(); + int ret = 0; + int i; + + /* basic sanity on rawdev infrastructure */ + if (test_rawdev_selftest_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_selftests); static int test_rawdev_selftest_ioat(void) diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 667e3d54ad..2ac7dca9a0 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -93,6 +93,11 @@ API Changes and the function ``rte_rawdev_queue_conf_get()`` from ``void`` to ``int`` allowing the return of error codes from drivers. +* rawdev: The running of a drivers ``selftest()`` function can now be done + using the ``rawdev_autotest`` command in the ``dpdk-test`` binary. This + command now calls the self-test function for each rawdev found on the + system, and does not require a specific command per device type. + ABI Changes ----------- From patchwork Thu Sep 10 16:47:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 77208 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 675A0A04B5; Thu, 10 Sep 2020 18:47:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 79E3E1C126; Thu, 10 Sep 2020 18:47:41 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id DA87E1C120 for ; Thu, 10 Sep 2020 18:47:39 +0200 (CEST) IronPort-SDR: uzJPOMEVsld+Wl3fwnFe8hN33W5kYTgyIHdnHW58EIsoT6iqG/Nq1V59z/zZxcY6Kj9C2duKM+ O0kqhCIgib3A== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="158618997" X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="158618997" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 09:47:39 -0700 IronPort-SDR: Gl9q7SP39baj3XJDi5lcMOGg7hqKbRS5N1zjJcDJ0/zeS3FdKEU5s7rG5rK1vOUWDnnQPlDmwb lSDRFkwedUUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="304939292" Received: from silpixa00399126.ir.intel.com ([10.237.222.27]) by orsmga006.jf.intel.com with ESMTP; 10 Sep 2020 09:47:38 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Nipun Gupta , Hemant Agrawal , John McNamara , Marko Kovacevic Date: Thu, 10 Sep 2020 17:47:16 +0100 Message-Id: <20200910164716.1011901-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200910164716.1011901-1-bruce.richardson@intel.com> References: <20200821155945.29415-1-bruce.richardson@intel.com> <20200910164716.1011901-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/3] app/test: remove ioat-specific autotest X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since the rawdev autotest can now be used to test all rawdevs on the system, there is no need for a dedicated ioat autotest command. Signed-off-by: Bruce Richardson Reviewed-by: Kevin Laatz --- app/test/test_rawdev.c | 20 -------------------- doc/guides/rel_notes/release_20_11.rst | 2 ++ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c index 7e2fb2cf27..081fab969b 100644 --- a/app/test/test_rawdev.c +++ b/app/test/test_rawdev.c @@ -55,23 +55,3 @@ test_rawdev_selftests(void) } REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftests); - -static int -test_rawdev_selftest_ioat(void) -{ - const int count = rte_rawdev_count(); - int i; - - for (i = 0; i < count; i++) { - struct rte_rawdev_info info = { .dev_private = NULL }; - if (rte_rawdev_info_get(i, &info, 0) == 0 && - strstr(info.driver_name, "ioat") != NULL) - return rte_rawdev_selftest(i) == 0 ? - TEST_SUCCESS : TEST_FAILED; - } - - printf("No IOAT rawdev found, skipping tests\n"); - return TEST_SKIPPED; -} - -REGISTER_TEST_COMMAND(ioat_rawdev_autotest, test_rawdev_selftest_ioat); diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 2ac7dca9a0..0cec16b61d 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -97,6 +97,8 @@ API Changes using the ``rawdev_autotest`` command in the ``dpdk-test`` binary. This command now calls the self-test function for each rawdev found on the system, and does not require a specific command per device type. + Following this change, the ``ioat_rawdev_autotest`` command has been + removed as no longer needed. ABI Changes