[VOL-4001] MPLS support in vOLTHA-Core
Change-Id: I6b46ccadbbccafe577d717d6fbf3ace7efa4d1aa
diff --git a/rw_core/flowdecomposition/flow_decomposer.go b/rw_core/flowdecomposition/flow_decomposer.go
index ab04891..5a1affd 100644
--- a/rw_core/flowdecomposition/flow_decomposer.go
+++ b/rw_core/flowdecomposition/flow_decomposer.go
@@ -320,11 +320,6 @@
return deviceRules, nil
}
- if flow.TableId != 0 {
- logger.Warnw(ctx, "This is not olt pipeline table, so skipping", log.Fields{"tableId": flow.TableId})
- return deviceRules, nil
- }
-
ingressHop := path[0]
egressHop := path[1]
if metadataFromwriteMetadata != 0 {
@@ -517,19 +512,25 @@
}
isUpstream := !ingressDevice.Root
if isUpstream { // Unicast OLT and ONU UL
- logger.Debug(ctx, "process-olt-nd-onu-upstream-noncontrollerbound-unicast-flows", log.Fields{"flows": flow})
+ logger.Debug(ctx, "process-olt-and-onu-upstream-non-controller-bound-uni-cast-flows", log.Fields{"flows": flow})
deviceRules, err = fd.processUpstreamNonControllerBoundFlow(ctx, path, inPortNo, outPortNo, flow)
if err != nil {
return nil, err
}
- } else if fu.HasNextTable(flow) && flow.TableId == 0 { // Unicast OLT flow DL
- logger.Debugw(ctx, "process-olt-downstream-noncontrollerbound-flow-with-nexttable", log.Fields{"flows": flow})
+ } else if fu.HasNextTable(flow) && (flow.GetTableId() == 0 || flow.GetTableId() == 1) { // Unicast OLT Flow
+ // For 'Non-MPLS' flows, this condition will only be true for table-id 0 as only table-id 0 will have the
+ // 'go-to-next-table' instruction
+ // For 'MPLS' flows, this condition will be true for table-id 0 and table-id 1.
+ // So the flow here shall always be an OLT flow
+ logger.Debugw(ctx, "process-olt-downstream-non-controller-bound-flow-with-next-table", log.Fields{"flows": flow})
deviceRules, err = fd.processDownstreamFlowWithNextTable(ctx, agent, path, inPortNo, outPortNo, flow)
if err != nil {
return nil, err
}
- } else if flow.TableId == 1 && outPortNo != 0 { // Unicast ONU flow DL
- logger.Debugw(ctx, "process-onu-downstream-unicast-flow", log.Fields{"flows": flow})
+ } else if (flow.GetTableId() == 1 || flow.GetTableId() == 2) && outPortNo != 0 { // Unicast ONU flow DL
+ // If this is an MPLS OLT flow (table-id 1, transition-to-table 2), the condition above will already be hit.
+ // So if we are reaching this point, the flow shall always be an ONU flow
+ logger.Debugw(ctx, "process-onu-downstream-uni-cast-flow", log.Fields{"flows": flow})
deviceRules, err = fd.processUnicastFlow(ctx, path, inPortNo, outPortNo, flow)
if err != nil {
return nil, err