examples/ipsec-secgw: fix ESN setting

Message ID 20220614124313.1562369-1-radu.nicolau@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series examples/ipsec-secgw: fix ESN setting |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Radu Nicolau June 14, 2022, 12:43 p.m. UTC
  Fix ESN option flag and initial value for the rte_ipsec library path.

Fixes: 560029d5cfc9 ("examples/ipsec-secgw: define initial ESN value")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/ipsec-secgw/sa.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Fan Zhang June 14, 2022, 3:43 p.m. UTC | #1
> -----Original Message-----
> From: Radu Nicolau <radu.nicolau@intel.com>
> Sent: Tuesday, June 14, 2022 1:43 PM
> To: Nicolau, Radu <radu.nicolau@intel.com>; Akhil Goyal <gakhil@marvell.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] examples/ipsec-secgw: fix ESN setting
> 
> Fix ESN option flag and initial value for the rte_ipsec library path.
> 
> Fixes: 560029d5cfc9 ("examples/ipsec-secgw: define initial ESN value")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
>  examples/ipsec-secgw/sa.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
> index 0b27f11fc0..8505a676ef 100644
> --- a/examples/ipsec-secgw/sa.c
> +++ b/examples/ipsec-secgw/sa.c
> @@ -1488,6 +1488,11 @@ fill_ipsec_sa_prm(struct rte_ipsec_sa_prm *prm,
> const struct ipsec_sa *ss,
>  	prm->ipsec_xform.options.ecn = 1;
>  	prm->ipsec_xform.options.copy_dscp = 1;
> 
> +	if (ss->esn > 0) {
> +		prm->ipsec_xform.options.esn = 1;
> +		prm->ipsec_xform.esn.value = ss->esn;
> +	}
> +
>  	if (IS_IP4_TUNNEL(ss->flags)) {
>  		prm->ipsec_xform.tunnel.type =
> RTE_SECURITY_IPSEC_TUNNEL_IPV4;
>  		prm->tun.hdr_len = sizeof(*v4);
> --
> 2.25.1

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal June 15, 2022, 3:11 p.m. UTC | #2
> >
> > Fix ESN option flag and initial value for the rte_ipsec library path.
> >
> > Fixes: 560029d5cfc9 ("examples/ipsec-secgw: define initial ESN value")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 0b27f11fc0..8505a676ef 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1488,6 +1488,11 @@  fill_ipsec_sa_prm(struct rte_ipsec_sa_prm *prm, const struct ipsec_sa *ss,
 	prm->ipsec_xform.options.ecn = 1;
 	prm->ipsec_xform.options.copy_dscp = 1;
 
+	if (ss->esn > 0) {
+		prm->ipsec_xform.options.esn = 1;
+		prm->ipsec_xform.esn.value = ss->esn;
+	}
+
 	if (IS_IP4_TUNNEL(ss->flags)) {
 		prm->ipsec_xform.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4;
 		prm->tun.hdr_len = sizeof(*v4);