[dpdk-dev,v6,1/8] mbuf: support GTP in software packet type parser

Message ID 1506662342-18966-2-git-send-email-beilei.xing@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xing, Beilei Sept. 29, 2017, 5:18 a.m. UTC
  Add support of GTP-C and GTP-U tunnels in rte_net_get_ptype().

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++
 lib/librte_mbuf/rte_mbuf_ptype.h | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
  

Comments

Sean Harte Sept. 29, 2017, 8:15 a.m. UTC | #1
On 29 September 2017 at 06:18, Beilei Xing <beilei.xing@intel.com> wrote:
> Add support of GTP-C and GTP-U tunnels in rte_net_get_ptype().
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>  lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++
>  lib/librte_mbuf/rte_mbuf_ptype.h | 24 ++++++++++++++++++++++++
>  2 files changed, 26 insertions(+)

<snip>

>  /**
> + * GTP-C (GPRS Tunnelling Protocol) control tunneling packet type.
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=17
> + * | 'destination port'=2123>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=17
> + * | 'destination port'=2123>
> + */
> +#define RTE_PTYPE_TUNNEL_GTPC               0x00007000

This isn't a good description of GTP-C. GTP-C messages have a source
port of 2123, or a destination port of 2123.

> +/**
> + * GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type.
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=17
> + * | 'destination port'=2152>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=17
> + * | 'destination port'=2152>
> + */
> +#define RTE_PTYPE_TUNNEL_GTPU               0x00008000
> +/**
>   * Mask of tunneling packet types.
>   */
>  #define RTE_PTYPE_TUNNEL_MASK               0x0000f000
> --
> 2.5.5
>
  
Xing, Beilei Sept. 29, 2017, 8:41 a.m. UTC | #2
> -----Original Message-----

> From: Sean Harte [mailto:seanbh@gmail.com]

> Sent: Friday, September 29, 2017 4:15 PM

> To: Xing, Beilei <beilei.xing@intel.com>

> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Chilikin, Andrey

> <andrey.chilikin@intel.com>; dev@dpdk.org

> Subject: Re: [dpdk-dev] [PATCH v6 1/8] mbuf: support GTP in software

> packet type parser

> 

> On 29 September 2017 at 06:18, Beilei Xing <beilei.xing@intel.com> wrote:

> > Add support of GTP-C and GTP-U tunnels in rte_net_get_ptype().

> >

> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>

> > Acked-by: Olivier Matz <olivier.matz@6wind.com>

> > ---

> >  lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++

> > lib/librte_mbuf/rte_mbuf_ptype.h | 24 ++++++++++++++++++++++++

> >  2 files changed, 26 insertions(+)

> 

> <snip>

> 

> >  /**

> > + * GTP-C (GPRS Tunnelling Protocol) control tunneling packet type.

> > + * Packet format:

> > + * <'ether type'=0x0800

> > + * | 'version'=4, 'protocol'=17

> > + * | 'destination port'=2123>

> > + * or,

> > + * <'ether type'=0x86DD

> > + * | 'version'=6, 'next header'=17

> > + * | 'destination port'=2123>

> > + */

> > +#define RTE_PTYPE_TUNNEL_GTPC               0x00007000

> 

> This isn't a good description of GTP-C. GTP-C messages have a source port of

> 2123, or a destination port of 2123.


Yes, will distinguish request and  response message.

> 

> > +/**

> > + * GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type.

> > + * Packet format:

> > + * <'ether type'=0x0800

> > + * | 'version'=4, 'protocol'=17

> > + * | 'destination port'=2152>

> > + * or,

> > + * <'ether type'=0x86DD

> > + * | 'version'=6, 'next header'=17

> > + * | 'destination port'=2152>

> > + */

> > +#define RTE_PTYPE_TUNNEL_GTPU               0x00008000

> > +/**

> >   * Mask of tunneling packet types.

> >   */

> >  #define RTE_PTYPE_TUNNEL_MASK               0x0000f000

> > --

> > 2.5.5

> >
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index e5c4fae..a450814 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -89,6 +89,8 @@  const char *rte_get_ptype_tunnel_name(uint32_t ptype)
 	case RTE_PTYPE_TUNNEL_NVGRE: return "TUNNEL_NVGRE";
 	case RTE_PTYPE_TUNNEL_GENEVE: return "TUNNEL_GENEVE";
 	case RTE_PTYPE_TUNNEL_GRENAT: return "TUNNEL_GRENAT";
+	case RTE_PTYPE_TUNNEL_GTPC: return "TUNNEL_GTPC";
+	case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
 	default: return "TUNNEL_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index acd70bb..eb7cd2c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -383,6 +383,30 @@  extern "C" {
  */
 #define RTE_PTYPE_TUNNEL_GRENAT             0x00006000
 /**
+ * GTP-C (GPRS Tunnelling Protocol) control tunneling packet type.
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=2123>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=2123>
+ */
+#define RTE_PTYPE_TUNNEL_GTPC               0x00007000
+/**
+ * GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type.
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=2152>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=2152>
+ */
+#define RTE_PTYPE_TUNNEL_GTPU               0x00008000
+/**
  * Mask of tunneling packet types.
  */
 #define RTE_PTYPE_TUNNEL_MASK               0x0000f000