[PATCH 1/2] app/test-crypto-perf: fix copy segment size calculation
Suanming Mou
suanmingm at nvidia.com
Wed Jan 3 05:00:23 CET 2024
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")
Signed-off-by: Suanming Mou <suanmingm at nvidia.com>
---
app/test-crypto-perf/cperf_test_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index ad2076dd2e..8faf832527 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -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
More information about the dev
mailing list