From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4381A034F; Mon, 19 Jul 2021 14:36:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A302F40E28; Mon, 19 Jul 2021 14:36:57 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3CD8F4068B for ; Mon, 19 Jul 2021 14:36:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10049"; a="190634509" X-IronPort-AV: E=Sophos;i="5.84,252,1620716400"; d="scan'208";a="190634509" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2021 05:36:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,252,1620716400"; d="scan'208";a="430835577" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by fmsmga007.fm.intel.com with ESMTP; 19 Jul 2021 05:36:53 -0700 From: Adam Dybkowski To: dev@dpdk.org, roy.fan.zhang@intel.com, gakhil@marvell.com Cc: Adam Dybkowski Date: Mon, 19 Jul 2021 13:37:18 +0100 Message-Id: <20210719123718.15960-1-adamx.dybkowski@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH v3] test/crypto: check if RAW API is supported X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch adds checking if RAW API is supported at the start of the test command "cryptodev_qat_raw_api_autotest". Signed-off-by: Adam Dybkowski Acked-by: Fan Zhang --- app/test/test_cryptodev.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 31201d93e1..43c05ed3d8 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -14766,7 +14766,39 @@ test_cryptodev_bcmfs(void) static int test_cryptodev_qat_raw_api(void) { - int ret; + static const char *pmd_name = RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD); + struct rte_cryptodev_info dev_info; + uint8_t i, nb_devs, found = 0; + int driver_id, ret; + + driver_id = rte_cryptodev_driver_id_get(pmd_name); + if (driver_id == -1) { + RTE_LOG(WARNING, USER1, "%s PMD must be loaded.\n", pmd_name); + return TEST_SKIPPED; + } + + nb_devs = rte_cryptodev_count(); + if (nb_devs < 1) { + RTE_LOG(WARNING, USER1, "No crypto devices found?\n"); + return TEST_SKIPPED; + } + + for (i = 0; i < nb_devs; i++) { + rte_cryptodev_info_get(i, &dev_info); + if (dev_info.driver_id == driver_id) { + if (!(dev_info.feature_flags & + RTE_CRYPTODEV_FF_SYM_RAW_DP)) { + RTE_LOG(INFO, USER1, "RAW API not supported\n"); + return TEST_SKIPPED; + } + found = 1; + break; + } + } + if (!found) { + RTE_LOG(INFO, USER1, "RAW API not supported\n"); + return TEST_SKIPPED; + } global_api_test_type = CRYPTODEV_RAW_API_TEST; ret = run_cryptodev_testsuite(RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)); -- 2.25.1