app/test-crypto-perf: add missed resubmission fix
PATCH 1/1 app/test-crypto-perf: add missed resubmission fix
Currently, after enqueue_burst, there may be ops_unused ops left for next round enqueue. And in next round preparation, only ops_needed ops will be added. But if in the final round the left ops is less than ops_needed, there will be invalid ops between the new needed ops and previous unused ops. The previous unused ops should be moved front after the needed ops.
In the commit[1], an resubmission fix was added to throughput test, and the fix was missed for verify.
This commit adds the missed resubmission fix for verify.
[1] 44e2980b70d1 ("app/crypto-perf: fix crypto operation resubmission")
--- app/test-crypto-perf/cperf_test_verify.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
app/test-crypto-perf/cperf_test_verify.c +13 -1
@@ -275,7 +275,6 @@ cperf_verify_test_runner(void *test_ctx) ops_needed, ctx->sess, ctx->options, ctx->test_vector, iv_offset, &imix_idx, NULL); -/* Populate the mbuf with the test vector, for verification */ for (i =0 ; i < ops_needed; i++) cperf_mbuf_set(ops[i]->sym->m_src,
@@ -293,6 +292,19 @@ cperf_verify_test_runner(void *test_ctx) }#endif /* CPERF_LINEARIZATION_ENABLE */ +/** +* When ops_needed is smaller than ops_enqd, the +* unused ops need to be moved to the front for +* next round use. +*/ +if (unlikely (ops_enqd > ops_needed)) { +size_t nb_b_to_mov = ops_unused *sizeof ( +struct rte_crypto_op *); + +memmove (&ops[ops_needed], &ops[ops_enqd], + nb_b_to_mov); + } +/* Enqueue burst of ops on crypto device */ ops_enqd =rte_cryptodev_enqueue_burst (ctx->dev_id, ctx->qp_id, ops, burst_size);
Signature · 1 line
2.34.1
Hi Suanming,
Please see inline.
Thanks,
Anoob
Quoted 49 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Friday, January 5, 2024 12:26 PM
To: Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [EXT] [PATCH] app/test-crypto-perf: add missed resubmission fixExternal Email
----------------------------------------------------------------------
Currently, afterenqueue_burst, there may beops_unusedops left for next round enqueue. And in next round preparation, onlyops_neededops will be added. But if in the final round the left ops is less thanops_needed, there will be invalid ops between the new needed ops and previous unused ops. The previous unused ops should be moved front after the needed ops.In the commit[1], an resubmission fix was added to throughput test, and the fix was missed for verify.
This commit adds the missed resubmission fix for verify.
[1]
44e2980b70d1("app/crypto-perf: fix crypto operation resubmission")Fixes f8be1786b1b8 ("app/crypto-perf: introduce performance testapplication")
Signed-off-by Suanming Mou <[email protected]>--- app/test-crypto-perf/cperf_test_verify.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)app/test-crypto- renamed from app/test-crypto-perf/cperf_test_verify.c +0
-0
perf/cperf_test_verify.c
index2b0d3f142b..0328bb5724100644app/test-crypto-perf/cperf_test_verify.c +0
-1@@ -275,7 +275,6 @@ cperf_verify_test_runner(void *test_ctx) ops_needed, ctx->sess, ctx->options, ctx->test_vector, iv_offset, &imix_idx, NULL); -/* Populate the mbuf with the test vector, for verification */ for (i =0 ; i < ops_needed; i++)app/test-crypto-perf/cperf_test_verify.c +0
-0cperf_mbuf_set(ops[i]->sym->m_src,@@ -293,6 +292,19 @@ cperf_verify_test_runner(void *test_ctx) }
app/test-crypto-perf/cperf_test_verify.c cperf_verify_test_runner(void *test_ctx) · line 302
Quoted 10 lines
app/test-crypto-perf/cperf_test_verify.c +8
-0#endif /* CPERF_LINEARIZATION_ENABLE */ +/** +* When ops_needed is smaller than ops_enqd, the +* unused ops need to be moved to the front for +* next round use. +*/ +if (unlikely (ops_enqd > ops_needed)) { +size_t nb_b_to_mov = ops_unused *sizeof ( +struct rte_crypto_op *);
[Anoob] The alignment is relaxed to 100 chars now. In case you think it improve code legibility.
Patch looks good either way.
Quoted 11 lines
app/test-crypto-perf/cperf_test_verify.c +5
-0+ +memmove (&ops[ops_needed], &ops[ops_enqd], + nb_b_to_mov); + } +/* Enqueue burst of ops on crypto device */ ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,ops,
burst_size);
--
2.34.1
Quoted 81 lines
-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, January 10, 2024 10:47 PM
To: Suanming Mou <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add missed resubmission fixHi Suanming,
Please see inline.
Thanks,
AnoobQuoted 8 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Friday, January 5, 2024 12:26 PM
To: Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [EXT] [PATCH] app/test-crypto-perf: add missed resubmission fixQuoted 7 lines
External Email
----------------------------------------------------------------------
Currently, afterenqueue_burst, there may beops_unusedops left for next round enqueue. And in next round preparation, onlyops_neededops will be added. But if in the final round the left ops is less thanops_needed, there will be invalid ops between the new needed ops andprevious unused ops.
Quoted 35 lines
The previous unused ops should be moved front after the needed ops.
In the commit[1], an resubmission fix was added to throughput test, and the fix was missed for verify.
This commit adds the missed resubmission fix for verify.
[1]
44e2980b70d1("app/crypto-perf: fix crypto operation resubmission")Fixes f8be1786b1b8 ("app/crypto-perf: introduce performance testapplication")
Signed-off-by Suanming Mou <[email protected]>--- app/test-crypto-perf/cperf_test_verify.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/app/test-crypto-
perf/cperf_test_verify.cindex2b0d3f142b..0328bb5724100644app/test-crypto-perf/cperf_test_verify.c +0
-1@@ -275,7 +275,6 @@ cperf_verify_test_runner(void *test_ctx) ops_needed, ctx->sess, ctx->options, ctx->test_vector, iv_offset, &imix_idx, NULL); -/* Populate the mbuf with the test vector, for verification */ for (i =0 ; i < ops_needed; i++) cperf_mbuf_set(ops[i]->sym->m_src,@@ -293,6 +292,19 @@ cperf_verify_test_runner(void *test_ctx) }app/test-crypto-perf/cperf_test_verify.c cperf_verify_test_runner(void *test_ctx) · line 302
Quoted 10 lines
app/test-crypto-perf/cperf_test_verify.c +8
-0#endif /* CPERF_LINEARIZATION_ENABLE */ +/** +* When ops_needed is smaller than ops_enqd, the +* unused ops need to be moved to the front for +* next round use. +*/ +if (unlikely (ops_enqd > ops_needed)) { +size_t nb_b_to_mov = ops_unused *sizeof ( +struct rte_crypto_op *);[Anoob] The alignment is relaxed to 100 chars now. In case you think it improve code legibility.
Quoted 1 line
Patch looks good either way.
Make sense, it is due to the code was copied directly from previous fix. Will try to update v2. Thanks.
Quoted 14 lines
Acked-by Anoob Joseph <[email protected]>Quoted 11 lines
app/test-crypto-perf/cperf_test_verify.c +5
-0+ +memmove (&ops[ops_needed], &ops[ops_enqd], + nb_b_to_mov); + } +/* Enqueue burst of ops on crypto device */ ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,ops,
burst_size);
--
2.34.1
PATCH v2 1/1 app/test-crypto-perf: add missed resubmission fix
In reply to Suanming MouCurrently, after enqueue_burst, there may be ops_unused ops left for next round enqueue. And in next round preparation, only ops_needed ops will be added. But if in the final round the left ops is less than ops_needed, there will be invalid ops between the new needed ops and previous unused ops. The previous unused ops should be moved front after the needed ops.
In the commit[1], an resubmission fix was added to throughput test, and the fix was missed for verify.
This commit adds the missed resubmission fix for verify.
[1]
commit 44e2980b70d1 ("app/crypto-perf: fix crypto operation resubmission")
---
v2: code-style update.
--- app/test-crypto-perf/cperf_test_verify.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
app/test-crypto-perf/cperf_test_verify.c +11 -1
@@ -275,7 +275,6 @@ cperf_verify_test_runner(void *test_ctx) ops_needed, ctx->sess, ctx->options, ctx->test_vector, iv_offset, &imix_idx, NULL); -/* Populate the mbuf with the test vector, for verification */ for (i =0 ; i < ops_needed; i++) cperf_mbuf_set(ops[i]->sym->m_src,
@@ -293,6 +292,17 @@ cperf_verify_test_runner(void *test_ctx) }#endif /* CPERF_LINEARIZATION_ENABLE */ +/** +* When ops_needed is smaller than ops_enqd, the +* unused ops need to be moved to the front for +* next round use. +*/ +if (unlikely (ops_enqd > ops_needed)) { +size_t nb_b_to_mov = ops_unused *sizeof (struct rte_crypto_op *); + +memmove (&ops[ops_needed], &ops[ops_enqd], nb_b_to_mov); + } +/* Enqueue burst of ops on crypto device */ ops_enqd =rte_cryptodev_enqueue_burst (ctx->dev_id, ctx->qp_id, ops, burst_size);
Signature · 1 line
2.34.1
Akhil Goyal
AppliedQuoted 18 lines
Currently, after
enqueue_burst, there may beops_unusedops left for next round enqueue. And in next round preparation, onlyops_neededops will be added. But if in the final round the left ops is less thanops_needed, there will be invalid ops between the new needed ops and previous unused ops. The previous unused ops should be moved front after the needed ops.In the commit[1], an resubmission fix was added to throughput test, and the fix was missed for verify.
This commit adds the missed resubmission fix for verify.
[1]
commit44e2980b70d1("app/crypto-perf: fix crypto operation resubmission")Fixes f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Quoted 9 lines
Signed-off-by Suanming Mou <[email protected]>Acked-by Anoob Joseph <[email protected]>---
v2: code-style update.
Applied to dpdk-next-crypto
Thanks.