Skip to content

Commit 0ab4c27

Browse files
charlesmcchanCharles Chan
authored andcommitted
Added table miss flow for ovs-ofdpa punt table
Make sure packet in still happens even when filtering obj is absent. VLAN assignment won't happen in this case, meaning that whatever VLAN a packet carries is the original VLAN and therefore should be persisted. Change-Id: Ia005abe6354ad4008f88e7378ba4c06bc6b80c81
1 parent ce424ca commit 0ab4c27

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/OvsOfdpaPipeline.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ protected void initializePipeline() {
11481148
initTableMiss(MPLS_TABLE_1, ACL_TABLE, null);
11491149
initTableMiss(BRIDGING_TABLE, ACL_TABLE, null);
11501150
initTableMiss(ACL_TABLE, -1, null);
1151-
linkDiscoveryPuntTableRules();
1151+
initPuntTable();
11521152

11531153
initPopVlanPuntGroup();
11541154
}
@@ -1203,10 +1203,11 @@ public void onError(FlowRuleOperations ops) {
12031203
* that forward traffic to controller.
12041204
*
12051205
*/
1206-
private void linkDiscoveryPuntTableRules() {
1206+
private void initPuntTable() {
12071207
FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
12081208
TrafficTreatment treatment = DefaultTrafficTreatment.builder().punt().build();
12091209

1210+
// Add punt rule for LLDP and BDDP
12101211
TrafficSelector.Builder lldpSelector = DefaultTrafficSelector.builder();
12111212
lldpSelector.matchEthType(EthType.EtherType.LLDP.ethType().toShort());
12121213
FlowRule lldpRule = DefaultFlowRule.builder()
@@ -1231,14 +1232,26 @@ private void linkDiscoveryPuntTableRules() {
12311232
.forTable(PUNT_TABLE).build();
12321233
ops.add(bbdpRule);
12331234

1235+
// Add table miss flow rule
1236+
TrafficSelector.Builder defaultSelector = DefaultTrafficSelector.builder();
1237+
FlowRule defaultRule = DefaultFlowRule.builder()
1238+
.forDevice(deviceId)
1239+
.withSelector(defaultSelector.build())
1240+
.withTreatment(treatment)
1241+
.withPriority(LOWEST_PRIORITY)
1242+
.fromApp(driverId)
1243+
.makePermanent()
1244+
.forTable(PUNT_TABLE).build();
1245+
ops.add(defaultRule);
1246+
12341247
flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
12351248
@Override
12361249
public void onSuccess(FlowRuleOperations ops) {
1237-
log.info("Added lldp/bbdp rules for table {} on {}", PUNT_TABLE, deviceId);
1250+
log.info("Initialized table {} on {}", PUNT_TABLE, deviceId);
12381251
}
12391252
@Override
12401253
public void onError(FlowRuleOperations ops) {
1241-
log.warn("Failed to initialize lldp/bbdp rules for table {} on {}", PUNT_TABLE, deviceId);
1254+
log.warn("Failed to initialize table {} on {}", PUNT_TABLE, deviceId);
12421255
}
12431256
}));
12441257
}

0 commit comments

Comments
 (0)