VOL-2330 Add Support for handling multicast groups in VOLTHA Core
Change-Id: I6a99319d8708ec4958690e696b6fd51b1dbe838b
diff --git a/rw_core/core/logical_device_agent.go b/rw_core/core/logical_device_agent.go
index e19d111..e0aac9d 100644
--- a/rw_core/core/logical_device_agent.go
+++ b/rw_core/core/logical_device_agent.go
@@ -1111,9 +1111,14 @@
if fu.FindGroup(groups, groupMod.GroupId) == -1 {
groups = append(groups, fu.GroupEntryFromGroupMod(groupMod))
- deviceRules := agent.flowDecomposer.DecomposeRules(agent, *lDevice.Flows, ofp.FlowGroups{Items: groups})
- log.Debugw("rules", log.Fields{"rules": deviceRules.String()})
- if err := agent.addDeviceFlowsAndGroups(deviceRules, nil); err != nil {
+ deviceRules := fu.NewDeviceRules()
+ deviceRules.CreateEntryIfNotExist(agent.rootDeviceID)
+ fg := fu.NewFlowsAndGroups()
+ fg.AddGroup(fu.GroupEntryFromGroupMod(groupMod))
+ deviceRules.AddFlowsAndGroup(agent.rootDeviceID, fg)
+
+ log.Debugw("rules", log.Fields{"rules for group-add": deviceRules.String()})
+ if err := agent.addDeviceFlowsAndGroups(deviceRules, &voltha.FlowMetadata{}); err != nil {
log.Errorw("failure-updating-device-flows", log.Fields{"logicalDeviceId": agent.logicalDeviceID, "error": err})
return err
}
@@ -1202,10 +1207,14 @@
groups[idx] = groupEntry
groupsChanged = true
if groupsChanged {
- deviceRules := agent.flowDecomposer.DecomposeRules(agent, ofp.Flows{Items: lDevice.Flows.Items}, ofp.FlowGroups{Items: groups})
- log.Debugw("rules", log.Fields{"rules": deviceRules.String()})
+ deviceRules := fu.NewDeviceRules()
+ deviceRules.CreateEntryIfNotExist(agent.rootDeviceID)
+ fg := fu.NewFlowsAndGroups()
+ fg.AddGroup(fu.GroupEntryFromGroupMod(groupMod))
+ deviceRules.AddFlowsAndGroup(agent.rootDeviceID, fg)
- if err := agent.updateDeviceFlowsAndGroups(deviceRules, nil); err != nil {
+ log.Debugw("rules", log.Fields{"rules for group-modify": deviceRules.String()})
+ if err := agent.updateDeviceFlowsAndGroups(deviceRules, &voltha.FlowMetadata{}); err != nil {
log.Errorw("failure-updating-device-flows-groups", log.Fields{"logicalDeviceId": agent.logicalDeviceID, "error": err})
return err
}