DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/ipsec-secgw: update mbuf packet type
@ 2017-12-14  7:05 Akhil Goyal
  2018-01-16 16:11 ` Nicolau, Radu
  0 siblings, 1 reply; 3+ messages in thread
From: Akhil Goyal @ 2017-12-14  7:05 UTC (permalink / raw)
  To: dev
  Cc: pablo.de.lara.guarch, hemant.agrawal, sergio.gonzalez.monroy,
	radu.nicolau, Akhil Goyal

Packet_type should be updated to remove/add L4 type for
encrypted/decrypted packet

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 examples/ipsec-secgw/ipip.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipip.h b/examples/ipsec-secgw/ipip.h
index 93393d5..9267618 100644
--- a/examples/ipsec-secgw/ipip.h
+++ b/examples/ipsec-secgw/ipip.h
@@ -103,7 +103,7 @@ ipip_outbound(struct rte_mbuf *m, uint32_t offset, uint32_t is_ipv6,
 
 	outip4->ip_src.s_addr = src->ip.ip4;
 	outip4->ip_dst.s_addr = dst->ip.ip4;
-
+	m->packet_type &= ~RTE_PTYPE_L4_MASK;
 	return outip4;
 }
 
@@ -169,6 +169,11 @@ ipip_inbound(struct rte_mbuf *m, uint32_t offset)
 			ip4_ecn_setup(inip4);
 		/* XXX This should be done by the forwarding engine instead */
 		inip4->ip_ttl -= 1;
+		m->packet_type &= ~RTE_PTYPE_L4_MASK;
+		if (inip4->ip_p == IPPROTO_UDP)
+			m->packet_type |= RTE_PTYPE_L4_UDP;
+		else if (inip4->ip_p == IPPROTO_TCP)
+			m->packet_type |= RTE_PTYPE_L4_TCP;
 	} else {
 		inip6 = (struct ip6_hdr *)inip4;
 		if (set_ecn)
-- 
2.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: update mbuf packet type
  2017-12-14  7:05 [dpdk-dev] [PATCH] examples/ipsec-secgw: update mbuf packet type Akhil Goyal
@ 2018-01-16 16:11 ` Nicolau, Radu
  2018-01-17 16:25   ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolau, Radu @ 2018-01-16 16:11 UTC (permalink / raw)
  To: Akhil Goyal, dev
  Cc: De Lara Guarch, Pablo, hemant.agrawal, Gonzalez Monroy, Sergio


> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Thursday, December 14, 2017 7:06 AM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> hemant.agrawal@nxp.com; Gonzalez Monroy, Sergio
> <sergio.gonzalez.monroy@intel.com>; Nicolau, Radu
> <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>
> Subject: [PATCH] examples/ipsec-secgw: update mbuf packet type
> 
> Packet_type should be updated to remove/add L4 type for
> encrypted/decrypted packet
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
Acked-by: Radu Nicolau <radu.nicolau@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: update mbuf packet type
  2018-01-16 16:11 ` Nicolau, Radu
@ 2018-01-17 16:25   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2018-01-17 16:25 UTC (permalink / raw)
  To: Nicolau, Radu, Akhil Goyal, dev; +Cc: hemant.agrawal, Gonzalez Monroy, Sergio



> -----Original Message-----
> From: Nicolau, Radu
> Sent: Tuesday, January 16, 2018 4:12 PM
> To: Akhil Goyal <akhil.goyal@nxp.com>; dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> hemant.agrawal@nxp.com; Gonzalez Monroy, Sergio
> <sergio.gonzalez.monroy@intel.com>
> Subject: RE: [PATCH] examples/ipsec-secgw: update mbuf packet type
> 
> 
> > -----Original Message-----
> > From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> > Sent: Thursday, December 14, 2017 7:06 AM
> > To: dev@dpdk.org
> > Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> > hemant.agrawal@nxp.com; Gonzalez Monroy, Sergio
> > <sergio.gonzalez.monroy@intel.com>; Nicolau, Radu
> > <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>
> > Subject: [PATCH] examples/ipsec-secgw: update mbuf packet type
> >
> > Packet_type should be updated to remove/add L4 type for
> > encrypted/decrypted packet
> >
> > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> > ---
> Acked-by: Radu Nicolau <radu.nicolau@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-17 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14  7:05 [dpdk-dev] [PATCH] examples/ipsec-secgw: update mbuf packet type Akhil Goyal
2018-01-16 16:11 ` Nicolau, Radu
2018-01-17 16:25   ` De Lara Guarch, Pablo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).