DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/test-crypto-perf: fix segment size for IPsec operation
@ 2021-11-16 10:23 Gagandeep Singh
  2021-11-16 10:37 ` [PATCH v2] " Gagandeep Singh
  0 siblings, 1 reply; 8+ messages in thread
From: Gagandeep Singh @ 2021-11-16 10:23 UTC (permalink / raw)
  To: gakhil, dev; +Cc: Gagandeep Singh

Application calculates segment size based on buffer size plus
digest size only, But if the operation mode is IPsec then
packet length can be increased upto 73 bytes due to IPsec
overhead.

In this patch, adding the IPsec overhead length in segment size
when there is no user given segment size.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 app/test-crypto-perf/cperf_options.h         | 1 +
 app/test-crypto-perf/cperf_options_parsing.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h
index 031b238b20..cdbc027b89 100644
--- a/app/test-crypto-perf/cperf_options.h
+++ b/app/test-crypto-perf/cperf_options.h
@@ -61,6 +61,7 @@
 #define CPERF_PMDCC_DELAY_MS	("pmd-cyclecount-delay-ms")
 
 #define MAX_LIST 32
+#define CPERF_IPSEC_OVERHEAD 73
 
 enum cperf_perf_test_type {
 	CPERF_TEST_TYPE_THROUGHPUT,
diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index c244f81bbf..268f544936 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -1132,9 +1132,12 @@ cperf_options_check(struct cperf_options *options)
 	 * If segment size is not set, assume only one segment,
 	 * big enough to contain the largest buffer and the digest
 	 */
-	if (options->segment_sz == 0)
+	if (options->segment_sz == 0) {
 		options->segment_sz = options->max_buffer_size +
 				options->digest_sz;
+		if (options->op_type == CPERF_IPSEC)
+			options->segment_sz += CPERF_IPSEC_OVERHEAD;
+	}
 
 	if (options->segment_sz < options->digest_sz) {
 		RTE_LOG(ERR, USER1,
-- 
2.25.1


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

end of thread, other threads:[~2021-11-23 19:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 10:23 [PATCH] app/test-crypto-perf: fix segment size for IPsec operation Gagandeep Singh
2021-11-16 10:37 ` [PATCH v2] " Gagandeep Singh
2021-11-16 10:42   ` [EXT] " Akhil Goyal
2021-11-16 11:47     ` Gagandeep Singh
2021-11-17  6:36       ` Akhil Goyal
2021-11-17  7:00         ` Gagandeep Singh
2021-11-17  7:40   ` [PATCH v3] " Gagandeep Singh
2021-11-23 19:49     ` [EXT] " 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).