Skip to contentSkip to conversation

test/event_crypto_adapter: fix conf issue

PATCH In review Abhinandan Gujjar 1 participant 2 messages Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/event_crypto_adapter: fix conf issue

This patch updates the xform with right configuration. For session based ops, sym session pool is created with valid userdata size.

---
 app/test/test_event_crypto_adapter.c | 24 +++++-------------------
 drivers/crypto/meson.build           | 12 ++++++------
 2 files changed, 11 insertions(+), 25 deletions(-)
app/test/test_event_crypto_adapter.c +5 -19
index 8d42462..530ce96 100644
@@ -171,7 +171,6 @@ struct rte_event_crypto_request request_info = {
 	struct rte_event ev;
 	uint32_t cap;
 	int ret;
-	uint8_t cipher_key[17];
 
 	memset(&m_data, 0, sizeof(m_data));
 
@@ -183,14 +182,7 @@ struct rte_event_crypto_request request_info = {
 	/* Setup Cipher Parameters */
 	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cipher_xform.next = NULL;
-
-	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	cipher_xform.cipher.key.data = cipher_key;
-	cipher_xform.cipher.key.length = 16;
-	cipher_xform.cipher.iv.offset = IV_OFFSET;
-	cipher_xform.cipher.iv.length = 16;
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
 
 	op = rte_crypto_op_alloc(params.op_mpool,
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@@ -378,7 +370,6 @@ struct rte_event_crypto_request request_info = {
 	struct rte_mbuf *m;
 	uint32_t cap;
 	int ret;
-	uint8_t cipher_key[17];
 
 	memset(&m_data, 0, sizeof(m_data));
 
@@ -390,14 +381,7 @@ struct rte_event_crypto_request request_info = {
 	/* Setup Cipher Parameters */
 	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cipher_xform.next = NULL;
-
-	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	cipher_xform.cipher.key.data = cipher_key;
-	cipher_xform.cipher.key.length = 16;
-	cipher_xform.cipher.iv.offset = IV_OFFSET;
-	cipher_xform.cipher.iv.length = 16;
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
 
 	op = rte_crypto_op_alloc(params.op_mpool,
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@@ -564,7 +548,9 @@ struct rte_event_crypto_request request_info = {
 
 	params.session_mpool = rte_cryptodev_sym_session_pool_create(
 			"CRYPTO_ADAPTER_SESSION_MP",
-			MAX_NB_SESSIONS, 0, 0, 0, SOCKET_ID_ANY);
+			MAX_NB_SESSIONS, 0, 0,
+			sizeof(union rte_event_crypto_metadata),
+			SOCKET_ID_ANY);
 	TEST_ASSERT_NOT_NULL(params.session_mpool,
 			"session mempool allocation failed\n");
 
drivers/crypto/meson.build +6 -6
index a242350..149a8e1 100644
@@ -5,14 +5,14 @@ if is_windows
 	subdir_done()
 endif
 
-drivers = ['aesni_gcm',
-	   'aesni_mb',
+drivers = [#'aesni_gcm',
+	   #'aesni_mb',
 	   'armv8',
 	   'caam_jr',
 	   'ccp',
 	   'dpaa_sec',
 	   'dpaa2_sec',
-	   'kasumi',
+	  # 'kasumi',
 	   'mvsam',
 	   'nitrox',
 	   'null',
@@ -21,9 +21,9 @@ drivers = ['aesni_gcm',
 	   'openssl',
 	   'qat',
 	   'scheduler',
-	   'snow3g',
-	   'virtio',
-	   'zuc']
+	   #'snow3g',
+	   'virtio']
+	   #'zuc']
 
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
Signature · 1 line
1.9.1
#1 lore raw

Please disregard the patch. Didn't realizes commented changes for meson.

Quoted 119 lines

-----Original Message-----
From: Gujjar, Abhinandan S <[email protected]>
Sent: Thursday, September 17, 2020 6:28 AM
To: [email protected]; [email protected]
Cc: Vangati, Narender <[email protected]>; Gujjar, Abhinandan S <[email protected]>
Subject: [PATCH] test/event_crypto_adapter: fix conf issue

This patch updates the xform with right configuration.
For session based ops, sym session pool is created with valid userdata size.

---
 app/test/test_event_crypto_adapter.c | 24 +++++-------------------
 drivers/crypto/meson.build           | 12 ++++++------
 2 files changed, 11 insertions(+), 25 deletions(-)
app/test/test_event_crypto_adapter.c +5 -19
index 8d42462..530ce96 100644
@@ -171,7 +171,6 @@ struct rte_event_crypto_request request_info = {
 	struct rte_event ev;
 	uint32_t cap;
 	int ret;
-	uint8_t cipher_key[17];
 
 	memset(&m_data, 0, sizeof(m_data));
 
@@ -183,14 +182,7 @@ struct rte_event_crypto_request request_info = {
 	/* Setup Cipher Parameters */
 	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cipher_xform.next = NULL;
-
-	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	cipher_xform.cipher.key.data = cipher_key;
-	cipher_xform.cipher.key.length = 16;
-	cipher_xform.cipher.iv.offset = IV_OFFSET;
-	cipher_xform.cipher.iv.length = 16;
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
 
 	op = rte_crypto_op_alloc(params.op_mpool,
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@@ -378,7 +370,6 @@ struct rte_event_crypto_request request_info = {
 	struct rte_mbuf *m;
 	uint32_t cap;
 	int ret;
-	uint8_t cipher_key[17];
 
 	memset(&m_data, 0, sizeof(m_data));
 
@@ -390,14 +381,7 @@ struct rte_event_crypto_request request_info = {
 	/* Setup Cipher Parameters */
 	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cipher_xform.next = NULL;
-
-	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	cipher_xform.cipher.key.data = cipher_key;
-	cipher_xform.cipher.key.length = 16;
-	cipher_xform.cipher.iv.offset = IV_OFFSET;
-	cipher_xform.cipher.iv.length = 16;
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
 
 	op = rte_crypto_op_alloc(params.op_mpool,
 			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@@ -564,7 +548,9 @@ struct rte_event_crypto_request request_info = {
 
 	params.session_mpool = rte_cryptodev_sym_session_pool_create(
 			"CRYPTO_ADAPTER_SESSION_MP",
-			MAX_NB_SESSIONS, 0, 0, 0, SOCKET_ID_ANY);
+			MAX_NB_SESSIONS, 0, 0,
+			sizeof(union rte_event_crypto_metadata),
+			SOCKET_ID_ANY);
 	TEST_ASSERT_NOT_NULL(params.session_mpool,
 			"session mempool allocation failed\n");
 
drivers/crypto/meson.build index renamed from drivers/crypto/meson.build +0 -0

a242350..149a8e1 100644

drivers/crypto/meson.build +6 -6
@@ -5,14 +5,14 @@ if is_windows
 	subdir_done()
 endif
 
-drivers = ['aesni_gcm',
-	   'aesni_mb',
+drivers = [#'aesni_gcm',
+	   #'aesni_mb',
 	   'armv8',
 	   'caam_jr',
 	   'ccp',
 	   'dpaa_sec',
 	   'dpaa2_sec',
-	   'kasumi',
+	  # 'kasumi',
 	   'mvsam',
 	   'nitrox',
 	   'null',
@@ -21,9 +21,9 @@ drivers = ['aesni_gcm',
 	   'openssl',
 	   'qat',
 	   'scheduler',
-	   'snow3g',
-	   'virtio',
-	   'zuc']
+	   #'snow3g',
+	   'virtio']
+	   #'zuc']
 
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps

config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
--
1.9.1