On container removal FRM does not uninstall flows 59/1159/1
authorAlessandro Boch <aboch@cisco.com>
Wed, 11 Sep 2013 16:35:36 +0000 (09:35 -0700)
committerAlessandro Boch <aboch@cisco.com>
Wed, 11 Sep 2013 16:52:08 +0000 (09:52 -0700)
commit6721c99eaa6c9d83d7469f243ec383046de467e6
tree27af5428f518cbe6a772791ac7cb6cbd05c34dd5
parenta8c1facc16de70e7ca2bcfd7a94d75f590c2fca4
On container removal FRM does not uninstall flows

ISSUE:
If a container had container flow specified, when it is removed FRM fails to uninstall
the flows that were installed in that container context

ROOT CAUSE:
On FRM stop(), the uninstallAllFlowEntries() function is called.
uninstallAllFlowEntries() does 2 things:
 1) it stores the original FlowEntry elements for later re-install irrespectively
it is called because FRM is being shutdown (container removal) or because controller
is moving to container mode (and this is the default container context) which is a bug.
 2) It uninstall the flows using the removeEntry(FlowEntry fe, ...) function which recomputes
the hw flows to be removed merging fe with the container flows for this container
returned by IContainer service, which is unefficient anyway.

Problem is that when FRM is being stopped because of container removal, IContainer service does no
longer have the container flows for the given container when queried by FRM.

FIX:
- Have uninstallAllFlowEntries() take a parameter to specify if the back up of the original flow entries is needed.
- Have uninstallAllFlowEntries() use the removeEntryInternal() to directly remove the FlowEntryInstall elements, because
  besides of the inefficinecy of recomputing the container flow merged entries there is really no need for it.
- Updated the java docs

Change-Id: If33d80f9593ee81fa58d84dea05514921e143225
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java