From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68CECA04AF; Fri, 21 Aug 2020 18:00:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 331D71C0BF; Fri, 21 Aug 2020 18:00:06 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7252C1C0BC for ; Fri, 21 Aug 2020 18:00:04 +0200 (CEST) IronPort-SDR: 95BoUfQlwqfGEL6VFt1Fgca3XsKzheNVqg17LtZ6t4pirEGRiaDyXc9qtR4YApeapIbbisWnMf 4jriXXEayPQA== X-IronPort-AV: E=McAfee;i="6000,8403,9719"; a="173607845" X-IronPort-AV: E=Sophos;i="5.76,337,1592895600"; d="scan'208";a="173607845" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2020 09:00:04 -0700 IronPort-SDR: gLncLYx1zWVTgbgpchrgv3/zHfQAnvirbeVgvH0uWvCt7Djn8tfRLulm9VX8FPYY6jdT5j5O6c wT2yMLHuDeOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,337,1592895600"; d="scan'208";a="473094323" Received: from silpixa00399126.ir.intel.com ([10.237.222.56]) by orsmga005.jf.intel.com with ESMTP; 21 Aug 2020 09:00:02 -0700 From: Bruce Richardson To: Hemant Agrawal , Nipun Gupta Cc: dev@dpdk.org, Bruce Richardson Date: Fri, 21 Aug 2020 16:59:44 +0100 Message-Id: <20200821155945.29415-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200821155945.29415-1-bruce.richardson@intel.com> References: <20200821155945.29415-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/4] 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 --- 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