CORD-908 Remove VLAN MPLS workaround in OVS
* No longer pop VLAN before entering Unicast Routing and MPLS table.
* In MPLS label group, pop vlan first, push MPLS label and push back an arbitrary vlan.
The vlan will get overwritten in MPLS interface group.
* Deprecate OVS VLAN pipeline since this one will now support both scenario
* Introduce punt table
- Correctly determine whether vlan should be popped before sending to controller.
- The pop and punt will not affect deferred group since
it is done by group instead of apply action
- Prepare for upcoming trunk port support
Change-Id: I8a28821fdab28647f6871bc8ff2f006f6ac2b763
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
index 27fc791..3bb69fb 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2GroupHandler.java
@@ -164,6 +164,18 @@
return true;
}
+ /**
+ * Determines whether this pipeline requires popping VLAN before pushing MPLS.
+ * <p>
+ * If required, pop vlan before push mpls and add an arbitrary vlan back afterward.
+ * MPLS interface group will substitute the arbitrary VLAN with expected VLAN later on.
+ *
+ * @return true if this pipeline requires popping VLAN before pushing MPLS
+ */
+ protected boolean requireVlanPopBeforeMplsPush() {
+ return false;
+ }
+
protected void init(DeviceId deviceId, PipelinerContext context) {
this.deviceId = deviceId;
this.flowObjectiveStore = context.store();
@@ -940,6 +952,9 @@
}
// we need to add another group to this chain - the L3VPN group
TrafficTreatment.Builder l3vpnTtb = DefaultTrafficTreatment.builder();
+ if (requireVlanPopBeforeMplsPush()) {
+ l3vpnTtb.popVlan();
+ }
l3vpnTtb.pushMpls()
.setMpls(innermostLabel)
.group(new DefaultGroupId(onelabelGroupInfo.nextGroupDesc.givenGroupId()));
@@ -949,6 +964,9 @@
if (supportSetMplsBos()) {
l3vpnTtb.setMplsBos(true);
}
+ if (requireVlanPopBeforeMplsPush()) {
+ l3vpnTtb.pushVlan().setVlanId(VlanId.vlanId(VlanId.RESERVED));
+ }
GroupBucket l3vpnGrpBkt =
DefaultGroupBucket.createIndirectGroupBucket(l3vpnTtb.build());