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 448CAA04AE; Tue, 5 May 2020 00:20:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFB8F1D5AE; Tue, 5 May 2020 00:19:32 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id C18641D5A2 for ; Tue, 5 May 2020 00:19:30 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A6BB71A04FF; Tue, 5 May 2020 00:19:30 +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 5B9AB1A04FB; Tue, 5 May 2020 00:19:24 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 53ECE402DB; Tue, 5 May 2020 06:19:14 +0800 (SGT) From: Akhil Goyal 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, tdu@semihalf.com, rnagadheeraj@marvell.com, adwivedi@marvell.com, G.Singh@nxp.com, hemant.agrawal@nxp.com, jianjay.zhou@huawei.com, pablo.de.lara.guarch@intel.com, Akhil Goyal , Apeksha Gupta Date: Tue, 5 May 2020 03:28:06 +0530 Message-Id: <20200504215811.15951-5-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200504215811.15951-1-akhil.goyal@nxp.com> References: <20200504215811.15951-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases 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" There were some PMD specific checks to skip the case if it is not supported. This patch checks the feature flag RTE_CRYPTODEV_FF_SYM_SESSIONLESS if PMD supports it or not. Signed-off-by: Apeksha Gupta Signed-off-by: Akhil Goyal --- app/test/test_cryptodev.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index c13f8f73f..e3df51985 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -8484,13 +8484,15 @@ test_authenticated_encryption_sessionless( uint8_t *ciphertext, *auth_tag; uint16_t plaintext_pad_len; uint8_t key[tdata->key.len + 1]; + struct rte_cryptodev_info dev_info; - /* This test is for AESNI MB and AESNI GCM PMDs only */ - if ((gbl_driver_id != rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) && - (gbl_driver_id != rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD)))) + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) { + printf("Device doesn't support Sessionless ops.\n"); return -ENOTSUP; + } /* not supported with CPU crypto */ if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) @@ -8584,13 +8586,15 @@ test_authenticated_decryption_sessionless( int retval; uint8_t *plaintext; uint8_t key[tdata->key.len + 1]; + struct rte_cryptodev_info dev_info; - /* This test is for AESNI MB and AESNI GCM PMDs only */ - if ((gbl_driver_id != rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) && - (gbl_driver_id != rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD)))) + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) { + printf("Device doesn't support Sessionless ops.\n"); return -ENOTSUP; + } /* not supported with CPU crypto */ if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) -- 2.17.1