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 4D6C6A04AE; Tue, 5 May 2020 00:19:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E0C761D593; Tue, 5 May 2020 00:19:26 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id BCADC1D590 for ; Tue, 5 May 2020 00:19:25 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A0B9D2003DD; Tue, 5 May 2020 00:19:25 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 28AC82003EA; Tue, 5 May 2020 00:19:19 +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 E5EAD402AA; Tue, 5 May 2020 06:19:10 +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:04 +0530 Message-Id: <20200504215811.15951-3-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 2/9] test/crypto: skip unsupported non-byte aligned 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" Skipped the test cases for the PMDs which do not support RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA and subsequently removed the PMD specific checks for running that case. Signed-off-by: Apeksha Gupta Signed-off-by: Akhil Goyal --- app/test/test_cryptodev.c | 68 +++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 988e58b3a..df2c56c90 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2461,12 +2461,16 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata) unsigned plaintext_pad_len; unsigned plaintext_len; uint8_t *plaintext; + struct rte_cryptodev_info dev_info; - /* QAT PMD supports byte-aligned data only */ - if ((tdata->validAuthLenInBits.len % 8 != 0) && - (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_QAT_SYM_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_NON_BYTE_ALIGNED_DATA) && + ((tdata->validAuthLenInBits.len % 8) != 0)) { + printf("Device doesn't support NON-Byte Aligned Data.\n"); return -ENOTSUP; + } /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -2535,12 +2539,16 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata) unsigned plaintext_pad_len; unsigned plaintext_len; uint8_t *plaintext; + struct rte_cryptodev_info dev_info; + + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; - /* QAT PMD supports byte-aligned data only */ - if ((tdata->validAuthLenInBits.len % 8 != 0) && - (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)))) + if (!(feat_flags & RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA) && + ((tdata->validAuthLenInBits.len % 8) != 0)) { + printf("Device doesn't support NON-Byte Aligned Data.\n"); return -ENOTSUP; + } /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -3639,11 +3647,16 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata) uint32_t plaintext_pad_len; uint8_t extra_offset = 4; uint8_t *expected_ciphertext_shifted; + struct rte_cryptodev_info dev_info; - /* QAT PMD supports byte-aligned data only */ - if (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_QAT_SYM_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_NON_BYTE_ALIGNED_DATA) && + ((tdata->validDataLenInBits.len % 8) != 0)) { + printf("Device doesn't support NON-Byte Aligned Data.\n"); return -ENOTSUP; + } /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -3897,8 +3910,19 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata) unsigned int plaintext_pad_len; unsigned int plaintext_len; + struct rte_cryptodev_info dev_info; struct rte_cryptodev_sym_capability_idx cap_idx; + 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_NON_BYTE_ALIGNED_DATA) && + ((tdata->validAuthLenInBits.len % 8 != 0) || + (tdata->validDataLenInBits.len % 8 != 0))) { + printf("Device doesn't support NON-Byte Aligned Data.\n"); + return -ENOTSUP; + } + /* Check if device supports ZUC EEA3 */ cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3; @@ -5086,12 +5110,16 @@ test_zuc_authentication(const struct wireless_test_data *tdata) uint8_t *plaintext; struct rte_cryptodev_sym_capability_idx cap_idx; + struct rte_cryptodev_info dev_info; - /* QAT PMD supports byte-aligned data only */ - if ((tdata->validAuthLenInBits.len % 8 != 0) && - (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_QAT_SYM_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_NON_BYTE_ALIGNED_DATA) && + (tdata->validAuthLenInBits.len % 8 != 0)) { + printf("Device doesn't support NON-Byte Aligned Data.\n"); return -ENOTSUP; + } /* Check if device supports ZUC EIA3 */ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; @@ -6032,11 +6060,6 @@ test_zuc_hash_generate_test_case_6(void) static int test_zuc_hash_generate_test_case_7(void) { - /* This test is not for SW ZUC PMD */ - if (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_ZUC_PMD))) - return -ENOTSUP; - return test_zuc_authentication(&zuc_test_case_auth_2080b); } @@ -6061,11 +6084,6 @@ test_zuc_cipher_auth_test_case_2(void) static int test_zuc_auth_cipher_test_case_1(void) { - /* This test is not for SW ZUC PMD */ - if (gbl_driver_id == rte_cryptodev_driver_id_get( - RTE_STR(CRYPTODEV_NAME_ZUC_PMD))) - return -ENOTSUP; - return test_zuc_auth_cipher( &zuc_auth_cipher_test_case_1, IN_PLACE, 0); } -- 2.17.1