app/test-crypto-perf: fix multi-segment issue
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
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.
--- 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
@@ -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
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 calculationFor the case crypto device requires headroom and tailroom, the
segment_szin options also contains theheadroom_szandtailroom_sz, but mbuf'sdata_lenis user'ssegment_szwithoutheadroom_szandtailroom_sz. That means the data size to be copied should use user'ssegment_szinstead ofoptions->segment_sz.This commit fixes the copy segment size calculation.
Fixes 14864c4217ce ("test/crypto-perf: populate mbuf in latency test")Signed-off-by Suanming Mou <[email protected]>--- 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
indexad2076dd2e..8faf832527100644app/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
PATCH 2/2 app/test-crypto-perf: fix dst_mbuf size calculation
In reply to Suanming MouIf 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.
--- 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
@@ -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
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: fixdst_mbufsize calculationapp/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
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 issueQuoted 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: fixdst_mbufsize 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