Skip to contentSkip to conversation

app/test-crypto-perf: fix multi-segment issue

PATCH In review Suanming Mou 2 participants 6 messages Jan 3, 2024 – Feb 29, 2024

lore
Share & tools
lore
#0 lore raw

cover app/test-crypto-perf: fix multi-segment issue

This commit fixes the bugs in multi-segment size calculation.

*** BLURB HERE ***

Suanming Mou (2):
app/test-crypto-perf: fix copy segment size calculation app/test-crypto-perf: fix dst_mbuf size calculation

 app/test-crypto-perf/cperf_test_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 app/test-crypto-perf: fix copy segment size calculation

For the case crypto device requires headroom and tailroom, the segment_sz in options also contains the headroom_sz and tailroom_sz, but mbuf's data_len is user's segment_sz without headroom_sz and tailroom_sz. That means the data size to be copied should use user's segment_sz instead of options->segment_sz.

This commit fixes the copy segment size calculation.

Fixes 14864c4217ce ("test/crypto-perf: populate mbuf in latency test")
---
 app/test-crypto-perf/cperf_test_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-crypto-perf/cperf_test_common.c +1 -1
index ad2076dd2e..8faf832527 100644
@@ -271,7 +271,7 @@ cperf_mbuf_set(struct rte_mbuf *mbuf,
 		const struct cperf_options *options,
 		const struct cperf_test_vector *test_vector)
 {
-	uint32_t segment_sz = options->segment_sz;
+	uint32_t segment_sz = options->segment_sz - options->headroom_sz - options->tailroom_sz;
 	uint8_t *mbuf_data;
 	uint8_t *test_data;
 	uint32_t remaining_bytes = options->max_buffer_size;
Signature · 1 line
2.34.1
#2 lore raw

RE: [PATCH 1/2] app/test-crypto-perf: fix copy segment size calculation

Hi,

I saw other crypto perf fixes are reviewed, any chance to take a look at this series?

Quoted 37 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, January 3, 2024 12:00 PM
To: [email protected]
Cc: [email protected]
Subject: [PATCH 1/2] app/test-crypto-perf: fix copy segment size calculation

For the case crypto device requires headroom and tailroom, the segment_sz in options also contains the headroom_sz and tailroom_sz, but mbuf's data_len is user's segment_sz without headroom_sz and tailroom_sz. That means the data size to be copied should use user's segment_sz instead of options->segment_sz.

This commit fixes the copy segment size calculation.

Fixes 14864c4217ce ("test/crypto-perf: populate mbuf in latency test")
---
 app/test-crypto-perf/cperf_test_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-crypto- renamed from app/test-crypto-perf/cperf_test_common.c +0 -0

perf/cperf_test_common.c
index ad2076dd2e..8faf832527 100644

app/test-crypto-perf/cperf_test_common.c +2 -2
@@ -271,7 +271,7 @@ cperf_mbuf_set(struct rte_mbuf *mbuf,
 		const struct cperf_options *options,
 		const struct cperf_test_vector *test_vector)  {
-	uint32_t segment_sz = options->segment_sz;
+	uint32_t segment_sz = options->segment_sz - options->headroom_sz -
+options->tailroom_sz;
 	uint8_t *mbuf_data;
 	uint8_t *test_data;
 	uint32_t remaining_bytes = options->max_buffer_size;
--

2.34.1

#3 lore raw

PATCH 2/2 app/test-crypto-perf: fix dst_mbuf size calculation

In reply to Suanming Mou

If crypto device requires headroom and tailroom, the mbuf of dst in out-of-place should reserve the headroom and tailroom as well, otherwise there will be no enough room for dst mbuf.

Fixes bf9d6702eca9 ("app/crypto-perf: use single mempool")
---
 app/test-crypto-perf/cperf_test_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/test-crypto-perf/cperf_test_common.c +2 -1
index 8faf832527..c773dd48df 100644
@@ -229,7 +229,8 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 				(mbuf_size * segments_nb);
 		params.dst_buf_offset = *dst_buf_offset;
 		/* Destination buffer will be one segment only */
-		obj_size += max_size + sizeof(struct rte_mbuf);
+		obj_size += max_size + sizeof(struct rte_mbuf) +
+			options->headroom_sz + options->tailroom_sz;
 	}
 
 	*pool = rte_mempool_create_empty(pool_name,
Signature · 1 line
2.34.1
#4 lore raw
In reply to Suanming Mou
Quoted 9 lines

This commit fixes the bugs in multi-segment size calculation.

Suanming Mou (2):
app/test-crypto-perf: fix copy segment size calculation app/test-crypto-perf: fix dst_mbuf size calculation

 app/test-crypto-perf/cperf_test_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Series Acked-by: Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto

#5 lore raw
Quoted 15 lines

-----Original Message-----
From: Akhil Goyal
Sent: Thursday, February 29, 2024 10:31 PM
To: Suanming Mou <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [EXT] [PATCH 0/2] app/test-crypto-perf: fix multi-segment issue

Quoted 6 lines

This commit fixes the bugs in multi-segment size calculation.

Suanming Mou (2):
app/test-crypto-perf: fix copy segment size calculation app/test-crypto-perf: fix dst_mbuf size calculation

Quoted 5 lines
Quoted 3 lines
 app/test-crypto-perf/cperf_test_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Series Acked-by: Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto