[ovs-dev,v1,5/5] userspace: add NSH support to vxlangpe

Submitted by Yang, Yi Y on April 20, 2017, 2:42 a.m.

Details

Message ID 1492656131-110100-6-git-send-email-yi.y.yang@intel.com
State New
Headers show

Commit Message

Yang, Yi Y April 20, 2017, 2:42 a.m.
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 lib/netdev-native-tnl.c | 6 ++++++
 lib/packets.h           | 1 +
 2 files changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index 76dd07e..ffbec57 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -527,6 +527,9 @@  netdev_vxlan_pop_header(struct dp_packet *packet)
             case VXLAN_GPE_NP_IPV6:
                 next_pt = PT_IPV6;
                 break;
+            case VXLAN_GPE_NP_NSH:
+                next_pt = PT_NSH;
+                break;
             case VXLAN_GPE_NP_ETHERNET:
                 next_pt = PT_ETH;
                 break;
@@ -586,6 +589,9 @@  netdev_vxlan_build_header(const struct netdev *netdev,
                 case ETH_TYPE_IPV6:
                     gpe->next_protocol = VXLAN_GPE_NP_IPV6;
                     break;
+                case ETH_TYPE_NSH:
+                    gpe->next_protocol = VXLAN_GPE_NP_NSH;
+                    break;
                 case ETH_TYPE_TEB:
                     gpe->next_protocol = VXLAN_GPE_NP_ETHERNET;
                     break;
diff --git a/lib/packets.h b/lib/packets.h
index e271246..78ea838 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -1145,6 +1145,7 @@  enum packet_type {
     PT_IPV6 = PACKET_TYPE(OFPHTN_ETHERTYPE, ETH_TYPE_IPV6),
     PT_MPLS = PACKET_TYPE(OFPHTN_ETHERTYPE, ETH_TYPE_MPLS),
     PT_MPLS_MC = PACKET_TYPE(OFPHTN_ETHERTYPE, ETH_TYPE_MPLS_MCAST),
+    PT_NSH  = PACKET_TYPE(OFPHTN_ETHERTYPE, ETH_TYPE_NSH),
     PT_UNKNOWN = PACKET_TYPE(0xffff, 0xffff),   /* Unknown packet type. */
 };