[v2] app/crypto-perf: support security protocol in PMDCC mode

Message ID 20200721145648.29168-1-david.coyle@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] app/crypto-perf: support security protocol in PMDCC mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Coyle, David July 21, 2020, 2:56 p.m. UTC
  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(-)
  

Comments

Akhil Goyal July 28, 2020, 7:30 p.m. UTC | #1
> 
> 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>
  
Akhil Goyal July 29, 2020, 4:20 p.m. UTC | #2
> >
> > 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.
  

Patch

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 *