Adding Multisct traffic drop for un-programmed trees
Change-Id: If9615db254f69141d8d6f0da3e0b7ce7d154bd6b
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
index f53610a..6e7feca 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
@@ -138,6 +138,8 @@
protected static final int HIGHEST_PRIORITY = 0xffff;
protected static final int DEFAULT_PRIORITY = 0x8000;
+ // Priority Introduced for Mcast Drop Rules
+ protected static final int MIDDLE_PRIORITY = 0x4000;
protected static final int LOWEST_PRIORITY = 0x0;
protected static final int MPLS_L2_PORT_PRIORITY = 2;
@@ -521,7 +523,7 @@
ops.newStage();
for (FlowRule flowRule : flowRules) {
- log.trace("{} flow rules in TMAC table: {} for dev: {}",
+ log.debug(" {} flow rules in TMAC table: {} for dev: {}",
(install) ? "adding" : "removing", flowRules, deviceId);
if (install) {
ops = ops.add(flowRule);
@@ -959,19 +961,23 @@
TrafficTreatment.Builder treatment;
FlowRule rule;
+ int priority = (assignedVlan == null || assignedVlan == VlanId.ANY) ? MIDDLE_PRIORITY : DEFAULT_PRIORITY;
+
if (IPV4_MULTICAST.equals(ethCriterion.mac())) {
if (requireUnicastBeforeMulticast()) {
selector = DefaultTrafficSelector.builder();
treatment = DefaultTrafficTreatment.builder();
selector.matchEthType(Ethernet.TYPE_IPV4);
selector.matchEthDst(unicastMac);
- selector.matchVlanId(assignedVlan);
+ if (assignedVlan != null) {
+ selector.matchVlanId(assignedVlan);
+ }
treatment.transition(UNICAST_ROUTING_TABLE);
rule = DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
- .withPriority(DEFAULT_PRIORITY)
+ .withPriority(priority)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
@@ -982,13 +988,15 @@
treatment = DefaultTrafficTreatment.builder();
selector.matchEthType(Ethernet.TYPE_IPV4);
selector.matchEthDstMasked(ethCriterion.mac(), ethCriterion.mask());
- selector.matchVlanId(assignedVlan);
+ if (assignedVlan != null) {
+ selector.matchVlanId(assignedVlan);
+ }
treatment.transition(MULTICAST_ROUTING_TABLE);
rule = DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
- .withPriority(DEFAULT_PRIORITY)
+ .withPriority(priority)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
@@ -1001,13 +1009,15 @@
treatment = DefaultTrafficTreatment.builder();
selector.matchEthType(Ethernet.TYPE_IPV6);
selector.matchEthDst(unicastMac);
- selector.matchVlanId(assignedVlan);
+ if (assignedVlan != null) {
+ selector.matchVlanId(assignedVlan);
+ }
treatment.transition(UNICAST_ROUTING_TABLE);
rule = DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
- .withPriority(DEFAULT_PRIORITY)
+ .withPriority(priority)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
@@ -1018,13 +1028,15 @@
treatment = DefaultTrafficTreatment.builder();
selector.matchEthType(Ethernet.TYPE_IPV6);
selector.matchEthDstMasked(ethCriterion.mac(), ethCriterion.mask());
- selector.matchVlanId(assignedVlan);
+ if (assignedVlan != null) {
+ selector.matchVlanId(assignedVlan);
+ }
treatment.transition(MULTICAST_ROUTING_TABLE);
rule = DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
- .withPriority(DEFAULT_PRIORITY)
+ .withPriority(priority)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();