patch 'app/crypto-perf: fix session freeing' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 07:58:37 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=bbba565c73c986a16612ac45389951fc570fe9cb

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj at marvell.com>
Date: Mon, 2 Jan 2023 17:16:53 +0530
Subject: [PATCH] app/crypto-perf: fix session freeing
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ]

Use the right API for session freeing. Sessions can be asymmetric,
symmetric or security.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")
Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test")

Signed-off-by: Anoob Joseph <anoobj at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 app/test-crypto-perf/cperf_test_latency.c | 27 +++++++++++++++++------
 app/test-crypto-perf/cperf_test_verify.c  | 25 ++++++++++++++++-----
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 49bf421c01..406e082e4e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -43,15 +43,28 @@ struct priv_op_data {
 static void
 cperf_latency_test_free(struct cperf_latency_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess)
-			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
-
-		rte_mempool_free(ctx->pool);
+	if (ctx == NULL)
+		return;

-		rte_free(ctx->res);
-		rte_free(ctx);
+	if (ctx->sess != NULL) {
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess);
+#ifdef RTE_LIB_SECURITY
+		else if (ctx->options->op_type == CPERF_PDCP ||
+			 ctx->options->op_type == CPERF_DOCSIS ||
+			 ctx->options->op_type == CPERF_IPSEC) {
+			struct rte_security_ctx *sec_ctx =
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx, ctx->sess);
+		}
+#endif
+		else
+			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
 	}
+
+	rte_mempool_free(ctx->pool);
+	rte_free(ctx->res);
+	rte_free(ctx);
 }

 void *
diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index c03e1d5ba5..8042c94e04 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -38,14 +38,27 @@ struct cperf_op_result {
 static void
 cperf_verify_test_free(struct cperf_verify_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess)
-			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
-
-		rte_mempool_free(ctx->pool);
+	if (ctx == NULL)
+		return;

-		rte_free(ctx);
+	if (ctx->sess != NULL) {
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess);
+#ifdef RTE_LIB_SECURITY
+		else if (ctx->options->op_type == CPERF_PDCP ||
+			 ctx->options->op_type == CPERF_DOCSIS ||
+			 ctx->options->op_type == CPERF_IPSEC) {
+			struct rte_security_ctx *sec_ctx =
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx, ctx->sess);
+		}
+#endif
+		else
+			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
 	}
+
+	rte_mempool_free(ctx->pool);
+	rte_free(ctx);
 }

 void *
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.320968600 +0800
+++ 0010-app-crypto-perf-fix-session-freeing.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From c5b531d6ee03e552301aa6295531ae2312a16c6e Mon Sep 17 00:00:00 2001
+From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list