[v2] app/test-crypto-perf: add missed resubmission fix

Message ID 20240115080830.1051786-1-suanmingm@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] app/test-crypto-perf: add missed resubmission fix |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Suanming Mou Jan. 15, 2024, 8:08 a.m. UTC
  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]
commit 44e2980b70d1 ("app/crypto-perf: fix crypto operation resubmission")

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>
---

v2: code-style update.

---
 app/test-crypto-perf/cperf_test_verify.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
  

Comments

Akhil Goyal Feb. 29, 2024, 5:03 p.m. UTC | #1
> 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]
> commit 44e2980b70d1 ("app/crypto-perf: fix crypto operation resubmission")
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> 
> Acked-by: Anoob Joseph <anoobj@marvell.com>
> ---
> 
> v2: code-style update.
> 
Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index 2b0d3f142b..10172a53a0 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -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);