From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEE0C433E0 for ; Fri, 15 May 2020 07:34:23 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id B172920657 for ; Fri, 15 May 2020 07:34:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B172920657 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02C431DA64; Fri, 15 May 2020 09:34:22 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 35C181DA5F for ; Fri, 15 May 2020 09:34:20 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CEE2B1A05F7; Fri, 15 May 2020 09:34:19 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3DE621A062E; Fri, 15 May 2020 09:34:14 +0200 (CEST) Received: from lsv03186.swis.in-blr01.nxp.com (lsv03186.swis.in-blr01.nxp.com [92.120.146.182]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D47A5402DF; Fri, 15 May 2020 15:34:07 +0800 (SGT) From: Apeksha Gupta To: dev@dpdk.org Cc: Ruifeng.Wang@arm.com, declan.doherty@intel.com, asomalap@amd.com, anoobj@marvell.com, roy.fan.zhang@intel.com, fiona.trahe@intel.com, rnagadheeraj@marvell.com, adwivedi@marvell.com, jianjay.zhou@huawei.com, pablo.de.lara.guarch@intel.com, adamx.dybkowski@intel.com, akhil.goyal@nxp.com, Apeksha Gupta Date: Fri, 15 May 2020 13:02:42 +0530 Message-Id: <20200515073242.24720-1-apeksha.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2] Test/crypto: check valid test_stats before running test 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" Test_stats is an optional cryptodev op and if it is not defined by the PMD, it should not run the test cases for it. Signed-off-by: Apeksha Gupta --- app/test/test_cryptodev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index c624018ee..1ad650675 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -8801,6 +8801,10 @@ test_stats(void) if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) return -ENOTSUP; + dev = &rte_cryptodevs[ts_params->valid_devs[0]]; + if (dev->dev_ops->stats_get == 0) + return -ENOTSUP; + /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; @@ -8820,7 +8824,6 @@ test_stats(void) "rte_cryptodev_stats_get invalid dev failed"); TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], 0) != 0), "rte_cryptodev_stats_get invalid Param failed"); - dev = &rte_cryptodevs[ts_params->valid_devs[0]]; temp_pfn = dev->dev_ops->stats_get; dev->dev_ops->stats_get = (cryptodev_stats_get_t)0; TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats) -- 2.17.1