Skip to contentSkip to conversation

app/test-crypto-perf: add throughput OOP decryption

PATCH Superseded Suanming Mou 4 participants 16 messages Jan 5, 2024 – Jul 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

[1]:
http://mails.dpdk.org/archives/dev/2023-July/273328.html

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
 app/test-crypto-perf/cperf_test_throughput.c | 37 +++++++++++++++++---
 3 files changed, 44 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index 84945d1313..1d57b78c2b 100644
@@ -608,7 +608,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto-perf/cperf_options_parsing.c +8 -0
index 75afedc7fd..6caca44371 100644
@@ -1291,6 +1291,14 @@ cperf_options_check(struct cperf_options *options)
 		}
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) &&
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in throughput decryption.\n");
+		return -EINVAL;
+	}
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) {
app/test-crypto-perf/cperf_test_throughput.c +32 -5
index f8f8bd717f..eab25ec863 100644
@@ -98,6 +98,29 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src,
+			ctx->options,
+			ctx->test_vector);
+
+}
+
 int
 cperf_throughput_test_runner(void *test_ctx)
 {
@@ -143,6 +166,9 @@ cperf_throughput_test_runner(void *test_ctx)
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void *)ctx);
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
 		uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
@@ -175,11 +201,12 @@ cperf_throughput_test_runner(void *test_ctx)
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx, &tsc_start);
 
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
Signature · 1 line
2.34.1
#1 lore raw
Quoted 45 lines

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
 app/test-crypto-perf/cperf_test_throughput.c | 37 +++++++++++++++++---
 3 files changed, 44 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index 84945d1313..1d57b78c2b 100644
@@ -608,7 +608,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto- renamed from app/test-crypto-perf/cperf_options_parsing.c +0 -0

perf/cperf_options_parsing.c
index 75afedc7fd..6caca44371 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1291,6 +1291,14 @@ cperf_options_check(struct cperf_options *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1301

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) &&
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Quoted 24 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
app/test-crypto-perf/cperf_options_parsing.c +0 -0
 			options->op_type == CPERF_AUTH_THEN_CIPHER) {
app/test-crypto- renamed from app/test-crypto-perf/cperf_test_throughput.c +0 -0

perf/cperf_test_throughput.c
index f8f8bd717f..eab25ec863 100644

app/test-crypto-perf/cperf_test_throughput.c +10 -0
@@ -98,6 +98,29 @@ cperf_throughput_test_constructor(struct rte_mempool
 *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct rte_mempool · line 121

Quoted 10 lines
app/test-crypto-perf/cperf_test_throughput.c +10 -0
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src,
+			ctx->options,
+			ctx->test_vector);

Unnecessary line break.

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct rte_mempool · line 122

Quoted 1 line
app/test-crypto-perf/cperf_test_throughput.c +1 -0
+

Extra line

Quoted 37 lines
app/test-crypto-perf/cperf_test_throughput.c +2 -0
+}
+
 int
 cperf_throughput_test_runner(void *test_ctx)

{

app/test-crypto-perf/cperf_test_throughput.c +3 -0
@@ -143,6 +166,9 @@ cperf_throughput_test_runner(void *test_ctx)
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void
 *)ctx);
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
app/test-crypto-perf/cperf_test_throughput.c +6 -5
 		uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
@@ -175,11 +201,12 @@ cperf_throughput_test_runner(void *test_ctx)
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,
 &tsc_start);
 
 			/**

* When ops_needed is smaller than ops_enqd, the
--
2.34.1

#2 lore raw

Hi Akhil

Sorry for the late reply.

Quoted 54 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, March 15, 2024 2:45 AM
To: Suanming Mou <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add throughput OOP decryption

Quoted 46 lines

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
app/test-crypto-perf/cperf_test_throughput.c | 37 +++++++++++++++++---
 3 files changed, 44 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index 84945d1313..1d57b78c2b 100644
@@ -608,7 +608,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
(quoted diff) +0 -0

b/app/test-crypto- perf/cperf_options_parsing.c index 75afedc7fd..6caca44371 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1291,6 +1291,14 @@ cperf_options_check(struct cperf_options *options)
 		}
 	}
 
Quoted 11 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1300

Quoted 8 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) &&
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Sorry, in that case I will remove "options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT" and only kept " options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ", what do you think?

Quoted 37 lines
Quoted 5 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||

options->op_type == CPERF_AUTH_THEN_CIPHER) { diff

--git

Quoted 19 lines

a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto- perf/cperf_test_throughput.c index f8f8bd717f..eab25ec863 100644

app/test-crypto-perf/cperf_test_throughput.c +10 -0
@@ -98,6 +98,29 @@ cperf_throughput_test_constructor(struct
 rte_mempool *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct · line 121

Quoted 10 lines
app/test-crypto-perf/cperf_test_throughput.c +10 -0
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src,
+			ctx->options,
+			ctx->test_vector);

Unnecessary line break.

Quoted 2 lines

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct · line 122

Quoted 1 line
app/test-crypto-perf/cperf_test_throughput.c +1 -0
+

Extra line

Will update.

Quoted 38 lines
Quoted 12 lines
app/test-crypto-perf/cperf_test_throughput.c +2 -0
+}
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -143,6 +166,9 @@

cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +2 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_runner(void *test_ctx) · line 174

Quoted 4 lines
app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
 		uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;

@@

Quoted 21 lines

-175,11 +201,12 @@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,

&tsc_start);

app/test-crypto-perf/cperf_test_throughput.c +0 -1
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
--

2.34.1

#3 lore raw
Quoted 12 lines
Quoted 11 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1300

Quoted 8 lines
app/test-crypto-perf/cperf_options_parsing.c +5 -0
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) &&
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in

throughput decryption.\n");

app/test-crypto-perf/cperf_options_parsing.c +2 -0
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Quoted 3 lines

Sorry, in that case I will remove "options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT" and only kept " options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ", what do you think?

I would suggest to check for "auth_op == RTE_CRYPTO_AUTH_OP_VERIFY" Instead of cipher_op.

Ciara, What do you suggest? You were also seeing some issues in this patch.

#4 lore raw
Quoted 22 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, March 19, 2024 4:23 PM
To: Suanming Mou <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add throughput OOP decryption

Quoted 12 lines
Quoted 11 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1300

Quoted 8 lines
app/test-crypto-perf/cperf_options_parsing.c +5 -0
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) &&
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in

throughput decryption.\n");

app/test-crypto-perf/cperf_options_parsing.c +2 -0
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Quoted 6 lines
Quoted 3 lines

Sorry, in that case I will remove "options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT" and only kept " options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ", what do you think?

I would suggest to check for "auth_op == RTE_CRYPTO_AUTH_OP_VERIFY" Instead of cipher_op.

I'm not sure. Since in AEAD OP, auth_op will always be RTE_CRYPTO_AUTH_OP_VERIFY, in that case even in place encrypt will be rejected. If the combination here is too complicated, what about just remove that limits and let user to decide? If the input is not correct, PMD will reject it as well.

Quoted 2 lines

Ciara, What do you suggest? You were also seeing some issues in this patch.

#5 lore raw
Quoted 20 lines
Quoted 1 line

Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add throughput OOP

decryption

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options)

Quoted 4 lines
app/test-crypto-perf/cperf_options_parsing.c +3 -0
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT)

&&

Quoted 13 lines
Quoted 12 lines
Quoted 8 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1300

Quoted 5 lines
(quoted diff) +2 -0
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in

throughput decryption.\n");

app/test-crypto-perf/cperf_options_parsing.c +2 -0
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Sorry, in that case I will remove "options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT" and only kept " options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ", what do you think?

Quoted 8 lines
Quoted 2 lines

I would suggest to check for "auth_op == RTE_CRYPTO_AUTH_OP_VERIFY" Instead of cipher_op.

I'm not sure. Since in AEAD OP, auth_op will always be RTE_CRYPTO_AUTH_OP_VERIFY, in that case even in place encrypt will be rejected.
If the combination here is too complicated, what about just remove that limits and let user to decide? If the input is not correct, PMD will reject it as well.

The problematic cases are where auth data (ICV) is not correct. i.e. AEAD, AUTH_ONLY and CIPHER_AUTH.

Hence following check should be ok.
if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&

	(options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
	options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
	!options->out_of_place) {

Yes PMD will report error if the input data is not correct,
but we cannot just fail in that case just because the app is intentionally not filling the data. It should report unsupported case.

Quoted 3 lines
Quoted 3 lines

Ciara, What do you suggest? You were also seeing some issues in this patch.

#6 lore raw
Quoted 40 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, March 19, 2024 5:32 PM
To: Suanming Mou <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add throughput OOP decryption

Quoted 20 lines
Quoted 1 line

Subject: RE: [EXT] [PATCH] app/test-crypto-perf: add throughput OOP

decryption

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options)

Quoted 4 lines
app/test-crypto-perf/cperf_options_parsing.c +3 -0
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT)

&&

Quoted 13 lines
Quoted 12 lines
Quoted 8 lines

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options *options) · line 1300

Quoted 5 lines
(quoted diff) +2 -0
+			!options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in

throughput decryption.\n");

app/test-crypto-perf/cperf_options_parsing.c +2 -0
+		return -EINVAL;
+	}

This check is blocking cipher_only decryption which should pass irrespective of inplace/oop and Data correct/incorrect.

Sorry, in that case I will remove "options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT" and only kept " options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ", what do you think?

Quoted 8 lines
Quoted 2 lines

I would suggest to check for "auth_op == RTE_CRYPTO_AUTH_OP_VERIFY" Instead of cipher_op.

I'm not sure. Since in AEAD OP, auth_op will always be RTE_CRYPTO_AUTH_OP_VERIFY, in that case even in place encrypt will be rejected.
If the combination here is too complicated, what about just remove
that limits and let user to decide? If the input is not correct, PMD will reject it as

well.

Quoted 8 lines

The problematic cases are where auth data (ICV) is not correct. i.e. AEAD, AUTH_ONLY and CIPHER_AUTH.

Hence following check should be ok.
if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&

	(options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
	options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
	!options->out_of_place) {

OK, that make sense. Will update, thanks.

Quoted 7 lines

Yes PMD will report error if the input data is not correct, but we cannot just fail in that case just because the app is intentionally not filling the data.
It should report unsupported case.

Quoted 3 lines
Quoted 3 lines

Ciara, What do you suggest? You were also seeing some issues in this patch.

#7 lore raw

PATCH v2 1/1 app/test-crypto-perf: add throughput OOP decryption

In reply to Suanming Mou

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

[1]:
http://mails.dpdk.org/archives/dev/2023-July/273328.html

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
 app/test-crypto-perf/cperf_test_throughput.c | 34 +++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index d3fd115bc0..714616c697 100644
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto-perf/cperf_options_parsing.c +8 -0
index 8c20974273..90526e676f 100644
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options *options)
 		}
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in throughput decryption.\n");
+		return -EINVAL;
+	}
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) {
app/test-crypto-perf/cperf_test_throughput.c +29 -5
index e3d266d7a4..b347baa913 100644
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector);
+}
+
 int
 cperf_throughput_test_runner(void *test_ctx)
 {
@@ -144,6 +164,9 @@ cperf_throughput_test_runner(void *test_ctx)
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void *)ctx);
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
 		uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
@@ -176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx)
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx, &tsc_start);
 
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
Signature · 1 line
2.34.1
#8 lore raw
Quoted 53 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, March 19, 2024 11:46 AM
To: [email protected]; Power, Ciara <[email protected]>
Cc: [email protected]
Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

[1]:
http://mails.dpdk.org/archives/dev/2023-July/273328.html

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++  app/test-crypto-
perf/cperf_test_throughput.c | 34 +++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index d3fd115bc0..714616c697 100644
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto- renamed from app/test-crypto-perf/cperf_options_parsing.c +0 -0

perf/cperf_options_parsing.c
index 8c20974273..90526e676f 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options
 *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options · line 1352

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead --aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy data.

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I think are ok for that.

Thanks,
Ciara

Quoted 68 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
app/test-crypto-perf/cperf_options_parsing.c +0 -1
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) { diff
--git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-

perf/cperf_test_throughput.c
index e3d266d7a4..b347baa913 100644

app/test-crypto-perf/cperf_test_throughput.c +19 -0
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct rte_mempool
 *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector); }
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -144,6 +164,9 @@

cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +2 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed =

0;
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed =
0; @@ -176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,

&tsc_start);

app/test-crypto-perf/cperf_test_throughput.c +0 -1
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
--

2.34.1

#9 lore raw
Quoted 87 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Tuesday, March 19, 2024 11:15 PM
To: Suanming Mou <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

Quoted 54 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, March 19, 2024 11:46 AM
To: [email protected]; Power, Ciara <[email protected]>
Cc: [email protected]
Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf will never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

[1]:
http://mails.dpdk.org/archives/dev/2023-July/273328.html

---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
app/test-crypto- perf/cperf_test_throughput.c | 34
+++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
app/test-crypto-perf/cperf_ops.c +4 -1
index d3fd115bc0..714616c697 100644
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
(quoted diff) +0 -0

b/app/test-crypto- perf/cperf_options_parsing.c index 8c20974273..90526e676f 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options
 *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options · line 1352

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Quoted 8 lines

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy data.

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I think are ok for that.

Yes, think about that, in throughput mode, we will not fill the test data time to time, otherwise the testing is useless.
So that means the test data should not be overwritten, otherwise decryption will be with invalid data after the first round of decryption. Since the 1st round decryption overwritten the data to the original buf. In that case, test decryption throughput in non-oop mode is meaningless. That's the reason we add that limit to avoid the invalid data issue.

Quoted 72 lines

Thanks,
Ciara

app/test-crypto-perf/cperf_options_parsing.c

Quoted 4 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
app/test-crypto-perf/cperf_options_parsing.c +0 -0
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) { diff

--git

Quoted 37 lines

a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto- perf/cperf_test_throughput.c index e3d266d7a4..b347baa913 100644

app/test-crypto-perf/cperf_test_throughput.c +19 -0
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct
 rte_mempool *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector); }
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -144,6 +164,9 @@

cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +2 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_runner(void *test_ctx) · line 172

Quoted 4 lines
app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
 		uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;

@@

Quoted 21 lines

-176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,

&tsc_start);

app/test-crypto-perf/cperf_test_throughput.c +0 -1
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
--

2.34.1

#10 lore raw

Hi guys,

Just want to make sure if anything still need to be checked with that patch?

Quoted 37 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, March 20, 2024 8:15 AM
To: Power, Ciara <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

Quoted 13 lines

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Quoted 8 lines

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy data.

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I think are ok for that.

Yes, think about that, in throughput mode, we will not fill the test data time to time, otherwise the testing is useless.
So that means the test data should not be overwritten, otherwise decryption will be with invalid data after the first round of decryption. Since the 1st round decryption overwritten the data to the original buf. In that case, test decryption throughput in non-oop mode is meaningless.
That's the reason we add that limit to avoid the invalid data issue.

#11 lore raw

Hi Akhil,

As we mentioned the application in another thread, do you know if we can take the patch for now?

BR,
Suanming

Quoted 52 lines

-----Original Message-----
From: Suanming Mou
Sent: Monday, April 1, 2024 8:30 AM
To: Suanming Mou <[email protected]>; Power, Ciara <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

Hi guys,

Just want to make sure if anything still need to be checked with that patch?

Quoted 24 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, March 20, 2024 8:15 AM
To: Power, Ciara <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

Quoted 17 lines

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy

data.

Quoted 11 lines
Quoted 4 lines

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I think are ok for that.

Yes, think about that, in throughput mode, we will not fill the test data time to time, otherwise the testing is useless.
So that means the test data should not be overwritten, otherwise decryption will be with invalid data after the first round of decryption. Since the 1st round decryption overwritten the data to the original buf. In that case, test decryption throughput in non-oop mode is

meaningless.

Quoted 3 lines

That's the reason we add that limit to avoid the invalid data issue.

#12 lore raw
In reply to Power, Ciara

Hi Brian,

Since Ciara is no longer available and you are the new maintainer, can you investigate this patch? There were some concerns which Ciara highlighted. Can you check?

Regards,
Akhil

Quoted 156 lines
Quoted 7 lines

Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported since the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf

will

Quoted 7 lines

never be modified, and if the test data can be prepared out of the running loop, the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for throughput.

[1]:
https://urldefense.proofpoint.com/v2/url?u=http-

3A__mails.dpdk.org_archives_dev_2023- 2DJuly_273328.html&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=DnL7Si2wl_P RwpZ9TWey3eu68gBzn7DkPwuqhd6WNyo&m=eTj0O7iYH- xiTQ6dNUZpsOXPqnyC1O_- _IKt0j_yQ_N__vy0wIBLb_QyMQtodUrr&s=eDz_NLjqkUH2cYMilKEtdWImOPj5f- CVKV5UW8P9frk&e=

app/test-crypto-

Quoted 9 lines
---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++  app/test-crypto-
perf/cperf_test_throughput.c | 34 +++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
app/test-crypto- renamed from app/test-crypto-perf/cperf_ops.c +0 -0

perf/cperf_ops.c

Quoted 23 lines

index d3fd115bc0..714616c697 100644

app/test-crypto-perf/cperf_ops.c +4 -1
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto- renamed from app/test-crypto-perf/cperf_options_parsing.c +0 -0

perf/cperf_options_parsing.c
index 8c20974273..90526e676f 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options
 *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options · line 1352

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy data.

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I think are ok for that.

Thanks,
Ciara

Quoted 68 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
app/test-crypto-perf/cperf_options_parsing.c +0 -1
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) { diff
--git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-

perf/cperf_test_throughput.c
index e3d266d7a4..b347baa913 100644

app/test-crypto-perf/cperf_test_throughput.c +19 -0
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct rte_mempool
 *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector); }
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -144,6 +164,9 @@

cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +2 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed =

0;
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed =
0; @@ -176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,

&tsc_start);

app/test-crypto-perf/cperf_test_throughput.c +0 -1
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
--

2.34.1

#13 lore raw
Quoted 6 lines

Hi Brian,

Since Ciara is no longer available and you are the new maintainer, can you investigate this patch?
There were some concerns which Ciara highlighted. Can you check?

Any update on this patch?

Quoted 162 lines
Quoted 4 lines
Quoted 4 lines

Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported

since

Quoted 5 lines
Quoted 3 lines

the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf

will

Quoted 1 line

never be modified, and if the test data can be prepared out of the running

loop,

Quoted 3 lines
Quoted 3 lines

the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for

throughput.

Quoted 5 lines
Quoted 3 lines

[1]:
https://urldefense.proofpoint.com/v2/url?u=http-

3A__mails.dpdk.org_archives_dev_2023-

2DJuly_273328.html&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=DnL7Si2wl_P

Quoted 59 lines

RwpZ9TWey3eu68gBzn7DkPwuqhd6WNyo&m=eTj0O7iYH- xiTQ6dNUZpsOXPqnyC1O_- _IKt0j_yQ_N__vy0wIBLb_QyMQtodUrr&s=eDz_NLjqkUH2cYMilKEtdWImOPj5f- CVKV5UW8P9frk&e=

app/test-crypto-

Quoted 9 lines
---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++  app/test-crypto-
perf/cperf_test_throughput.c | 34 +++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
app/test-crypto- renamed from app/test-crypto-perf/cperf_ops.c +0 -0

perf/cperf_ops.c

Quoted 23 lines

index d3fd115bc0..714616c697 100644

app/test-crypto-perf/cperf_ops.c +4 -1
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
app/test-crypto- renamed from app/test-crypto-perf/cperf_options_parsing.c +0 -0

perf/cperf_options_parsing.c
index 8c20974273..90526e676f 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options
 *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options · line 1352

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Quoted 7 lines

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy data.

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I

think

Quoted 5 lines

are ok for that.

Thanks,
Ciara

Quoted 10 lines

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
app/test-crypto-perf/cperf_options_parsing.c +0 -1
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) { diff
--git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-

perf/cperf_test_throughput.c
index e3d266d7a4..b347baa913 100644

app/test-crypto-perf/cperf_test_throughput.c +0 -0
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct

rte_mempool

Quoted 58 lines
Quoted 58 lines
app/test-crypto-perf/cperf_test_throughput.c +19 -0
 *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i)
+{
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector); }
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -144,6 +164,9 @@

cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +2 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
 
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed =

0;
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed =
0; @@ -176,11 +199,12 @@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,

&tsc_start);

app/test-crypto-perf/cperf_test_throughput.c +0 -1
 			/**
 			 * When ops_needed is smaller than ops_enqd, the
--

2.34.1

Acked-by
#14 lore raw

Hi Suanming,

This change looks ok to me.

Quoted 194 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, July 18, 2024 8:57 PM
To: Suanming Mou <[email protected]>; Dooley, Brian <[email protected]>; Mcnamara, John <[email protected]>; Ji, Kai <[email protected]>; Kusztal, ArkadiuszX <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

Quoted 6 lines

Hi Brian,

Since Ciara is no longer available and you are the new maintainer, can you investigate this patch?
There were some concerns which Ciara highlighted. Can you check?

Any update on this patch?

Quoted 12 lines
Quoted 6 lines
Quoted 6 lines

Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported

since

Quoted 5 lines
Quoted 4 lines

the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf

will

Quoted 14 lines
Quoted 2 lines
Quoted 2 lines

never be modified, and if the test data can be prepared out of the running

loop,

Quoted 4 lines
Quoted 4 lines

the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for

throughput.

Quoted 5 lines
Quoted 3 lines

[1]:
https://urldefense.proofpoint.com/v2/url?u=http-

3A__mails.dpdk.org_archives_dev_2023-

2DJuly_273328.html&d=DwIFAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=DnL7Si2 wl_P

Quoted 3 lines
Quoted 3 lines

RwpZ9TWey3eu68gBzn7DkPwuqhd6WNyo&m=eTj0O7iYH-
xiTQ6dNUZpsOXPqnyC1O_-

_IKt0j_yQ_N__vy0wIBLb_QyMQtodUrr&s=eDz_NLjqkUH2cYMilKEtdWImOPj 5f-

Quoted 10 lines
Quoted 10 lines

CVKV5UW8P9frk&e=

Quoted 9 lines
---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
app/test-crypto- perf/cperf_test_throughput.c | 34
+++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
Quoted 6 lines
Quoted 6 lines

app/test-crypto-

Quoted 1 line
app/test-crypto- renamed from app/test-crypto-perf/cperf_ops.c +0 -0

perf/cperf_ops.c

app/test-crypto-perf/cperf_ops.c cperf_set_ops_aead(struct rte_crypto_op

Quoted 4 lines

index d3fd115bc0..714616c697 100644

app/test-crypto-perf/cperf_ops.c +0 -0
@@ -644,7 +644,10 @@ cperf_set_ops_aead(struct rte_crypto_op

**ops,

Quoted 38 lines
Quoted 38 lines
Quoted 19 lines
app/test-crypto-perf/cperf_ops.c +4 -1
 	}
 
 	if ((options->test == CPERF_TEST_TYPE_VERIFY) ||
-			(options->test == CPERF_TEST_TYPE_LATENCY)) {
+	    (options->test == CPERF_TEST_TYPE_LATENCY) ||
+	    (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	     (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	      options->cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT))) {
 		for (i = 0; i < nb_ops; i++) {
 			uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
 					uint8_t *, iv_offset);
(quoted diff) +0 -0

b/app/test-crypto- perf/cperf_options_parsing.c index 8c20974273..90526e676f 100644

app/test-crypto-perf/cperf_options_parsing.c +0 -0
@@ -1341,6 +1341,14 @@ cperf_options_check(struct cperf_options
 *options)
 		}

app/test-crypto-perf/cperf_options_parsing.c cperf_options_check(struct cperf_options · line 1352

Quoted 10 lines
app/test-crypto-perf/cperf_options_parsing.c +7 -0
 	}
 
+	if (options->test == CPERF_TEST_TYPE_THROUGHPUT &&
+	    (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT ||
+	     options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) &&
+	    !options->out_of_place) {
+		RTE_LOG(ERR, USER1, "Only out-of-place is allowed in
 throughput decryption.\n");
+		return -EINVAL;
+	}

Not totally following some of this, why do we only want to add this for OOP mode?

For example an inplace command I can use before this patch but not after:
./build/app/dpdk-test-crypto-perf -l 2,3 -- --ptest throughput --optype aead -- aead-algo aes-gcm --aead-op decrypt --devtype crypto_qat --aead-key-sz 16

Quoted 8 lines
Quoted 8 lines

I get an error;
USER1: Only out-of-place is allowed in throughput decryption.
USER1: Checking one or more user options failed

Do we want to always force the user to use OOP + test vector file for these throughput decryption tests?
Or should we just add a warning that the throughput may not be reflecting the "success" verify path in PMD if using inplace and the dummy

data.

Quoted 14 lines
Quoted 4 lines

I am not sure.
If we do want to add the limitation on the throughput tests, these changes I

think

Quoted 9 lines

are ok for that.

Thanks,
Ciara

Quoted 4 lines
app/test-crypto-perf/cperf_options_parsing.c +1 -0
+
 	if (options->op_type == CPERF_CIPHER_ONLY ||
app/test-crypto-perf/cperf_options_parsing.c +0 -0
 			options->op_type == CPERF_CIPHER_THEN_AUTH ||
 			options->op_type == CPERF_AUTH_THEN_CIPHER) {

diff --git

Quoted 35 lines
Quoted 5 lines

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_constructor(struct

Quoted 5 lines

a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto- perf/cperf_test_throughput.c index e3d266d7a4..b347baa913 100644

app/test-crypto-perf/cperf_test_throughput.c +0 -0
@@ -99,6 +99,26 @@ cperf_throughput_test_constructor(struct

rte_mempool

Quoted 29 lines
Quoted 29 lines
app/test-crypto-perf/cperf_test_throughput.c +19 -0
 *sess_mp,
 	return NULL;
 }
 
+static void
+cperf_verify_init_ops(struct rte_mempool *mp __rte_unused,
+		      void *opaque_arg,
+		      void *obj,
+		      __rte_unused unsigned int i) {
+	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+		sizeof(struct rte_crypto_sym_op);
+	uint32_t imix_idx = 0;
+	struct cperf_throughput_ctx *ctx = opaque_arg;
+	struct rte_crypto_op *op = obj;
+
+	(ctx->populate_ops)(&op, ctx->src_buf_offset,
+			ctx->dst_buf_offset,
+			1, ctx->sess, ctx->options,
+			ctx->test_vector, iv_offset, &imix_idx, NULL);
+
+	cperf_mbuf_set(op->sym->m_src, ctx->options, ctx->test_vector);
+}
+
 int
 cperf_throughput_test_runner(void *test_ctx)  { @@ -144,6 +164,9

@@ cperf_throughput_test_runner(void *test_ctx)

app/test-crypto-perf/cperf_test_throughput.c +0 -0
 	uint16_t iv_offset = sizeof(struct rte_crypto_op) +
 		sizeof(struct rte_crypto_sym_op);
Quoted 6 lines
Quoted 6 lines

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_runner(void *test_ctx)

Quoted 6 lines
app/test-crypto-perf/cperf_test_throughput.c +2 -0
+	if (ctx->options->out_of_place)
+		rte_mempool_obj_iter(ctx->pool, cperf_verify_init_ops, (void

*)ctx);

app/test-crypto-perf/cperf_test_throughput.c +1 -0
+
 	while (test_burst_size <= ctx->options->max_burst_size) {
 		uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed

= 0;

Quoted 1 line
Quoted 1 line
Quoted 1 line

uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed

= 0;

Quoted 1 line
Quoted 1 line

app/test-crypto-perf/cperf_test_throughput.c cperf_throughput_test_runner(void

Quoted 1 line
app/test-crypto-perf/cperf_test_throughput.c +0 -0
@@ -176,11 +199,12 @@ cperf_throughput_test_runner(void

*test_ctx)

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
app/test-crypto-perf/cperf_test_throughput.c +6 -5
 			}
 
 			/* Setup crypto op, attach mbuf etc */
-			(ctx->populate_ops)(ops, ctx->src_buf_offset,
-					ctx->dst_buf_offset,
-					ops_needed, ctx->sess,
-					ctx->options, ctx->test_vector,
-					iv_offset, &imix_idx, &tsc_start);
+			if (!ctx->options->out_of_place)
+				(ctx->populate_ops)(ops, ctx->src_buf_offset,
+						ctx->dst_buf_offset,
+						ops_needed, ctx->sess,
+						ctx->options, ctx->test_vector,
+						iv_offset, &imix_idx,
 &tsc_start);
 
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
app/test-crypto-perf/cperf_test_throughput.c +0 -0
 			/**

* When ops_needed is smaller than ops_enqd, the
--
2.34.1

Applied
#15 lore raw
Quoted 29 lines
Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines

Subject: [PATCH v2] app/test-crypto-perf: add throughput OOP decryption

During throughput running, re-filling the test data will impact the performance test result. So for now, to run decrypt throughput testing is not supported

since

Quoted 7 lines
Quoted 4 lines

the test data is not filled.

But if user requires OOP(out-of-place) mode, the test data from source mbuf

will

Quoted 2 lines

never be modified, and if the test data can be prepared out of the running

loop,

Quoted 4 lines
Quoted 4 lines

the decryption test should be fine.

This commit adds the support of out-of-place decryption testing for

throughput.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
---
 app/test-crypto-perf/cperf_ops.c             |  5 ++-
 app/test-crypto-perf/cperf_options_parsing.c |  8 +++++
app/test-crypto- perf/cperf_test_throughput.c | 34
+++++++++++++++++---
 3 files changed, 41 insertions(+), 6 deletions(-)
Quoted 1 line

Applied to dpdk-next-crypto