mbuf: support GTP in software packet type parser
authorBeilei Xing <beilei.xing@intel.com>
Thu, 5 Oct 2017 08:14:51 +0000 (16:14 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:50 +0000 (02:49 +0200)
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>
Reviewed-by: Seán Harte <seanbh@gmail.com>
lib/librte_mbuf/rte_mbuf_ptype.c
lib/librte_mbuf/rte_mbuf_ptype.h

index e5c4fae..a450814 100644 (file)
@@ -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";
        }
 }
index acd70bb..978c4a2 100644 (file)
@@ -382,6 +382,38 @@ extern "C" {
  * capability.
  */
 #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>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'source port'=2123>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'source 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.
  */