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

Xueming Li xuemingl at nvidia.com
Sat Apr 13 14:49:15 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 90d0e13d7d2651f8a32c66378d23605cd664c446 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 debb7beb5f..3b32923fef 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1431,6 +1431,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 f5cec4a928..c321108119 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -288,10 +288,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 */
@@ -908,6 +919,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.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.299143126 +0800
+++ 0075-examples-ipsec-secgw-fix-cryptodev-to-SA-mapping.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From f406064ff0988a53f955c74a672d696c595dc0f0 Mon Sep 17 00:00:00 2001
+From 90d0e13d7d2651f8a32c66378d23605cd664c446 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 66ebc20666..50726e1232 100644
+index debb7beb5f..3b32923fef 100644
@@ -29 +31 @@
-@@ -1442,6 +1442,7 @@ Timothy McDaniel <timothy.mcdaniel at intel.com>
+@@ -1431,6 +1431,7 @@ Timothy McDaniel <timothy.mcdaniel at intel.com>


More information about the stable mailing list