patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Mar 18 16:38:52 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

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/20/24. 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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/642fff58620371a9ee6a4ff01a8613dea76f59a5

Thanks.

Luca Boccassi

---
>From 642fff58620371a9ee6a4ff01a8613dea76f59a5 Mon Sep 17 00:00:00 2001
From: Radu Nicolau <radu.nicolau at intel.com>
Date: Tue, 27 Feb 2024 13:28:46 +0000
Subject: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping

[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ]

There are use cases where a SA should be able to use different
cryptodevs on different lcores, for example there can be cryptodevs
with just 1 qp per VF.
Hence, the check in create lookaside session function is relaxed.
Also added a check to verify that a CQP is available for the current lcore.

Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init")

Signed-off-by: Radu Nicolau <radu.nicolau at intel.com>
Tested-by: Ting-Kai Ku <ting-kai.ku at intel.com>
Acked-by: Ciara Power <ciara.power at intel.com>
Acked-by: Kai Ji <kai.ji at intel.com>
Acked-by: Anoob Joseph <anoobj at marvell.com>
---
 .mailmap                     |  1 +
 examples/ipsec-secgw/ipsec.c | 20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index 23f3d1ddf9..2ad5489046 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1374,6 +1374,7 @@ Timothy McDaniel <timothy.mcdaniel at intel.com>
 Timothy Miskell <timothy.miskell at intel.com>
 Timothy Redaelli <tredaelli at redhat.com>
 Tim Shearer <tim.shearer at overturenetworks.com>
+Ting-Kai Ku <ting-kai.ku at intel.com>
 Ting Xu <ting.xu at intel.com>
 Tiwei Bie <tiwei.bie at intel.com> <btw at mail.ustc.edu.cn>
 Todd Fujinaka <todd.fujinaka at intel.com>
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index 9b52d37b81..29cb3c4785 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -110,10 +110,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
 		if (cdev_id == RTE_CRYPTO_MAX_DEVS)
 			cdev_id = ipsec_ctx->tbl[cdev_id_qp].id;
 		else if (cdev_id != ipsec_ctx->tbl[cdev_id_qp].id) {
-			RTE_LOG(ERR, IPSEC,
-					"SA mapping to multiple cryptodevs is "
-					"not supported!");
-			return -EINVAL;
+			struct rte_cryptodev_info dev_info_1, dev_info_2;
+			rte_cryptodev_info_get(cdev_id, &dev_info_1);
+			rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id,
+					&dev_info_2);
+			if (dev_info_1.driver_id == dev_info_2.driver_id) {
+				RTE_LOG(WARNING, IPSEC,
+					"SA mapped to multiple cryptodevs for SPI %d\n",
+					sa->spi);
+
+			} else {
+				RTE_LOG(WARNING, IPSEC,
+					"SA mapped to multiple cryptodevs of different types for SPI %d\n",
+					sa->spi);
+
+			}
 		}
 
 		/* Store per core queue pair information */
@@ -758,6 +769,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
 			continue;
 		}
 
+		RTE_ASSERT(sa->cqp[ipsec_ctx->lcore_id] != NULL);
 		enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop);
 	}
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-18 12:58:39.358023200 +0000
+++ 0002-examples-ipsec-secgw-fix-cryptodev-to-SA-mapping.patch	2024-03-18 12:58:39.087344007 +0000
@@ -1 +1 @@
-From f406064ff0988a53f955c74a672d696c595dc0f0 Mon Sep 17 00:00:00 2001
+From 642fff58620371a9ee6a4ff01a8613dea76f59a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 66ebc20666..50726e1232 100644
+index 23f3d1ddf9..2ad5489046 100644
@@ -29 +30 @@
-@@ -1442,6 +1442,7 @@ Timothy McDaniel <timothy.mcdaniel at intel.com>
+@@ -1374,6 +1374,7 @@ Timothy McDaniel <timothy.mcdaniel at intel.com>
@@ -38 +39 @@
-index f5cec4a928..c321108119 100644
+index 9b52d37b81..29cb3c4785 100644
@@ -41 +42 @@
-@@ -288,10 +288,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
+@@ -110,10 +110,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
@@ -67 +68 @@
-@@ -908,6 +919,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
+@@ -758,6 +769,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,


More information about the stable mailing list