[dpdk-dev] [PATCH v2 2/9] examples/ipsec-secgw: update SA parameters with L3 options

Radu Nicolau radu.nicolau at intel.com
Wed Sep 15 15:45:15 CEST 2021


Set the L3 offset and L3 length in the SA parameters

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

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 17a28556c9..7fb8fef264 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1316,11 +1316,15 @@ fill_ipsec_sa_prm(struct rte_ipsec_sa_prm *prm, const struct ipsec_sa *ss,
 
 	if (IS_IP4_TUNNEL(ss->flags)) {
 		prm->ipsec_xform.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4;
+		prm->tun.hdr_l3_len = sizeof(*v4);
+		prm->tun.hdr_l3_off = 0;
 		prm->tun.hdr_len = sizeof(*v4);
 		prm->tun.next_proto = rc;
 		prm->tun.hdr = v4;
 	} else if (IS_IP6_TUNNEL(ss->flags)) {
 		prm->ipsec_xform.tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV6;
+		prm->tun.hdr_l3_len = sizeof(*v6);
+		prm->tun.hdr_l3_off = 0;
 		prm->tun.hdr_len = sizeof(*v6);
 		prm->tun.next_proto = rc;
 		prm->tun.hdr = v6;
-- 
2.25.1



More information about the dev mailing list