Skip to content

Commit 1a04eaa

Browse files
Sean Condony-higuchi
authored andcommitted
Set push to s-tag and remove IPv4 from packet match
Change-Id: I8eaee994278ea3bf94f8af0e4431ee795b04d3cb
1 parent eb2976a commit 1a04eaa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetPacketNodeManager.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.apache.felix.scr.annotations.Reference;
2323
import org.apache.felix.scr.annotations.ReferenceCardinality;
2424
import org.apache.felix.scr.annotations.Service;
25-
import org.onlab.packet.Ethernet;
25+
import org.onlab.packet.EthType.EtherType;
2626
import org.onlab.packet.VlanId;
2727
import org.onosproject.core.ApplicationId;
2828
import org.onosproject.core.CoreService;
@@ -175,8 +175,13 @@ private void createFlowObjectives(CarrierEthernetForwardingConstruct fc, Carrier
175175
filterTreatmentBuilder.meter(deviceMeterId.meterId());
176176
}
177177
});
178-
// Push S-TAG of current FC on top of existing CE-VLAN ID
179-
filterTreatmentBuilder.pushVlan().setVlanId(fc.vlanId());
178+
// If a CE-VLAN-ID exists on the incoming packet then push an S-TAG of current FC on top
179+
// otherwise push it on as a C-tag
180+
if (ingressNi.ceVlanId() != null && ingressNi.ceVlanId() != VlanId.NONE) {
181+
filterTreatmentBuilder.pushVlan(EtherType.QINQ.ethType()).setVlanId(fc.vlanId());
182+
} else {
183+
filterTreatmentBuilder.pushVlan().setVlanId(fc.vlanId());
184+
}
180185
}
181186

182187
filteringObjectiveBuilder.addCondition(filterVlanIdCriterion);
@@ -196,7 +201,6 @@ private void createFlowObjectives(CarrierEthernetForwardingConstruct fc, Carrier
196201
TrafficSelector fwdSelector = DefaultTrafficSelector.builder()
197202
.matchVlanId(fc.vlanId())
198203
.matchInPort(ingressNi.cp().port())
199-
.matchEthType(Ethernet.TYPE_IPV4)
200204
.build();
201205

202206
Integer nextId = flowObjectiveService.allocateNextId();

0 commit comments

Comments
 (0)