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

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:54:02 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/7626e554b849dfb4308a06d06f84f91d1c1143ca

Thanks.

Xueming Li <xuemingl at nvidia.com>

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

[ 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 3fb3fe0f8a..6fc8adf752 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -1881,8 +1881,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 9f189dd890..7e728d1cf7 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -2910,8 +2910,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 a958d00b46..f29e674c01 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2799,12 +2799,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-28 22:41:06.261589500 +0800
+++ 0058-drivers-crypto-fix-IPsec-TTL-decrement-option.patch	2021-11-28 22:41:03.400206198 +0800
@@ -1 +1 @@
-From 0aa5986c280f34893b2a6bacf044cff31484fe0c Mon Sep 17 00:00:00 2001
+From 7626e554b849dfb4308a06d06f84f91d1c1143ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 0aa5986c280f34893b2a6bacf044cff31484fe0c ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 8c56610ac8..5909eca6e4 100644
+index 3fb3fe0f8a..6fc8adf752 100644
@@ -42 +44 @@
-index cb2ad435bf..2e8e4c6adf 100644
+index 9f189dd890..7e728d1cf7 100644
@@ -45 +47 @@
-@@ -2935,8 +2935,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
+@@ -2910,8 +2910,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
@@ -57 +59 @@
-index 454b9c4785..9a7d5eb8b7 100644
+index a958d00b46..f29e674c01 100644
@@ -60 +62 @@
-@@ -2898,12 +2898,14 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
+@@ -2799,12 +2799,14 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,


More information about the stable mailing list