[dpdk-dev,1/6] librte_ether:add NVGRE header

Message ID 1422243805-10906-2-git-send-email-jijiang.liu@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Jijiang Liu Jan. 26, 2015, 3:43 a.m. UTC
  Add NVGRE header and Transparent Ethernet Bridging Macro in rte_ether.h file.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_ether/rte_ether.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
  

Patch

diff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h
index 7e7d22c..cb36212 100644
--- a/lib/librte_ether/rte_ether.h
+++ b/lib/librte_ether/rte_ether.h
@@ -321,6 +321,17 @@  struct vxlan_hdr {
 	uint32_t vx_vni;   /**< VNI (24) + Reserved (8). */
 } __attribute__((__packed__));
 
+/**
+ * NVGRE protocol header.
+ * Contains the 16-bit flag, 16-bit protocol type, 24-bit Virtual
+ * Subnet ID, 8-bit FlowId.
+ */
+struct nvgre_hdr {
+	uint16_t flags; /**< Protocol flag. */
+	uint16_t prot_type; /**< Protocol type. */
+	uint32_t key; /**< VSID (24) + FlowID (8). */
+} __attribute__((__packed__));
+
 /* Ethernet frame types */
 #define ETHER_TYPE_IPv4 0x0800 /**< IPv4 Protocol. */
 #define ETHER_TYPE_IPv6 0x86DD /**< IPv6 Protocol. */
@@ -329,6 +340,7 @@  struct vxlan_hdr {
 #define ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */
 #define ETHER_TYPE_1588 0x88F7 /**< IEEE 802.1AS 1588 Precise Time Protocol. */
 #define ETHER_TYPE_SLOW 0x8809 /**< Slow protocols (LACP and Marker). */
+#define ETHER_TYPE_TEB  0x6558 /**< Transparent Ethernet Bridging. */
 
 #define ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr))
 /**< VXLAN tunnel header length. */