[v4,2/2] test/crypto: Add AES-256 DOCSIS test vectors

Message ID 1586531010-32279-2-git-send-email-mairtin.oloingsigh@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series [v3] crypto/aesni_mb: support DOCSIS AES-256 |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Mairtin o Loingsigh April 10, 2020, 3:03 p.m. UTC
  This patch adds test vectors for AES-256 and sets AESNI-MB as the
target PMD

Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Acked-by: Pablo de Lara <Pablo.de.lara.guarch@intel.com>
---
v2: Remove duplicate code
---
 app/test/test_cryptodev_aes_test_vectors.h | 81 ++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
  

Comments

Thomas Monjalon April 12, 2020, 4:43 p.m. UTC | #1
10/04/2020 17:03, Mairtin o Loingsigh:
> This patch adds test vectors for AES-256 and sets AESNI-MB as the
> target PMD

There is really something wrong in the cryptodev API.
Why the PMD must be selected in the tests?
Isn't there some capabilities in cryptodev?
Whitelisting PMD in the test prevents testing capabilities API.

It looks the required refactoring is not progressing enough.
I suggest blocking all crypto-related patches until is is fixed.
  
De Lara Guarch, Pablo April 14, 2020, 8:49 a.m. UTC | #2
Hi Thomas,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Sunday, April 12, 2020 5:44 PM
> To: dev@dpdk.org; akhil.goyal@nxp.com
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; O'loingsigh,
> Mairtin <mairtin.oloingsigh@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; Dybkowski, AdamX
> <adamx.dybkowski@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 2/2] test/crypto: Add AES-256 DOCSIS test
> vectors
> 
> 10/04/2020 17:03, Mairtin o Loingsigh:
> > This patch adds test vectors for AES-256 and sets AESNI-MB as the
> > target PMD
> 
> There is really something wrong in the cryptodev API.
> Why the PMD must be selected in the tests?
> Isn't there some capabilities in cryptodev?
> Whitelisting PMD in the test prevents testing capabilities API.
> 
> It looks the required refactoring is not progressing enough.
> I suggest blocking all crypto-related patches until is is fixed.
> 

You are right, but Mairtin was following the same approach as it was taken previously.
I agree that this approach is not the best one and we are currently working
on a better solution.

Thanks,
Pablo
  
Thomas Monjalon April 14, 2020, 9:06 a.m. UTC | #3
14/04/2020 10:49, De Lara Guarch, Pablo:
> From: Thomas Monjalon
> > 10/04/2020 17:03, Mairtin o Loingsigh:
> > > This patch adds test vectors for AES-256 and sets AESNI-MB as the
> > > target PMD
> > 
> > There is really something wrong in the cryptodev API.
> > Why the PMD must be selected in the tests?
> > Isn't there some capabilities in cryptodev?
> > Whitelisting PMD in the test prevents testing capabilities API.
> > 
> > It looks the required refactoring is not progressing enough.
> > I suggest blocking all crypto-related patches until is is fixed.
> > 
> 
> You are right, but Mairtin was following the same approach as it was taken previously.

I know. His patch was accepted.

> I agree that this approach is not the best one and we are currently working
> on a better solution.

Now that's clear, let's not merge any new crypto patch until
the capabilities are working and tested.
  

Patch

diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h
index 08ae09390..df338756f 100644
--- a/app/test/test_cryptodev_aes_test_vectors.h
+++ b/app/test/test_cryptodev_aes_test_vectors.h
@@ -5,6 +5,15 @@ 
 #ifndef TEST_CRYPTODEV_AES_TEST_VECTORS_H_
 #define TEST_CRYPTODEV_AES_TEST_VECTORS_H_
 
+#ifdef RTE_LIBRTE_PMD_AESNI_MB
+#include <intel-ipsec-mb.h>
+#endif
+
+#if !defined(IMB_VERSION_NUM)
+#define IMB_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+#define IMB_VERSION_NUM IMB_VERSION(0, 49, 0)
+#endif
+
 /* test vectors */
 static const uint8_t plaintext_aes128ctr[] = {
 	0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96,
@@ -2739,79 +2748,151 @@  static const struct blockcipher_test_case aes_docsis_test_cases[] = {
 		.test_descr = "AES-256-DOCSIS-BPI Full Block Encryption",
 		.test_data = &aes_test_data_docsis_4,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI Runt Block Encryption",
 		.test_data = &aes_test_data_docsis_5,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI Uneven Encryption",
 		.test_data = &aes_test_data_docsis_6,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI Full Block Decryption",
 		.test_data = &aes_test_data_docsis_4,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI Runt Block Decryption",
 		.test_data = &aes_test_data_docsis_5,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI Uneven Decryption",
 		.test_data = &aes_test_data_docsis_6,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Full Block Encryption",
 		.test_data = &aes_test_data_docsis_4,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Runt Block Encryption",
 		.test_data = &aes_test_data_docsis_5,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Uneven Block Encryption",
 		.test_data = &aes_test_data_docsis_6,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Full Block Decryption",
 		.test_data = &aes_test_data_docsis_4,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Runt Block Decryption",
 		.test_data = &aes_test_data_docsis_5,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 	{
 		.test_descr = "AES-256-DOCSIS-BPI OOP Uneven Block Decryption",
 		.test_data = &aes_test_data_docsis_6,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP,
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 53, 3)
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MB
+#else
+
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+#endif
 	},
 };
 #endif /* TEST_CRYPTODEV_AES_TEST_VECTORS_H_ */