DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
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, G.Singh@nxp.com, hemant.agrawal@nxp.com,
	jianjay.zhou@huawei.com, pablo.de.lara.guarch@intel.com,
	adamx.dybkowski@intel.com, apeksha.gupta@nxp.com,
	Akhil Goyal <akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH v2 2/9] test/crypto: skip unsupported non-byte aligned cases
Date: Sun, 10 May 2020 04:42:10 +0530	[thread overview]
Message-ID: <20200509231217.8219-3-akhil.goyal@nxp.com> (raw)
In-Reply-To: <20200509231217.8219-1-akhil.goyal@nxp.com>

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 <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 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


  parent reply	other threads:[~2020-05-09 23:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 21:58 [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
2020-05-05  9:57   ` Trahe, Fiona
2020-05-05 10:12     ` Akhil Goyal
2020-05-05 12:04       ` Trahe, Fiona
2020-05-04 21:58 ` [dpdk-dev] [PATCH 2/9] test/crypto: skip unsupported non-byte aligned cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 5/9] test/crypto: skip unsupported session Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 8/9] test/crypto: remove QAT specific check Akhil Goyal
2020-05-04 21:58 ` [dpdk-dev] [PATCH 9/9] test/crypto: remove unused variable Akhil Goyal
2020-05-05 14:11 ` [dpdk-dev] [PATCH 0/9] test/crypto: code cleanup Dybkowski, AdamX
2020-05-08  8:55 ` Ruifeng Wang
2020-05-09 23:57   ` Akhil Goyal
2020-05-09 23:12 ` [dpdk-dev] [PATCH v2 " Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 1/9] cryptodev: add feature flag for non-byte aligned data Akhil Goyal
2020-05-11  9:29     ` Dybkowski, AdamX
2020-05-11 10:10       ` Akhil Goyal
2020-05-11  9:54     ` De Lara Guarch, Pablo
2020-05-11 10:05       ` Akhil Goyal
2020-05-11 14:40         ` De Lara Guarch, Pablo
2020-05-09 23:12   ` Akhil Goyal [this message]
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 3/9] test/crypto: skip unsupported SG cases Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 4/9] test/crypto: skip unsupported sessionless cases Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 5/9] test/crypto: skip unsupported session Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 6/9] test/crypto: run PDCP cases if supported Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 7/9] test/crypto: remove dpaaX_sec specific testsuites Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 8/9] test/crypto: remove QAT specific check Akhil Goyal
2020-05-09 23:12   ` [dpdk-dev] [PATCH v2 9/9] test/crypto: remove unused variable Akhil Goyal
2020-05-11  8:39   ` [dpdk-dev] [EXT] [PATCH v2 0/9] test/crypto: code cleanup Anoob Joseph

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200509231217.8219-3-akhil.goyal@nxp.com \
    --to=akhil.goyal@nxp.com \
    --cc=G.Singh@nxp.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=adamx.dybkowski@intel.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=apeksha.gupta@nxp.com \
    --cc=asomalap@amd.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=rnagadheeraj@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).