patch 'drivers/crypto: fix IPsec TTL decrement option' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:35:56 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/71476c8a7712ff6e4a530f856a5dc23d3c5ae152

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 71476c8a7712ff6e4a530f856a5dc23d3c5ae152 Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh at nxp.com>
Date: Thu, 18 Nov 2021 12:30:18 +0530
Subject: [PATCH] drivers/crypto: fix IPsec TTL decrement option

[ upstream commit 0aa5986c280f34893b2a6bacf044cff31484fe0c ]

dpaa, dpaa2 and caam_jr drivers decrement the inner IP header
TTL for all packets and ignoring the dec_ttl option of SA.

In this patch, using the dec_ttl to decide to decrement the
packets inner IP header TTL or not.

Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec")
Fixes: 3e33486f80a5 ("crypto/caam_jr: add security offload")
Fixes: 1f14d500bce1 ("crypto/dpaa_sec: support IPsec protocol offload")

Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 drivers/crypto/caam_jr/caam_jr.c            | 5 +++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 ++-
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 4 +++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 74bb3c3ed4..143dd9df76 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -1888,8 +1888,9 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 		session->encap_pdb.options =
 			(IPVERSION << PDBNH_ESP_ENCAP_SHIFT) |
 			PDBOPTS_ESP_OIHI_PDB_INL |
-			PDBOPTS_ESP_IVSRC |
-			PDBHMO_ESP_ENCAP_DTTL;
+			PDBOPTS_ESP_IVSRC;
+		if (ipsec_xform->options.dec_ttl)
+			session->encap_pdb.options |= PDBHMO_ESP_ENCAP_DTTL;
 		if (ipsec_xform->options.esn)
 			session->encap_pdb.options |= PDBOPTS_ESP_ESN;
 		session->encap_pdb.spi = ipsec_xform->spi;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index cebe590e67..e6691c6cd0 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -2834,8 +2834,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
 		encap_pdb.options = (IPVERSION << PDBNH_ESP_ENCAP_SHIFT) |
 			PDBOPTS_ESP_OIHI_PDB_INL |
 			PDBOPTS_ESP_IVSRC |
-			PDBHMO_ESP_ENCAP_DTTL |
 			PDBHMO_ESP_SNR;
+		if (ipsec_xform->options.dec_ttl)
+			encap_pdb.options |= PDBHMO_ESP_ENCAP_DTTL;
 		if (ipsec_xform->options.esn)
 			encap_pdb.options |= PDBOPTS_ESP_ESN;
 		encap_pdb.spi = ipsec_xform->spi;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index f5471120f3..1a4a296ae2 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2781,12 +2781,14 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 			session->encap_pdb.ip_hdr_len =
 						sizeof(struct rte_ipv6_hdr);
 		}
+
 		session->encap_pdb.options =
 			(IPVERSION << PDBNH_ESP_ENCAP_SHIFT) |
 			PDBOPTS_ESP_OIHI_PDB_INL |
 			PDBOPTS_ESP_IVSRC |
-			PDBHMO_ESP_ENCAP_DTTL |
 			PDBHMO_ESP_SNR;
+		if (ipsec_xform->options.dec_ttl)
+			session->encap_pdb.options |= PDBHMO_ESP_ENCAP_DTTL;
 		if (ipsec_xform->options.esn)
 			session->encap_pdb.options |= PDBOPTS_ESP_ESN;
 		session->encap_pdb.spi = ipsec_xform->spi;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:14.696736658 +0100
+++ 0152-drivers-crypto-fix-IPsec-TTL-decrement-option.patch	2021-11-30 16:50:06.130876025 +0100
@@ -1 +1 @@
-From 0aa5986c280f34893b2a6bacf044cff31484fe0c Mon Sep 17 00:00:00 2001
+From 71476c8a7712ff6e4a530f856a5dc23d3c5ae152 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0aa5986c280f34893b2a6bacf044cff31484fe0c ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 8c56610ac8..5909eca6e4 100644
+index 74bb3c3ed4..143dd9df76 100644
@@ -29 +30 @@
-@@ -1881,8 +1881,9 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
+@@ -1888,8 +1888,9 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
@@ -42 +43 @@
-index cb2ad435bf..2e8e4c6adf 100644
+index cebe590e67..e6691c6cd0 100644
@@ -45 +46 @@
-@@ -2935,8 +2935,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
+@@ -2834,8 +2834,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
@@ -57 +58 @@
-index 454b9c4785..9a7d5eb8b7 100644
+index f5471120f3..1a4a296ae2 100644
@@ -60 +61 @@
-@@ -2898,12 +2898,14 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
+@@ -2781,12 +2781,14 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,


More information about the stable mailing list