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 DB1B0A04AE; Tue, 5 May 2020 00:20:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA9011D5B7; Tue, 5 May 2020 00:19:34 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id EF89C1D5B4 for ; Tue, 5 May 2020 00:19:33 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D432C1A04FF; Tue, 5 May 2020 00:19:33 +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 DA2591A04E5; Tue, 5 May 2020 00:19:27 +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 A5C5740302; Tue, 5 May 2020 06:19:17 +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 Date: Tue, 5 May 2020 03:28:08 +0530 Message-Id: <20200504215811.15951-7-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 6/9] test/crypto: run PDCP cases if supported 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" cryptodevs which support rte_security PDCP protocol, can run all PDCP cases if it sets a feature flag RTE_CRYPTODEV_FF_SECURITY. Previously, only dpaa2_sec and dpaa_sec test suites were running these tests. Now it is moved to generic test suite with a check on the feature flag and the case will be skipped if it is not supported by the PMD. Signed-off-by: Akhil Goyal --- app/test/test_cryptodev.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index d86bdbf8e..b2b215737 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -7719,6 +7719,34 @@ test_PDCP_PROTO_SGL_oop_128B_32B(void) pdcp_test_data_in_len[i]+4, 128, 32); } + +static int +test_PDCP_PROTO_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + struct rte_cryptodev_info dev_info; + int status; + + 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_SECURITY)) + return -ENOTSUP; + + status = test_PDCP_PROTO_cplane_encap_all(); + status += test_PDCP_PROTO_cplane_decap_all(); + status += test_PDCP_PROTO_uplane_encap_all(); + status += test_PDCP_PROTO_uplane_decap_all(); + status += test_PDCP_PROTO_SGL_in_place_32B(); + status += test_PDCP_PROTO_SGL_oop_32B_128B(); + status += test_PDCP_PROTO_SGL_oop_32B_40B(); + status += test_PDCP_PROTO_SGL_oop_128B_32B(); + + if (status) + return TEST_FAILED; + else + return TEST_SUCCESS; +} #endif static int @@ -12379,6 +12407,10 @@ static struct unit_test_suite cryptodev_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_verify_auth_aes_cmac_cipher_null_test_case_1), +#ifdef RTE_LIBRTE_SECURITY + TEST_CASE_ST(ut_setup, ut_teardown, + test_PDCP_PROTO_all), +#endif TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.17.1