From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <xuemingl@mellanox.com>
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 953211B8DE
 for <dev@dpdk.org>; Tue, 10 Apr 2018 15:00:59 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 xuemingl@mellanox.com)
 with ESMTPS (AES256-SHA encrypted); 10 Apr 2018 16:02:03 +0300
Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx
 [10.12.205.180])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w3AD0rOc029906;
 Tue, 10 Apr 2018 16:00:54 +0300
Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1])
 by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w3AD0rmQ188888;
 Tue, 10 Apr 2018 21:00:53 +0800
Received: (from xuemingl@localhost)
 by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w3AD0rRB188887;
 Tue, 10 Apr 2018 21:00:53 +0800
From: Xueming Li <xuemingl@mellanox.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>
Cc: Xueming Li <xuemingl@mellanox.com>,
 Nelio Laranjeiro <nelio.laranjeiro@6wind.com>,
 Shahaf Shuler <shahafs@mellanox.com>, dev@dpdk.org,
 Olivier Matz <olivier.matz@6wind.com>
Date: Tue, 10 Apr 2018 21:00:34 +0800
Message-Id: <20180410130036.188819-4-xuemingl@mellanox.com>
X-Mailer: git-send-email 2.13.3
In-Reply-To: <20180410130036.188819-1-xuemingl@mellanox.com>
References: <20180410130036.188819-1-xuemingl@mellanox.com>
In-Reply-To: <20180226150947.107179-2-xuemingl@mellanox.com>
References: <20180226150947.107179-2-xuemingl@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE
	and MPLS-in-UDP
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Apr 2018 13:01:00 -0000

This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.

MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023

MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++
 lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..10abfe89c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
 	case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
 	case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
 	case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+	case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+	case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
 	default: return "TUNNEL_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..a70cc7a4e 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
  */
 #define RTE_PTYPE_TUNNEL_VXLAN_GPE          0x0000b000
 /**
+ * MPLS-in-GRE tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE       0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP      0x0000d000
+/**
  * Mask of tunneling packet types.
  */
 #define RTE_PTYPE_TUNNEL_MASK               0x0000f000
-- 
2.13.3