DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/6] Fixes and improvements in crypto unit tests
@ 2024-08-22  7:16 Anoob Joseph
  2024-08-22  7:16 ` [PATCH 1/6] test/crypto: add asserts to validate test lengths Anoob Joseph
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Enable larger packet sizes in TLS tests and add minor improvements in
crypto unit tests.

Anoob Joseph (6):
  test/crypto: add asserts to validate test lengths
  test/crypto: enable larger packet sizes with TLS
  test/crypto: remove redefinition
  test/crypto: remove unused macros
  test/crypto: start opening brace in new line
  test/crypto: free pools in teardown

 app/test/test_cryptodev.c                     | 35 ++++++-----
 app/test/test_cryptodev.h                     | 58 +++++++++++++++----
 app/test/test_cryptodev_aead_test_vectors.h   | 14 ++++-
 app/test/test_cryptodev_security_tls_record.h | 12 ++--
 app/test/test_security_proto.h                |  7 ++-
 5 files changed, 92 insertions(+), 34 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] test/crypto: add asserts to validate test lengths
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-08-22  7:16 ` [PATCH 2/6] test/crypto: enable larger packet sizes with TLS Anoob Joseph
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Add asserts to validate the max lengths set.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c                   |  2 +-
 app/test/test_cryptodev.h                   |  2 ++
 app/test/test_cryptodev_aead_test_vectors.h | 14 +++++++++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 0c445f9eae..9d8ca8f616 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -665,7 +665,7 @@ testsuite_setup(void)
 		/* Not already created so create */
 		ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
 				"CRYPTO_LARGE_MBUFPOOL",
-				1, 0, 0, UINT16_MAX,
+				1, 0, 0, LARGE_MBUF_SIZE,
 				rte_socket_id());
 		if (ts_params->large_mbuf_pool == NULL) {
 			RTE_LOG(ERR, USER1,
diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index fd9ea0dd81..af56145cdd 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -24,6 +24,8 @@
 #define MBUF_DATAPAYLOAD_SIZE		(4096 + DIGEST_BYTE_LENGTH_SHA512)
 #define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
 		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
+#define LARGE_MBUF_DATAPAYLOAD_SIZE	(UINT16_MAX - RTE_PKTMBUF_HEADROOM)
+#define LARGE_MBUF_SIZE			(RTE_PKTMBUF_HEADROOM + LARGE_MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
diff --git a/app/test/test_cryptodev_aead_test_vectors.h b/app/test/test_cryptodev_aead_test_vectors.h
index e9b0590048..73bfb8dad4 100644
--- a/app/test/test_cryptodev_aead_test_vectors.h
+++ b/app/test/test_cryptodev_aead_test_vectors.h
@@ -5,11 +5,23 @@
 #ifndef TEST_CRYPTODEV_AEAD_TEST_VECTORS_H_
 #define TEST_CRYPTODEV_AEAD_TEST_VECTORS_H_
 
+#include "test_cryptodev.h"
+
 #define GMAC_LARGE_PLAINTEXT_LENGTH		65344
-#define MAX_AAD_LENGTH				65536
+#define MAX_AAD_LENGTH				(65535 - RTE_PKTMBUF_HEADROOM)
 #define GCM_LARGE_AAD_LENGTH			65296
 #define AEAD_TEXT_MAX_LENGTH			8096
 
+static_assert(GMAC_LARGE_PLAINTEXT_LENGTH <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+	      "GMAC_LARGE_PLAINTEXT_LENGTH should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+static_assert(MAX_AAD_LENGTH <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+	      "MAX_AAD_LENGTH should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+static_assert(GCM_LARGE_AAD_LENGTH <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+	      "GCM_LARGE_AAD_LENGTH should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+static_assert(AEAD_TEXT_MAX_LENGTH <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+	      "AEAD_TEXT_MAX_LENGTH should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+
+
 static uint8_t gcm_aad_zero_text[MAX_AAD_LENGTH] = { 0 };
 
 static uint8_t gcm_aad_text[MAX_AAD_LENGTH] = {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] test/crypto: enable larger packet sizes with TLS
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
  2024-08-22  7:16 ` [PATCH 1/6] test/crypto: add asserts to validate test lengths Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-08-22  7:16 ` [PATCH 3/6] test/crypto: remove redefinition Anoob Joseph
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Enable larger packet sizes with TLS. Add wrapper for existing
create_segmented_mbuf() function to get allocations from both pools.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c                     | 13 +++++--
 app/test/test_cryptodev.h                     | 38 +++++++++++++++++++
 app/test/test_cryptodev_security_tls_record.h | 12 +++---
 app/test/test_security_proto.h                |  7 +++-
 4 files changed, 58 insertions(+), 12 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 9d8ca8f616..5444d82c50 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12139,12 +12139,13 @@ test_tls_record_proto_process(const struct tls_record_test_data td[],
 		}
 
 		/* Setup source mbuf payload */
-		ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, td[i].input_text.len,
-				nb_segs, 0);
+		ut_params->ibuf = create_segmented_mbuf_multi_pool(ts_params->mbuf_pool,
+				ts_params->large_mbuf_pool, td[i].input_text.len, nb_segs, 0);
 		pktmbuf_write(ut_params->ibuf, 0, td[i].input_text.len, td[i].input_text.data);
 		if (flags->out_of_place)
-			ut_params->obuf = create_segmented_mbuf(ts_params->mbuf_pool,
-					td[i].output_text.len, nb_segs, 0);
+			ut_params->obuf = create_segmented_mbuf_multi_pool(ts_params->mbuf_pool,
+					ts_params->large_mbuf_pool, td[i].output_text.len, nb_segs,
+					0);
 		else
 			ut_params->obuf = NULL;
 
@@ -12375,6 +12376,10 @@ test_tls_record_proto_all(const struct tls_record_test_flags *flags)
 		pass_cnt++;
 	}
 
+	if (flags->data_walkthrough)
+		printf("\t Min payload size: %d, Max payload size: %d\n",
+				TLS_RECORD_PLAINTEXT_MIN_LEN, max_payload_len);
+
 	if (pass_cnt > 0)
 		return TEST_SUCCESS;
 	else
diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index af56145cdd..c322f10b94 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -233,6 +233,44 @@ create_segmented_mbuf(struct rte_mempool *mbuf_pool, int pkt_len,
 	return NULL;
 }
 
+static inline struct rte_mbuf *
+create_segmented_mbuf_multi_pool(struct rte_mempool *mbuf_pool_small,
+		struct rte_mempool *mbuf_pool_large, int pkt_len, int nb_segs, uint8_t pattern)
+{
+	struct rte_mempool *mbuf_pool;
+	int max_seg_len, seg_len;
+
+	if (nb_segs < 1) {
+		printf("Number of segments must be 1 or more (is %d)\n", nb_segs);
+		return NULL;
+	}
+
+	if (pkt_len >= nb_segs)
+		seg_len = pkt_len / nb_segs;
+	else
+		seg_len = 1;
+
+	/* Determine max segment length */
+	max_seg_len = seg_len + pkt_len % nb_segs;
+
+	if (max_seg_len > LARGE_MBUF_DATAPAYLOAD_SIZE) {
+		printf("Segment size %d is too big\n", max_seg_len);
+		return NULL;
+	}
+
+	if (max_seg_len > MBUF_DATAPAYLOAD_SIZE)
+		mbuf_pool = mbuf_pool_large;
+	else
+		mbuf_pool = mbuf_pool_small;
+
+	if (mbuf_pool == NULL) {
+		printf("Invalid mbuf pool\n");
+		return NULL;
+	}
+
+	return create_segmented_mbuf(mbuf_pool, pkt_len, nb_segs, pattern);
+}
+
 int
 process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		struct rte_crypto_op *op, uint8_t is_cipher, uint8_t is_auth,
diff --git a/app/test/test_cryptodev_security_tls_record.h b/app/test/test_cryptodev_security_tls_record.h
index e4a291c153..a98cea24f6 100644
--- a/app/test/test_cryptodev_security_tls_record.h
+++ b/app/test/test_cryptodev_security_tls_record.h
@@ -11,32 +11,32 @@
 #include "test_security_proto.h"
 
 /* TLS 1.2 Ciphertext length can be up to (2^14 + 2048 + 5 (TLS Header)) Bytes */
-#define TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN  (4096u)
+#define TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN  (18437u)
 static_assert(TLS_1_2_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
 	      "TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
 /* TLS 1.2 Plaintext length can be up to (2^14 + 1024) Bytes */
-#define TLS_1_2_RECORD_PLAINTEXT_MAX_LEN   (3072u)
+#define TLS_1_2_RECORD_PLAINTEXT_MAX_LEN   (17408u)
 static_assert(TLS_1_2_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
 	      "TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
 /* DTLS 1.2 Ciphertext length is similar to TLS 1.2 */
-#define DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (4096u)
+#define DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN (18437u)
 static_assert(DTLS_1_2_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
 	      "TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
 /* DTLS 1.2 Plaintext length is similar to TLS 1.2 */
-#define DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN  (3072u)
+#define DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN  (17408u)
 static_assert(DTLS_1_2_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
 	      "TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
 /* TLS 1.3 Ciphertext length can be up to (2^14 + 256 + 5 (TLS Header)) Bytes */
-#define TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN  (4096u)
+#define TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN  (16645u)
 static_assert(TLS_1_3_RECORD_CIPHERTEXT_MAX_LEN <= TEST_SEC_CIPHERTEXT_MAX_LEN,
 	      "TEST_SEC_CIPHERTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
 /* TLS 1.3 Plaintext length can be up to 2^14 Bytes */
-#define TLS_1_3_RECORD_PLAINTEXT_MAX_LEN   (3072u)
+#define TLS_1_3_RECORD_PLAINTEXT_MAX_LEN   (16384u)
 static_assert(TLS_1_3_RECORD_PLAINTEXT_MAX_LEN <= TEST_SEC_CLEARTEXT_MAX_LEN,
 	      "TEST_SEC_CLEARTEXT_MAX_LEN should be at least RECORD MAX LEN!");
 
diff --git a/app/test/test_security_proto.h b/app/test/test_security_proto.h
index 7eb815604a..8acb0fecca 100644
--- a/app/test/test_security_proto.h
+++ b/app/test/test_security_proto.h
@@ -10,10 +10,13 @@
 
 #include "test_cryptodev.h"
 
-#define TEST_SEC_CLEARTEXT_MAX_LEN  (MBUF_DATAPAYLOAD_SIZE - 1024)
-#define TEST_SEC_CIPHERTEXT_MAX_LEN (MBUF_DATAPAYLOAD_SIZE)
+#define TEST_SEC_CLEARTEXT_MAX_LEN  17408u
+#define TEST_SEC_CIPHERTEXT_MAX_LEN 18437u
 #define TEST_SEC_PKTS_MAX 32
 
+static_assert(TEST_SEC_CIPHERTEXT_MAX_LEN <= LARGE_MBUF_DATAPAYLOAD_SIZE,
+	      "TEST_SEC_CIPHERTEXT_MAX_LEN should not be greater than LARGE_MBUF_DATAPAYLOAD_SIZE");
+
 struct crypto_param {
 	enum rte_crypto_sym_xform_type type;
 	union {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] test/crypto: remove redefinition
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
  2024-08-22  7:16 ` [PATCH 1/6] test/crypto: add asserts to validate test lengths Anoob Joseph
  2024-08-22  7:16 ` [PATCH 2/6] test/crypto: enable larger packet sizes with TLS Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-08-22  7:16 ` [PATCH 4/6] test/crypto: remove unused macros Anoob Joseph
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Remove redefinition of TRUE & FALSE. These are defined by stdbool. Can
use the same.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 5 +++--
 app/test/test_cryptodev.h | 3 ---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 5444d82c50..169e2f3b48 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -3,6 +3,7 @@
  * Copyright 2020 NXP
  */
 
+#include <stdbool.h>
 #include <time.h>
 
 #include <rte_common.h>
@@ -796,7 +797,7 @@ check_capabilities_supported(enum rte_crypto_sym_xform_type type,
 		const int *algs, uint16_t num_algs)
 {
 	uint8_t dev_id = testsuite_params.valid_devs[0];
-	bool some_alg_supported = FALSE;
+	bool some_alg_supported = false;
 	uint16_t i;
 
 	for (i = 0; i < num_algs && !some_alg_supported; i++) {
@@ -805,7 +806,7 @@ check_capabilities_supported(enum rte_crypto_sym_xform_type type,
 		};
 		if (rte_cryptodev_sym_capability_get(dev_id,
 				&alg) != NULL)
-			some_alg_supported = TRUE;
+			some_alg_supported = true;
 	}
 	if (!some_alg_supported)
 		return TEST_SKIPPED;
diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index c322f10b94..e00c9866c3 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -8,9 +8,6 @@
 
 #define HEX_DUMP 0
 
-#define FALSE                           0
-#define TRUE                            1
-
 #define MAX_NUM_OPS_INFLIGHT            (4096)
 #define MIN_NUM_OPS_INFLIGHT            (128)
 #define DEFAULT_NUM_OPS_INFLIGHT        (128)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] test/crypto: remove unused macros
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
                   ` (2 preceding siblings ...)
  2024-08-22  7:16 ` [PATCH 3/6] test/crypto: remove redefinition Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-08-22  7:16 ` [PATCH 5/6] test/crypto: start opening brace in new line Anoob Joseph
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

The macros are not used. Remove the same.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 2 --
 app/test/test_cryptodev.h | 5 -----
 2 files changed, 7 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 169e2f3b48..1491ff03ba 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -65,8 +65,6 @@
 #define VDEV_ARGS_SIZE 100
 #define MAX_NB_SESSIONS 4
 
-#define MAX_DRV_SERVICE_CTX_SIZE 256
-
 #define MAX_RAW_DEQUEUE_COUNT	65535
 
 #define IN_PLACE 0
diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index e00c9866c3..c56ef2fe3f 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -6,15 +6,10 @@
 
 #include <rte_cryptodev.h>
 
-#define HEX_DUMP 0
-
 #define MAX_NUM_OPS_INFLIGHT            (4096)
 #define MIN_NUM_OPS_INFLIGHT            (128)
 #define DEFAULT_NUM_OPS_INFLIGHT        (128)
 
-#define MAX_NUM_QPS_PER_QAT_DEVICE      (2)
-#define DEFAULT_NUM_QPS_PER_QAT_DEVICE  (2)
-#define DEFAULT_BURST_SIZE              (64)
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (256)
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] test/crypto: start opening brace in new line
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
                   ` (3 preceding siblings ...)
  2024-08-22  7:16 ` [PATCH 4/6] test/crypto: remove unused macros Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-08-22  7:16 ` [PATCH 6/6] test/crypto: free pools in teardown Anoob Joseph
  2024-09-18  5:36 ` [PATCH 0/6] Fixes and improvements in crypto unit tests Akhil Goyal
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Start opening brace of the function body in new line as suggested in
coding guideline.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index c56ef2fe3f..b479ab8a2a 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -144,7 +144,8 @@ pktmbuf_write(struct rte_mbuf *mbuf, int offset, int len, const uint8_t *buffer)
 }
 
 static inline uint8_t *
-pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
+pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset)
+{
 	struct rte_mbuf *m;
 
 	for (m = mbuf; (m != NULL) && (offset > m->data_len); m = m->next)
@@ -158,7 +159,8 @@ pktmbuf_mtod_offset(struct rte_mbuf *mbuf, int offset) {
 }
 
 static inline rte_iova_t
-pktmbuf_iova_offset(struct rte_mbuf *mbuf, int offset) {
+pktmbuf_iova_offset(struct rte_mbuf *mbuf, int offset)
+{
 	struct rte_mbuf *m;
 
 	for (m = mbuf; (m != NULL) && (offset > m->data_len); m = m->next)
@@ -173,8 +175,8 @@ pktmbuf_iova_offset(struct rte_mbuf *mbuf, int offset) {
 
 static inline struct rte_mbuf *
 create_segmented_mbuf(struct rte_mempool *mbuf_pool, int pkt_len,
-		int nb_segs, uint8_t pattern) {
-
+		int nb_segs, uint8_t pattern)
+{
 	struct rte_mbuf *m = NULL, *mbuf = NULL;
 	int size, t_len, data_len = 0;
 	uint8_t *dst;
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] test/crypto: free pools in teardown
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
                   ` (4 preceding siblings ...)
  2024-08-22  7:16 ` [PATCH 5/6] test/crypto: start opening brace in new line Anoob Joseph
@ 2024-08-22  7:16 ` Anoob Joseph
  2024-09-18  5:36 ` [PATCH 0/6] Fixes and improvements in crypto unit tests Akhil Goyal
  6 siblings, 0 replies; 8+ messages in thread
From: Anoob Joseph @ 2024-08-22  7:16 UTC (permalink / raw)
  To: Akhil Goyal, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

Free the pools allocated in testsuite_setup.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 1491ff03ba..6079d10078 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -770,14 +770,19 @@ testsuite_teardown(void)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	int res;
 
+	if (ts_params->large_mbuf_pool != NULL) {
+		rte_mempool_free(ts_params->large_mbuf_pool);
+		ts_params->large_mbuf_pool = NULL;
+	}
+
 	if (ts_params->mbuf_pool != NULL) {
-		RTE_LOG(DEBUG, USER1, "CRYPTO_MBUFPOOL count %u\n",
-		rte_mempool_avail_count(ts_params->mbuf_pool));
+		rte_mempool_free(ts_params->mbuf_pool);
+		ts_params->mbuf_pool = NULL;
 	}
 
 	if (ts_params->op_mpool != NULL) {
-		RTE_LOG(DEBUG, USER1, "CRYPTO_OP_POOL count %u\n",
-		rte_mempool_avail_count(ts_params->op_mpool));
+		rte_mempool_free(ts_params->op_mpool);
+		ts_params->op_mpool = NULL;
 	}
 
 	if (ts_params->session_mpool != NULL) {
-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 0/6] Fixes and improvements in crypto unit tests
  2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
                   ` (5 preceding siblings ...)
  2024-08-22  7:16 ` [PATCH 6/6] test/crypto: free pools in teardown Anoob Joseph
@ 2024-09-18  5:36 ` Akhil Goyal
  6 siblings, 0 replies; 8+ messages in thread
From: Akhil Goyal @ 2024-09-18  5:36 UTC (permalink / raw)
  To: Anoob Joseph, Fan Zhang
  Cc: Hemant Agrawal, Jerin Jacob, Aakash Sasidharan, Tejasree Kondoj,
	Vidya Sagar Velumuri, dev

> Subject: [PATCH 0/6] Fixes and improvements in crypto unit tests
> 
> Enable larger packet sizes in TLS tests and add minor improvements in
> crypto unit tests.
> 
> Anoob Joseph (6):
>   test/crypto: add asserts to validate test lengths
>   test/crypto: enable larger packet sizes with TLS
>   test/crypto: remove redefinition
>   test/crypto: remove unused macros
>   test/crypto: start opening brace in new line
>   test/crypto: free pools in teardown
> 
>  app/test/test_cryptodev.c                     | 35 ++++++-----
>  app/test/test_cryptodev.h                     | 58 +++++++++++++++----
>  app/test/test_cryptodev_aead_test_vectors.h   | 14 ++++-
>  app/test/test_cryptodev_security_tls_record.h | 12 ++--
>  app/test/test_security_proto.h                |  7 ++-
>  5 files changed, 92 insertions(+), 34 deletions(-)
> 
Series Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto
Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-09-18  5:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22  7:16 [PATCH 0/6] Fixes and improvements in crypto unit tests Anoob Joseph
2024-08-22  7:16 ` [PATCH 1/6] test/crypto: add asserts to validate test lengths Anoob Joseph
2024-08-22  7:16 ` [PATCH 2/6] test/crypto: enable larger packet sizes with TLS Anoob Joseph
2024-08-22  7:16 ` [PATCH 3/6] test/crypto: remove redefinition Anoob Joseph
2024-08-22  7:16 ` [PATCH 4/6] test/crypto: remove unused macros Anoob Joseph
2024-08-22  7:16 ` [PATCH 5/6] test/crypto: start opening brace in new line Anoob Joseph
2024-08-22  7:16 ` [PATCH 6/6] test/crypto: free pools in teardown Anoob Joseph
2024-09-18  5:36 ` [PATCH 0/6] Fixes and improvements in crypto unit tests Akhil Goyal

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).