patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v1 3/6] app/crypto-perf: fix result location for asymmetric test
       [not found] <20240615115309.2678-1-gmuthukrishn@marvell.com>
@ 2024-06-15 11:53 ` Gowrishankar Muthukrishnan
  2024-06-20  6:46   ` Akhil Goyal
       [not found] ` <20240626084747.1595-1-gmuthukrishn@marvell.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-06-15 11:53 UTC (permalink / raw)
  To: dev, Ciara Power, Kiran Kumar K, Akhil Goyal
  Cc: Anoob Joseph, Gowrishankar Muthukrishnan, stable

For asymmetric op, private test data should be stored after
rte_crypto_asym_op struct.

Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c  |  6 ++++--
 app/test-crypto-perf/cperf_test_latency.c | 14 +++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 94d39fb177..6b8ab65731 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -149,11 +149,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 	int ret;
 
 	/* Calculate the object size */
-	uint16_t crypto_op_size = sizeof(struct rte_crypto_op) +
-		sizeof(struct rte_crypto_sym_op);
+	uint16_t crypto_op_size = sizeof(struct rte_crypto_op);
 	uint16_t crypto_op_private_size;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
+		crypto_op_size += sizeof(struct rte_crypto_asym_op);
 		snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u",
 			 rte_socket_id());
 		*pool = rte_crypto_op_pool_create(
@@ -170,6 +170,8 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 		return 0;
 	}
 
+	crypto_op_size += sizeof(struct rte_crypto_sym_op);
+
 	/*
 	 * If doing AES-CCM, IV field needs to be 16 bytes long,
 	 * and AAD field needs to be long enough to have 18 bytes,
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index b8ad6bf4d4..376847e761 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -122,7 +122,11 @@ store_timestamp(struct rte_crypto_op *op, uint64_t timestamp)
 {
 	struct priv_op_data *priv_data;
 
-	priv_data = (struct priv_op_data *) (op->sym + 1);
+	if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+		priv_data = (struct priv_op_data *) (op->sym + 1);
+	else
+		priv_data = (struct priv_op_data *) (op->asym + 1);
+
 	priv_data->result->status = op->status;
 	priv_data->result->tsc_end = timestamp;
 }
@@ -251,9 +255,13 @@ cperf_latency_test_runner(void *arg)
 				ctx->res[tsc_idx].tsc_start = tsc_start;
 				/*
 				 * Private data structure starts after the end of the
-				 * rte_crypto_sym_op structure.
+				 * rte_crypto_sym_op (or rte_crypto_asym_op) structure.
 				 */
-				priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				if (ops[i]->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+					priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				else
+					priv_data = (struct priv_op_data *) (ops[i]->asym + 1);
+
 				priv_data->result = (void *)&ctx->res[tsc_idx];
 				tsc_idx++;
 			}
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v1 3/6] app/crypto-perf: fix result location for asymmetric test
  2024-06-15 11:53 ` [PATCH v1 3/6] app/crypto-perf: fix result location for asymmetric test Gowrishankar Muthukrishnan
@ 2024-06-20  6:46   ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2024-06-20  6:46 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, dev, Kiran Kumar Kokkilagadda
  Cc: Anoob Joseph, Gowrishankar Muthukrishnan, stable

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]



> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Saturday, June 15, 2024 5:23 PM
> To: dev@dpdk.org; Ciara Power <ciara.power@intel.com>; Kiran Kumar
> Kokkilagadda <kirankumark@marvell.com>; Akhil Goyal <gakhil@marvell.com>
> Cc: Anoob Joseph <anoobj@marvell.com>; Gowrishankar Muthukrishnan
> <gmuthukrishn@marvell.com>; stable@dpdk.org
> Subject: [PATCH v1 3/6] app/crypto-perf: fix result location for asymmetric test
> 
> For asymmetric op, private test data should be stored after
> rte_crypto_asym_op struct.
> 
> Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput
> test")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 14836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 2/6] app/crypto-perf: remove redundant local varriable
       [not found] ` <20240626084747.1595-1-gmuthukrishn@marvell.com>
@ 2024-06-26  8:47   ` Gowrishankar Muthukrishnan
  2024-06-26  8:47   ` [PATCH v2 3/6] app/crypto-perf: fix result location for asymmetric test Gowrishankar Muthukrishnan
  1 sibling, 0 replies; 4+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-06-26  8:47 UTC (permalink / raw)
  To: dev, Ciara Power, Akhil Goyal, Fan Zhang, Anoob Joseph
  Cc: Gowrishankar Muthukrishnan, stable

Remove redundant local variable used for asym session.

Fixes: a29bb248988 ("cryptodev: hide asymmetric session structure")
Fixes: 2973dbf93b4 ("security: hide session structure")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 app/test-crypto-perf/cperf_ops.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 4ca001b721..a802281a71 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -21,7 +21,6 @@ cperf_set_ops_asym(struct rte_crypto_op **ops,
 		   uint64_t *tsc_start __rte_unused)
 {
 	uint16_t i;
-	void *asym_sess = (void *)sess;
 
 	for (i = 0; i < nb_ops; i++) {
 		struct rte_crypto_asym_op *asym_op = ops[i]->asym;
@@ -31,7 +30,7 @@ cperf_set_ops_asym(struct rte_crypto_op **ops,
 		asym_op->modex.base.length = options->modex_data->base.len;
 		asym_op->modex.result.data = options->modex_data->result.data;
 		asym_op->modex.result.length = options->modex_data->result.len;
-		rte_crypto_op_attach_asym_session(ops[i], asym_sess);
+		rte_crypto_op_attach_asym_session(ops[i], sess);
 	}
 }
 
@@ -62,7 +61,6 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
 
 	for (i = 0; i < nb_ops; i++) {
 		struct rte_crypto_sym_op *sym_op = ops[i]->sym;
-		void *sec_sess = (void *)sess;
 		uint32_t buf_sz;
 
 		uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ops[i],
@@ -70,7 +68,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
 		*per_pkt_hfn = options->pdcp_ses_hfn_en ? 0 : PDCP_DEFAULT_HFN;
 
 		ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
-		rte_security_attach_session(ops[i], sec_sess);
+		rte_security_attach_session(ops[i], sess);
 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
 							src_buf_offset);
 
@@ -127,7 +125,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
 		uint16_t iv_offset __rte_unused, uint32_t *imix_idx,
 		uint64_t *tsc_start)
 {
-	void *sec_sess = sess;
 	const uint32_t test_buffer_size = options->test_buffer_size;
 	uint64_t tsc_start_temp, tsc_end_temp;
 	uint16_t i = 0;
@@ -140,7 +137,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
 		uint32_t offset = test_buffer_size;
 
 		ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
-		rte_security_attach_session(ops[i], sec_sess);
+		rte_security_attach_session(ops[i], sess);
 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset);
 		sym_op->m_src->pkt_len = test_buffer_size;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 3/6] app/crypto-perf: fix result location for asymmetric test
       [not found] ` <20240626084747.1595-1-gmuthukrishn@marvell.com>
  2024-06-26  8:47   ` [PATCH v2 2/6] app/crypto-perf: remove redundant local varriable Gowrishankar Muthukrishnan
@ 2024-06-26  8:47   ` Gowrishankar Muthukrishnan
  1 sibling, 0 replies; 4+ messages in thread
From: Gowrishankar Muthukrishnan @ 2024-06-26  8:47 UTC (permalink / raw)
  To: dev, Ciara Power, Akhil Goyal, Kiran Kumar K
  Cc: Anoob Joseph, Gowrishankar Muthukrishnan, stable

For asymmetric op, private test data should be stored after
rte_crypto_asym_op struct.

Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c  |  6 ++++--
 app/test-crypto-perf/cperf_test_latency.c | 14 +++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 94d39fb177..6b8ab65731 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -149,11 +149,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 	int ret;
 
 	/* Calculate the object size */
-	uint16_t crypto_op_size = sizeof(struct rte_crypto_op) +
-		sizeof(struct rte_crypto_sym_op);
+	uint16_t crypto_op_size = sizeof(struct rte_crypto_op);
 	uint16_t crypto_op_private_size;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
+		crypto_op_size += sizeof(struct rte_crypto_asym_op);
 		snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u",
 			 rte_socket_id());
 		*pool = rte_crypto_op_pool_create(
@@ -170,6 +170,8 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 		return 0;
 	}
 
+	crypto_op_size += sizeof(struct rte_crypto_sym_op);
+
 	/*
 	 * If doing AES-CCM, IV field needs to be 16 bytes long,
 	 * and AAD field needs to be long enough to have 18 bytes,
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index b8ad6bf4d4..376847e761 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -122,7 +122,11 @@ store_timestamp(struct rte_crypto_op *op, uint64_t timestamp)
 {
 	struct priv_op_data *priv_data;
 
-	priv_data = (struct priv_op_data *) (op->sym + 1);
+	if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+		priv_data = (struct priv_op_data *) (op->sym + 1);
+	else
+		priv_data = (struct priv_op_data *) (op->asym + 1);
+
 	priv_data->result->status = op->status;
 	priv_data->result->tsc_end = timestamp;
 }
@@ -251,9 +255,13 @@ cperf_latency_test_runner(void *arg)
 				ctx->res[tsc_idx].tsc_start = tsc_start;
 				/*
 				 * Private data structure starts after the end of the
-				 * rte_crypto_sym_op structure.
+				 * rte_crypto_sym_op (or rte_crypto_asym_op) structure.
 				 */
-				priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				if (ops[i]->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+					priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				else
+					priv_data = (struct priv_op_data *) (ops[i]->asym + 1);
+
 				priv_data->result = (void *)&ctx->res[tsc_idx];
 				tsc_idx++;
 			}
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-26  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240615115309.2678-1-gmuthukrishn@marvell.com>
2024-06-15 11:53 ` [PATCH v1 3/6] app/crypto-perf: fix result location for asymmetric test Gowrishankar Muthukrishnan
2024-06-20  6:46   ` Akhil Goyal
     [not found] ` <20240626084747.1595-1-gmuthukrishn@marvell.com>
2024-06-26  8:47   ` [PATCH v2 2/6] app/crypto-perf: remove redundant local varriable Gowrishankar Muthukrishnan
2024-06-26  8:47   ` [PATCH v2 3/6] app/crypto-perf: fix result location for asymmetric test Gowrishankar Muthukrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).