VOL-1489: Can now recieve flows incrementally
core can now deliver incremental flow updates
to the handler and flow mgr. successfully call openolt/bal
flow add for eap, dhcp, and lldp. BAL complains still about
downstream eap flow. likely due to ID problems.
Calculation of uni_id, onu_id needs additional
info from the decomposer.
Change-Id: Ic347e71501e6cf2bb0e93d42eaf0b6c709238fbd
diff --git a/python/adapters/openolt/openolt_device.py b/python/adapters/openolt/openolt_device.py
index beea0c7..17cc6ad 100644
--- a/python/adapters/openolt/openolt_device.py
+++ b/python/adapters/openolt/openolt_device.py
@@ -290,7 +290,7 @@
self.extra_args,
self.device_info)
self.platform = self.platform_class(self.log, self.resource_mgr)
- self.flow_mgr = self.flow_mgr_class(self.core_proxy, self.log,
+ self.flow_mgr = self.flow_mgr_class(self.core_proxy, self.adapter_proxy, self.log,
self.stub, self.device_id,
self.logical_device_id,
self.platform, self.resource_mgr)
@@ -967,23 +967,19 @@
yield self.adapter_agent.delete_port(self.device_id, port)
return
- def update_flow_table(self, flows):
- self.log.debug('No updates here now, all is done in logical flows '
- 'update')
+ def update_flow_table(self, flow_changes):
- def update_logical_flows(self, flows_to_add, flows_to_remove,
- device_rules_map):
+ self.log.debug("update_flow_table", flow_changes=flow_changes)
+
+ flows_to_add = flow_changes.to_add.items
+ flows_to_remove = flow_changes.to_remove.items
+
if not self.is_state_up():
self.log.info('The OLT is not up, we cannot update flows',
flows_to_add=[f.id for f in flows_to_add],
flows_to_remove=[f.id for f in flows_to_remove])
return
- try:
- self.flow_mgr.update_children_flows(device_rules_map)
- except Exception as e:
- self.log.error('Error updating children flows', error=e)
-
self.log.debug('logical flows update', flows_to_add=flows_to_add,
flows_to_remove=flows_to_remove)
@@ -1001,7 +997,8 @@
except Exception as e:
self.log.error('failed to remove flow', flow=flow, e=e)
- self.flow_mgr.repush_all_different_flows()
+ # TODO NEW CORE: Core keeps track of logical flows. no need to keep track. verify, especially olt reboot!
+ #self.flow_mgr.repush_all_different_flows()
# There has to be a better way to do this
def ip_hex(self, ip):