DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] app/crypto-perf: support security protocol in PMDCC mode
@ 2020-07-20 15:39 David Coyle
  2020-07-21 14:56 ` [dpdk-dev] [PATCH v2] " David Coyle
  0 siblings, 1 reply; 4+ messages in thread
From: David Coyle @ 2020-07-20 15:39 UTC (permalink / raw)
  To: akhil.goyal, declan.doherty, pablo.de.lara.guarch, fiona.trahe
  Cc: dev, brendan.ryan, mairtin.oloingsigh, David Coyle

This patch adds support for DOCSIS and PDCP security protocols to the
pmd-cyclecount mode of the crypto performance tool. Adding this support
involves freeing the correct session type (i.e. security or cryptodev
session) when the test ends, depending on the op_type specificed.

Signed-off-by: David Coyle <david.coyle@intel.com>
---
 .../cperf_test_pmd_cyclecount.c               | 33 +++++++++++++------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 74371faa8..69f0943d1 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -59,23 +59,36 @@ static const uint16_t iv_offset =
 static void
 cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess) {
+	if (!ctx)
+		return;
+
+	if (ctx->sess) {
+#ifdef RTE_LIBRTE_SECURITY
+		if (ctx->options->op_type == CPERF_PDCP ||
+				ctx->options->op_type == CPERF_DOCSIS) {
+			struct rte_security_ctx *sec_ctx =
+				(struct rte_security_ctx *)
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx,
+				(struct rte_security_session *)ctx->sess);
+		} else
+#endif
+		{
 			rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
 			rte_cryptodev_sym_session_free(ctx->sess);
 		}
+	}
 
-		if (ctx->pool)
-			rte_mempool_free(ctx->pool);
+	if (ctx->pool)
+		rte_mempool_free(ctx->pool);
 
-		if (ctx->ops)
-			rte_free(ctx->ops);
+	if (ctx->ops)
+		rte_free(ctx->ops);
 
-		if (ctx->ops_processed)
-			rte_free(ctx->ops_processed);
+	if (ctx->ops_processed)
+		rte_free(ctx->ops_processed);
 
-		rte_free(ctx);
-	}
+	rte_free(ctx);
 }
 
 void *
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2] app/crypto-perf: support security protocol in PMDCC mode
  2020-07-20 15:39 [dpdk-dev] [PATCH v1] app/crypto-perf: support security protocol in PMDCC mode David Coyle
@ 2020-07-21 14:56 ` David Coyle
  2020-07-28 19:30   ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: David Coyle @ 2020-07-21 14:56 UTC (permalink / raw)
  To: akhil.goyal, declan.doherty, pablo.de.lara.guarch, fiona.trahe
  Cc: dev, brendan.ryan, mairtin.oloingsigh, David Coyle

This patch adds support for DOCSIS and PDCP security protocols to the
pmd-cyclecount mode of the crypto performance tool. Adding this support
involves freeing the correct session type (i.e. security or cryptodev
session) when the test ends, depending on the op_type specified.

Signed-off-by: David Coyle <david.coyle@intel.com>
---
v2:
* Fixing typo in commit message (specified)

 .../cperf_test_pmd_cyclecount.c               | 33 +++++++++++++------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 74371faa8..69f0943d1 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -59,23 +59,36 @@ static const uint16_t iv_offset =
 static void
 cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess) {
+	if (!ctx)
+		return;
+
+	if (ctx->sess) {
+#ifdef RTE_LIBRTE_SECURITY
+		if (ctx->options->op_type == CPERF_PDCP ||
+				ctx->options->op_type == CPERF_DOCSIS) {
+			struct rte_security_ctx *sec_ctx =
+				(struct rte_security_ctx *)
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx,
+				(struct rte_security_session *)ctx->sess);
+		} else
+#endif
+		{
 			rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
 			rte_cryptodev_sym_session_free(ctx->sess);
 		}
+	}
 
-		if (ctx->pool)
-			rte_mempool_free(ctx->pool);
+	if (ctx->pool)
+		rte_mempool_free(ctx->pool);
 
-		if (ctx->ops)
-			rte_free(ctx->ops);
+	if (ctx->ops)
+		rte_free(ctx->ops);
 
-		if (ctx->ops_processed)
-			rte_free(ctx->ops_processed);
+	if (ctx->ops_processed)
+		rte_free(ctx->ops_processed);
 
-		rte_free(ctx);
-	}
+	rte_free(ctx);
 }
 
 void *
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v2] app/crypto-perf: support security protocol in PMDCC mode
  2020-07-21 14:56 ` [dpdk-dev] [PATCH v2] " David Coyle
@ 2020-07-28 19:30   ` Akhil Goyal
  2020-07-29 16:20     ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Akhil Goyal @ 2020-07-28 19:30 UTC (permalink / raw)
  To: David Coyle, declan.doherty, pablo.de.lara.guarch, fiona.trahe
  Cc: dev, brendan.ryan, mairtin.oloingsigh

> 
> This patch adds support for DOCSIS and PDCP security protocols to the
> pmd-cyclecount mode of the crypto performance tool. Adding this support
> involves freeing the correct session type (i.e. security or cryptodev
> session) when the test ends, depending on the op_type specified.
> 
> Signed-off-by: David Coyle <david.coyle@intel.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

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

* Re: [dpdk-dev] [PATCH v2] app/crypto-perf: support security protocol in PMDCC mode
  2020-07-28 19:30   ` Akhil Goyal
@ 2020-07-29 16:20     ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2020-07-29 16:20 UTC (permalink / raw)
  To: Akhil Goyal, David Coyle, declan.doherty, pablo.de.lara.guarch,
	fiona.trahe
  Cc: dev, brendan.ryan, mairtin.oloingsigh

> >
> > This patch adds support for DOCSIS and PDCP security protocols to the
> > pmd-cyclecount mode of the crypto performance tool. Adding this support
> > involves freeing the correct session type (i.e. security or cryptodev
> > session) when the test ends, depending on the op_type specified.
> >
> > Signed-off-by: David Coyle <david.coyle@intel.com>
> > ---
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

This patch was applied yesterday. Forgot to send the mail.

Thanks.

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

end of thread, other threads:[~2020-07-29 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 15:39 [dpdk-dev] [PATCH v1] app/crypto-perf: support security protocol in PMDCC mode David Coyle
2020-07-21 14:56 ` [dpdk-dev] [PATCH v2] " David Coyle
2020-07-28 19:30   ` Akhil Goyal
2020-07-29 16:20     ` Akhil Goyal

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).