Don't do the shortest path computation when adding flows via
method FlowManager::addAndMaintainShortestPathFlow()
Instead, let the Flow reconciliation thread to it.
This should add-back the speeding of adding flows that are suppose
to be monitored by ONOS,
Reference: commit 3739fa44b5603579ced3f21cdd443f35c5ff19aa
fixed a bug, but adding of flows was slower.
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
index fc94260..51c39a0 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
@@ -1232,44 +1232,15 @@
*/
@Override
public FlowPath addAndMaintainShortestPathFlow(FlowPath flowPath) {
- String dataPathSummaryStr = null;
-
//
- // Do the shortest path computation
+ // Don't do the shortest path computation here.
+ // Instead, let the Flow reconciliation thread take care of it.
//
- DataPath dataPath =
- topoRouteService.getShortestPath(flowPath.dataPath().srcPort(),
- flowPath.dataPath().dstPort());
- if (dataPath == null) {
- // We need the DataPath to populate the Network MAP
- dataPath = new DataPath();
- dataPath.setSrcPort(flowPath.dataPath().srcPort());
- dataPath.setDstPort(flowPath.dataPath().dstPort());
- }
- // Compute the Data Path summary
- dataPathSummaryStr = dataPath.dataPathSummary();
-
- //
- // Set the incoming port matching and the outgoing port output
- // actions for each flow entry.
- //
- for (FlowEntry flowEntry : dataPath.flowEntries()) {
- // Set the incoming port matching
- FlowEntryMatch flowEntryMatch = new FlowEntryMatch();
- flowEntry.setFlowEntryMatch(flowEntryMatch);
- flowEntryMatch.enableInPort(flowEntry.inPort());
-
- // Set the outgoing port output action
- ArrayList<FlowEntryAction> flowEntryActions = flowEntry.flowEntryActions();
- if (flowEntryActions == null) {
- flowEntryActions = new ArrayList<FlowEntryAction>();
- flowEntry.setFlowEntryActions(flowEntryActions);
- }
- FlowEntryAction flowEntryAction = new FlowEntryAction();
- flowEntryAction.setActionOutput(flowEntry.outPort());
- flowEntryActions.add(flowEntryAction);
- }
+ // We need the DataPath to populate the Network MAP
+ DataPath dataPath = new DataPath();
+ dataPath.setSrcPort(flowPath.dataPath().srcPort());
+ dataPath.setDstPort(flowPath.dataPath().dstPort());
//
// Prepare the computed Flow Path
@@ -1281,6 +1252,7 @@
computedFlowPath.setFlowEntryMatch(new FlowEntryMatch(flowPath.flowEntryMatch()));
FlowId flowId = new FlowId();
+ String dataPathSummaryStr = dataPath.dataPathSummary();
if (! addFlow(computedFlowPath, flowId, dataPathSummaryStr))
return null;