khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package flow_decomposition |
| 18 | |
| 19 | import ( |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 20 | "github.com/gogo/protobuf/proto" |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 21 | "github.com/opencord/voltha-go/common/log" |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 22 | "github.com/opencord/voltha-go/rw_core/coreIf" |
| 23 | "github.com/opencord/voltha-go/rw_core/graph" |
| 24 | fu "github.com/opencord/voltha-go/rw_core/utils" |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 25 | ofp "github.com/opencord/voltha-protos/go/openflow_13" |
| 26 | "github.com/opencord/voltha-protos/go/voltha" |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 27 | ) |
| 28 | |
| 29 | func init() { |
| 30 | log.AddPackage(log.JSON, log.DebugLevel, nil) |
| 31 | } |
| 32 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 33 | type FlowDecomposer struct { |
| 34 | deviceMgr coreIf.DeviceManager |
| 35 | } |
| 36 | |
| 37 | func NewFlowDecomposer(deviceMgr coreIf.DeviceManager) *FlowDecomposer { |
| 38 | var decomposer FlowDecomposer |
| 39 | decomposer.deviceMgr = deviceMgr |
| 40 | return &decomposer |
| 41 | } |
| 42 | |
| 43 | //DecomposeRules decomposes per-device flows and flow-groups from the flows and groups defined on a logical device |
khenaidoo | 3306c99 | 2019-05-24 16:57:35 -0400 | [diff] [blame] | 44 | func (fd *FlowDecomposer) DecomposeRules(agent coreIf.LogicalDeviceAgent, flows ofp.Flows, groups ofp.FlowGroups) *fu.DeviceRules { |
| 45 | deviceRules := *fu.NewDeviceRules() |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 46 | devicesToUpdate := make(map[string]string) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 47 | |
| 48 | groupMap := make(map[uint32]*ofp.OfpGroupEntry) |
| 49 | for _, groupEntry := range groups.Items { |
| 50 | groupMap[groupEntry.Desc.GroupId] = groupEntry |
| 51 | } |
| 52 | |
| 53 | var decomposedRules *fu.DeviceRules |
| 54 | for _, flow := range flows.Items { |
| 55 | decomposedRules = fd.decomposeFlow(agent, flow, groupMap) |
| 56 | for deviceId, flowAndGroups := range decomposedRules.Rules { |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 57 | deviceRules.CreateEntryIfNotExist(deviceId) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 58 | deviceRules.Rules[deviceId].AddFrom(flowAndGroups) |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 59 | devicesToUpdate[deviceId] = deviceId |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 60 | } |
| 61 | } |
khenaidoo | 3306c99 | 2019-05-24 16:57:35 -0400 | [diff] [blame] | 62 | return deviceRules.FilterRules(devicesToUpdate) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 63 | } |
| 64 | |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 65 | // Handles special case of any controller-bound flow for a parent device |
| 66 | func (fd *FlowDecomposer) updateOutputPortForControllerBoundFlowForParentDevide(flow *ofp.OfpFlowStats, |
| 67 | dr *fu.DeviceRules) *fu.DeviceRules { |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 68 | EAPOL := fu.EthType(0x888e) |
| 69 | IGMP := fu.IpProto(2) |
| 70 | UDP := fu.IpProto(17) |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 71 | |
| 72 | newDeviceRules := dr.Copy() |
| 73 | // Check whether we are dealing with a parent device |
| 74 | for deviceId, fg := range dr.GetRules() { |
| 75 | if root, _ := fd.deviceMgr.IsRootDevice(deviceId); root { |
| 76 | newDeviceRules.ClearFlows(deviceId) |
| 77 | for i := 0; i < fg.Flows.Len(); i++ { |
| 78 | f := fg.GetFlow(i) |
| 79 | UpdateOutPortNo := false |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 80 | for _, field := range fu.GetOfbFields(f) { |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 81 | UpdateOutPortNo = (field.String() == EAPOL.String()) |
| 82 | UpdateOutPortNo = UpdateOutPortNo || (field.String() == IGMP.String()) |
| 83 | UpdateOutPortNo = UpdateOutPortNo || (field.String() == UDP.String()) |
| 84 | if UpdateOutPortNo { |
| 85 | break |
| 86 | } |
| 87 | } |
| 88 | if UpdateOutPortNo { |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 89 | f = fu.UpdateOutputPortByActionType(f, uint32(ofp.OfpInstructionType_OFPIT_APPLY_ACTIONS), |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 90 | uint32(ofp.OfpPortNo_OFPP_CONTROLLER)) |
| 91 | } |
| 92 | // Update flow Id as a change in the instruction field will result in a new flow ID |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 93 | f.Id = fu.HashFlowStats(f) |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 94 | newDeviceRules.AddFlow(deviceId, (proto.Clone(f)).(*ofp.OfpFlowStats)) |
| 95 | } |
| 96 | } |
| 97 | } |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 98 | |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 99 | return newDeviceRules |
| 100 | } |
| 101 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 102 | //processControllerBoundFlow decomposes trap flows |
| 103 | func (fd *FlowDecomposer) processControllerBoundFlow(agent coreIf.LogicalDeviceAgent, route []graph.RouteHop, |
| 104 | inPortNo uint32, outPortNo uint32, flow *ofp.OfpFlowStats) *fu.DeviceRules { |
| 105 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 106 | log.Debugw("trap-flow", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo, "flow": flow}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 107 | deviceRules := fu.NewDeviceRules() |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 108 | meterId := fu.GetMeterIdFromFlow(flow) |
| 109 | metadataFromwriteMetadata := fu.GetMetadataFromWriteMetadataAction(flow) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 110 | |
| 111 | egressHop := route[1] |
| 112 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 113 | fg := fu.NewFlowsAndGroups() |
| 114 | if agent.GetDeviceGraph().IsRootPort(inPortNo) { |
| 115 | log.Debug("trap-nni") |
khenaidoo | 8f47419 | 2019-04-03 17:20:44 -0400 | [diff] [blame] | 116 | // no decomposition required - it is already an OLT flow from NNI |
| 117 | fg.AddFlow(flow) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 118 | } else { |
| 119 | // Trap flow for UNI port |
| 120 | log.Debug("trap-uni") |
| 121 | |
| 122 | //inPortNo is 0 for wildcard input case, do not include upstream port for 4000 flow in input |
| 123 | var inPorts []uint32 |
| 124 | if inPortNo == 0 { |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 125 | inPorts = agent.GetWildcardInputPorts(egressHop.Egress) // exclude egress_hop.egress_port.port_no |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 126 | } else { |
| 127 | inPorts = []uint32{inPortNo} |
| 128 | } |
| 129 | for _, inputPort := range inPorts { |
| 130 | var fa *fu.FlowArgs |
| 131 | // Upstream flow |
| 132 | fa = &fu.FlowArgs{ |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 133 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 134 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 135 | fu.InPort(egressHop.Ingress), |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 136 | fu.TunnelId(uint64(inputPort)), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 137 | }, |
| 138 | Actions: []*ofp.OfpAction{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 139 | fu.PushVlan(0x8100), |
| 140 | fu.SetField(fu.VlanVid(uint32(ofp.OfpVlanId_OFPVID_PRESENT) | 4000)), |
| 141 | fu.Output(egressHop.Egress), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 142 | }, |
| 143 | } |
| 144 | // Augment the matchfields with the ofpfields from the flow |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 145 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 146 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 147 | } |
| 148 | } |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 149 | deviceRules.AddFlowsAndGroup(egressHop.DeviceID, fg) |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 150 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 151 | return deviceRules |
| 152 | } |
| 153 | |
| 154 | // processUpstreamNonControllerBoundFlow processes non-controller bound flow. We assume that anything that is |
| 155 | // upstream needs to get Q-in-Q treatment and that this is expressed via two flow rules, the first using the |
| 156 | // goto-statement. We also assume that the inner tag is applied at the ONU, while the outer tag is |
| 157 | // applied at the OLT |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 158 | func (fd *FlowDecomposer) processUpstreamNonControllerBoundFlow(agent coreIf.LogicalDeviceAgent, |
| 159 | route []graph.RouteHop, inPortNo uint32, outPortNo uint32, flow *ofp.OfpFlowStats) *fu.DeviceRules { |
| 160 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 161 | log.Debugw("upstream-non-controller-bound-flow", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 162 | deviceRules := fu.NewDeviceRules() |
| 163 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 164 | meterId := fu.GetMeterIdFromFlow(flow) |
| 165 | metadataFromwriteMetadata := fu.GetMetadataFromWriteMetadataAction(flow) |
| 166 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 167 | ingressHop := route[0] |
| 168 | egressHop := route[1] |
| 169 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 170 | if flow.TableId == 0 && fu.HasNextTable(flow) { |
| 171 | log.Debugw("decomposing-onu-flow-in-upstream-has-next-table", log.Fields{"table_id": flow.TableId}) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 172 | if outPortNo != 0 { |
| 173 | log.Warnw("outPort-should-not-be-specified", log.Fields{"outPortNo": outPortNo}) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 174 | return deviceRules |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 175 | } |
| 176 | var fa *fu.FlowArgs |
| 177 | fa = &fu.FlowArgs{ |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 178 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 179 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 180 | fu.InPort(ingressHop.Ingress), |
| 181 | fu.TunnelId(uint64(inPortNo)), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 182 | }, |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 183 | Actions: fu.GetActions(flow), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 184 | } |
| 185 | // Augment the matchfields with the ofpfields from the flow |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 186 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 187 | |
| 188 | // Augment the Actions |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 189 | fa.Actions = append(fa.Actions, fu.Output(ingressHop.Egress)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 190 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 191 | fg := fu.NewFlowsAndGroups() |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 192 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 193 | deviceRules.AddFlowsAndGroup(ingressHop.DeviceID, fg) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 194 | } else if flow.TableId == 1 && outPortNo != 0 { |
| 195 | log.Debugw("decomposing-olt-flow-in-upstream-has-next-table", log.Fields{"table_id": flow.TableId}) |
| 196 | var fa *fu.FlowArgs |
| 197 | fa = &fu.FlowArgs{ |
| 198 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
| 199 | MatchFields: []*ofp.OfpOxmOfbField{ |
| 200 | fu.InPort(egressHop.Ingress), |
| 201 | fu.TunnelId(uint64(inPortNo)), |
| 202 | }, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 203 | } |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 204 | // Augment the matchfields with the ofpfields from the flow |
| 205 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 206 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 207 | //Augment the actions |
| 208 | filteredAction := fu.GetActions(flow, fu.OUTPUT) |
| 209 | filteredAction = append(filteredAction, fu.Output(egressHop.Egress)) |
| 210 | fa.Actions = filteredAction |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 211 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 212 | fg := fu.NewFlowsAndGroups() |
| 213 | fg.AddFlow(fu.MkFlowStat(fa)) |
| 214 | deviceRules.AddFlowsAndGroup(egressHop.DeviceID, fg) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 215 | } |
| 216 | return deviceRules |
| 217 | } |
| 218 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 219 | // processDownstreamFlowWithNextTable decomposes downstream flows containing next table ID instructions |
| 220 | func (fd *FlowDecomposer) processDownstreamFlowWithNextTable(agent coreIf.LogicalDeviceAgent, route []graph.RouteHop, |
| 221 | inPortNo uint32, outPortNo uint32, flow *ofp.OfpFlowStats) *fu.DeviceRules { |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 222 | log.Debugw("decomposing-olt-flow-in-downstream-flow-with-next-table", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 223 | deviceRules := fu.NewDeviceRules() |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 224 | meterId := fu.GetMeterIdFromFlow(flow) |
| 225 | metadataFromwriteMetadata := fu.GetMetadataFromWriteMetadataAction(flow) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 226 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 227 | if outPortNo != 0 { |
| 228 | log.Warnw("outPort-should-not-be-specified", log.Fields{"outPortNo": outPortNo}) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 229 | return deviceRules |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 230 | } |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 231 | |
| 232 | if flow.TableId != 0 { |
| 233 | log.Warnw("This is not olt pipeline table, so skipping", log.Fields{"tableId": flow.TableId}) |
| 234 | return deviceRules |
| 235 | } |
| 236 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 237 | ingressHop := route[0] |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 238 | egressHop := route[1] |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 239 | if metadataFromwriteMetadata != 0 { |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 240 | log.Debugw("creating-metadata-flow", log.Fields{"flow": flow}) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 241 | portNumber := fu.GetEgressPortNumberFromWriteMetadata(flow) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 242 | if portNumber != 0 { |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 243 | recalculatedRoute := agent.GetRoute(inPortNo, portNumber) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 244 | switch len(recalculatedRoute) { |
| 245 | case 0: |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 246 | log.Errorw("no-route-double-tag", log.Fields{"inPortNo": inPortNo, "outPortNo": portNumber, "comment": "deleting-flow", "metadata": metadataFromwriteMetadata}) |
| 247 | //TODO: Delete flow |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 248 | return deviceRules |
| 249 | case 2: |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 250 | log.Debugw("route-found", log.Fields{"ingressHop": ingressHop, "egressHop": egressHop}) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 251 | break |
| 252 | default: |
| 253 | log.Errorw("invalid-route-length", log.Fields{"routeLen": len(route)}) |
| 254 | return deviceRules |
| 255 | } |
| 256 | ingressHop = recalculatedRoute[0] |
| 257 | } |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 258 | innerTag := fu.GetInnerTagFromMetaData(flow) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 259 | if innerTag == 0 { |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 260 | log.Errorw("no-inner-route-double-tag", log.Fields{"inPortNo": inPortNo, "outPortNo": portNumber, "comment": "deleting-flow", "metadata": metadataFromwriteMetadata}) |
| 261 | //TODO: Delete flow |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 262 | return deviceRules |
| 263 | } |
| 264 | var fa *fu.FlowArgs |
| 265 | fa = &fu.FlowArgs{ |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 266 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 267 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 268 | fu.InPort(ingressHop.Ingress), |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 269 | fu.Metadata_ofp(uint64(innerTag)), |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 270 | fu.TunnelId(uint64(portNumber)), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 271 | }, |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 272 | Actions: fu.GetActions(flow), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 273 | } |
| 274 | // Augment the matchfields with the ofpfields from the flow |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 275 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT, fu.METADATA)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 276 | |
| 277 | // Augment the Actions |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 278 | fa.Actions = append(fa.Actions, fu.Output(ingressHop.Egress)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 279 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 280 | fg := fu.NewFlowsAndGroups() |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 281 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 282 | deviceRules.AddFlowsAndGroup(ingressHop.DeviceID, fg) |
| 283 | } else { // Create standard flow |
| 284 | log.Debugw("creating-standard-flow", log.Fields{"flow": flow}) |
| 285 | var fa *fu.FlowArgs |
| 286 | fa = &fu.FlowArgs{ |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 287 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 288 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 289 | fu.InPort(ingressHop.Ingress), |
| 290 | fu.TunnelId(uint64(inPortNo)), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 291 | }, |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 292 | Actions: fu.GetActions(flow), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 293 | } |
| 294 | // Augment the matchfields with the ofpfields from the flow |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 295 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 296 | |
| 297 | // Augment the Actions |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 298 | fa.Actions = append(fa.Actions, fu.Output(ingressHop.Egress)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 299 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 300 | fg := fu.NewFlowsAndGroups() |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 301 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 302 | deviceRules.AddFlowsAndGroup(ingressHop.DeviceID, fg) |
| 303 | } |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 304 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 305 | return deviceRules |
| 306 | } |
| 307 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 308 | // processUnicastFlow decomposes unicast flows |
| 309 | func (fd *FlowDecomposer) processUnicastFlow(agent coreIf.LogicalDeviceAgent, route []graph.RouteHop, |
| 310 | inPortNo uint32, outPortNo uint32, flow *ofp.OfpFlowStats) *fu.DeviceRules { |
| 311 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 312 | log.Debugw("decomposing-onu-flow-in-downstream-unicast-flow", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 313 | deviceRules := fu.NewDeviceRules() |
| 314 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 315 | egressHop := route[1] |
| 316 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 317 | meterId := fu.GetMeterIdFromFlow(flow) |
| 318 | metadataFromwriteMetadata := fu.GetMetadataFromWriteMetadataAction(flow) |
| 319 | var fa *fu.FlowArgs |
| 320 | fa = &fu.FlowArgs{ |
| 321 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie, "meter_id": uint64(meterId), "write_metadata": metadataFromwriteMetadata}, |
| 322 | MatchFields: []*ofp.OfpOxmOfbField{ |
| 323 | fu.InPort(egressHop.Ingress), |
| 324 | }, |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 325 | } |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 326 | // Augment the matchfields with the ofpfields from the flow |
| 327 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 328 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 329 | // Augment the Actions |
| 330 | filteredAction := fu.GetActions(flow, fu.OUTPUT) |
| 331 | filteredAction = append(filteredAction, fu.Output(egressHop.Egress)) |
| 332 | fa.Actions = filteredAction |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 333 | |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 334 | fg := fu.NewFlowsAndGroups() |
| 335 | fg.AddFlow(fu.MkFlowStat(fa)) |
| 336 | deviceRules.AddFlowsAndGroup(egressHop.DeviceID, fg) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 337 | return deviceRules |
| 338 | } |
| 339 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 340 | // processMulticastFlow decompose multicast flows |
| 341 | func (fd *FlowDecomposer) processMulticastFlow(agent coreIf.LogicalDeviceAgent, route []graph.RouteHop, |
| 342 | inPortNo uint32, outPortNo uint32, flow *ofp.OfpFlowStats, grpId uint32, |
| 343 | groupMap map[uint32]*ofp.OfpGroupEntry) *fu.DeviceRules { |
| 344 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 345 | log.Debugw("multicast-flow", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 346 | deviceRules := fu.NewDeviceRules() |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 347 | |
| 348 | //having no Group yet is the same as having a Group with no buckets |
| 349 | var grp *ofp.OfpGroupEntry |
| 350 | var ok bool |
| 351 | if grp, ok = groupMap[grpId]; !ok { |
| 352 | log.Warnw("Group-id-not-present-in-map", log.Fields{"grpId": grpId, "groupMap": groupMap}) |
| 353 | return deviceRules |
| 354 | } |
| 355 | if grp == nil || grp.Desc == nil { |
| 356 | log.Warnw("Group-or-desc-nil", log.Fields{"grpId": grpId, "grp": grp}) |
| 357 | return deviceRules |
| 358 | } |
| 359 | for _, bucket := range grp.Desc.Buckets { |
| 360 | otherActions := make([]*ofp.OfpAction, 0) |
| 361 | for _, action := range bucket.Actions { |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 362 | if action.Type == fu.OUTPUT { |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 363 | outPortNo = action.GetOutput().Port |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 364 | } else if action.Type != fu.POP_VLAN { |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 365 | otherActions = append(otherActions, action) |
| 366 | } |
| 367 | } |
| 368 | |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 369 | route2 := agent.GetRoute(inPortNo, outPortNo) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 370 | switch len(route2) { |
| 371 | case 0: |
| 372 | log.Errorw("mc-no-route", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo, "comment": "deleting flow"}) |
| 373 | // TODO: Delete flow |
| 374 | return deviceRules |
| 375 | case 2: |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 376 | log.Debugw("route-found", log.Fields{"ingressHop": route2[0], "egressHop": route2[1]}) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 377 | break |
| 378 | default: |
| 379 | log.Errorw("invalid-route-length", log.Fields{"routeLen": len(route)}) |
| 380 | return deviceRules |
| 381 | } |
| 382 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 383 | ingressHop := route[0] |
| 384 | ingressHop2 := route2[0] |
| 385 | egressHop := route2[1] |
| 386 | |
| 387 | if ingressHop.Ingress != ingressHop2.Ingress { |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 388 | log.Errorw("mc-ingress-hop-hop2-mismatch", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo, "comment": "ignoring flow"}) |
| 389 | return deviceRules |
| 390 | } |
| 391 | // Set the parent device flow |
| 392 | var fa *fu.FlowArgs |
| 393 | fa = &fu.FlowArgs{ |
| 394 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie}, |
| 395 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 396 | fu.InPort(ingressHop.Ingress), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 397 | }, |
| 398 | } |
| 399 | // Augment the matchfields with the ofpfields from the flow |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 400 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 401 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 402 | // Augment the Actions |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 403 | filteredAction := fu.GetActions(flow, fu.GROUP) |
| 404 | filteredAction = append(filteredAction, fu.PopVlan()) |
| 405 | filteredAction = append(filteredAction, fu.Output(route2[1].Ingress)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 406 | fa.Actions = filteredAction |
| 407 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 408 | fg := fu.NewFlowsAndGroups() |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 409 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 410 | deviceRules.AddFlowsAndGroup(ingressHop.DeviceID, fg) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 411 | |
| 412 | // Set the child device flow |
| 413 | fa = &fu.FlowArgs{ |
| 414 | KV: fu.OfpFlowModArgs{"priority": uint64(flow.Priority), "cookie": flow.Cookie}, |
| 415 | MatchFields: []*ofp.OfpOxmOfbField{ |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 416 | fu.InPort(egressHop.Ingress), |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 417 | }, |
| 418 | } |
| 419 | // Augment the matchfields with the ofpfields from the flow |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 420 | fa.MatchFields = append(fa.MatchFields, fu.GetOfbFields(flow, fu.IN_PORT, fu.VLAN_VID, fu.VLAN_PCP)...) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 421 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 422 | // Augment the Actions |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 423 | otherActions = append(otherActions, fu.Output(egressHop.Egress)) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 424 | fa.Actions = otherActions |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 425 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 426 | fg = fu.NewFlowsAndGroups() |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 427 | fg.AddFlow(fu.MkFlowStat(fa)) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 428 | deviceRules.AddFlowsAndGroup(egressHop.DeviceID, fg) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 429 | } |
| 430 | return deviceRules |
| 431 | } |
| 432 | |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 433 | // decomposeFlow decomposes a flow for a logical device into flows for each physical device |
| 434 | func (fd *FlowDecomposer) decomposeFlow(agent coreIf.LogicalDeviceAgent, flow *ofp.OfpFlowStats, |
| 435 | groupMap map[uint32]*ofp.OfpGroupEntry) *fu.DeviceRules { |
| 436 | |
khenaidoo | 68c930b | 2019-05-13 11:46:51 -0400 | [diff] [blame] | 437 | inPortNo := fu.GetInPort(flow) |
| 438 | outPortNo := fu.GetOutPort(flow) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 439 | deviceRules := fu.NewDeviceRules() |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 440 | route := agent.GetRoute(inPortNo, outPortNo) |
khenaidoo | 2c6a099 | 2019-04-29 13:46:56 -0400 | [diff] [blame] | 441 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 442 | switch len(route) { |
| 443 | case 0: |
| 444 | log.Errorw("no-route", log.Fields{"inPortNo": inPortNo, "outPortNo": outPortNo, "comment": "deleting-flow"}) |
| 445 | // TODO: Delete flow |
| 446 | return deviceRules |
| 447 | case 2: |
| 448 | log.Debugw("route-found", log.Fields{"ingressHop": route[0], "egressHop": route[1]}) |
| 449 | break |
| 450 | default: |
| 451 | log.Errorw("invalid-route-length", log.Fields{"routeLen": len(route)}) |
| 452 | return deviceRules |
| 453 | } |
| 454 | |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 455 | // Process controller bound flow |
| 456 | if outPortNo != 0 && (outPortNo&0x7fffffff) == uint32(ofp.OfpPortNo_OFPP_CONTROLLER) { |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 457 | deviceRules = fd.processControllerBoundFlow(agent, route, inPortNo, outPortNo, flow) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 458 | } else { |
khenaidoo | 297cd25 | 2019-02-07 22:10:23 -0500 | [diff] [blame] | 459 | var ingressDevice *voltha.Device |
| 460 | var err error |
| 461 | if ingressDevice, err = fd.deviceMgr.GetDevice(route[0].DeviceID); err != nil { |
| 462 | log.Errorw("ingress-device-not-found", log.Fields{"deviceId": route[0].DeviceID, "flow": flow}) |
| 463 | return deviceRules |
| 464 | } |
| 465 | isUpstream := !ingressDevice.Root |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 466 | if isUpstream { // Unicast OLT and ONU UL |
| 467 | log.Info("processOltAndOnuUpstreamNonControllerBoundUnicastFlows", log.Fields{"flows": flow}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 468 | deviceRules = fd.processUpstreamNonControllerBoundFlow(agent, route, inPortNo, outPortNo, flow) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 469 | } else if fu.HasNextTable(flow) && flow.TableId == 0 { // Unicast OLT flow DL |
| 470 | log.Debugw("processOltDownstreamNonControllerBoundFlowWithNextTable", log.Fields{"flows": flow}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 471 | deviceRules = fd.processDownstreamFlowWithNextTable(agent, route, inPortNo, outPortNo, flow) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 472 | } else if flow.TableId == 1 && outPortNo != 0 { // Unicast ONU flow DL |
| 473 | log.Debugw("processOnuDownstreamUnicastFlow", log.Fields{"flows": flow}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 474 | deviceRules = fd.processUnicastFlow(agent, route, inPortNo, outPortNo, flow) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 475 | } else if grpId := fu.GetGroup(flow); grpId != 0 && flow.TableId == 0 { //Multicast |
| 476 | log.Debugw("processMulticastFlow", log.Fields{"flows": flow}) |
khenaidoo | d20a585 | 2018-10-22 22:09:55 -0400 | [diff] [blame] | 477 | deviceRules = fd.processMulticastFlow(agent, route, inPortNo, outPortNo, flow, grpId, groupMap) |
Manikkaraj k | b1a1092 | 2019-07-29 12:10:34 -0400 | [diff] [blame] | 478 | } else { |
| 479 | log.Errorw("unknown-downstream-flow", log.Fields{"flow": *flow}) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 480 | } |
| 481 | } |
khenaidoo | 19d7b63 | 2018-10-30 10:49:50 -0400 | [diff] [blame] | 482 | deviceRules = fd.updateOutputPortForControllerBoundFlowForParentDevide(flow, deviceRules) |
khenaidoo | 89b0e94 | 2018-10-21 21:11:33 -0400 | [diff] [blame] | 483 | return deviceRules |
| 484 | } |