Folks,

As stated in the first email in this patch series:

"
4) Applications must now inform the core that they have "taken ownership" of a 
Datapath object.
Previously, Datapaths could “leak” if they did not make it through the OpenFlow 
handshake. I have addressed this by adding a timer that disconnects any 
Datapath that is not claimed by an application after a certain interval 
(currently statically defined at 20 seconds - but it could be made 
user-configurable).
An application that wishes to ensure that Datapaths are properly cleaned up 
(and do not disappear out from under them) should:
i) Have a structure keeping track of what Datapaths it “owns."
ii) When handling the an EventOFPSwitchFeatures in the CONFIG_DISPATCHER, or 
any event in the MAIN_DISPATCHER, the application should ensure that the 
datapath has been tracked in its internal record-keeping structure, and set the 
“assured” field of the Datapath object to “True”.
iii) When the application discovers duplicate records for a given Datapath 
(during handling of a new Datapath having the same DPID) in its internal 
structure, it should call the close() method of the old Datapath, after first 
recording the new Datapath in its internal record-keeping structure.

Applications that do not set the “assured” field of a Datapath will find that 
the Datapath will be closed underneath them by the Ryu core.
Applications using ryu.controller.dpset or ryu.topology.switches will find that 
this has been automatically handled for them.
Furthermore, another of the patches in this series ensures that all sample 
applications have been patched.
“

I believe that this patch *partially* fixes the VRRP service shipped with Ryu 
to follow these new semantics.
I do not know how the VRRP service tracks datapaths internally, so that it can 
properly call close() on Datapath objects that are stale.

Signed-off-by: Victor J. Orlikowski <[email protected]>

diff --git a/ryu/services/protocols/vrrp/monitor_openflow.py 
b/ryu/services/protocols/vrrp/monitor_openflow.py
index 32e691e..e1e4c8d 100644
--- a/ryu/services/protocols/vrrp/monitor_openflow.py
+++ b/ryu/services/protocols/vrrp/monitor_openflow.py
@@ -59,6 +59,7 @@ class 
VRRPInterfaceMonitorOpenFlow(monitor.VRRPInterfaceMonitor):
                               dpid_lib.dpid_to_str(dpid),
                               dpid_lib.dpid_to_str(self.interface.dpid))
             return
+        datapath.assured = True
 
         in_port = None
         for field in msg.match.fields:
diff --git a/ryu/services/protocols/vrrp/sample_router.py 
b/ryu/services/protocols/vrrp/sample_router.py
index 8a057c9..198cab4 100644
--- a/ryu/services/protocols/vrrp/sample_router.py
+++ b/ryu/services/protocols/vrrp/sample_router.py
@@ -449,6 +449,7 @@ class RouterIPV4OpenFlow(RouterIPV4):
         dpid = datapath.dpid
         if dpid != self.interface.dpid:
             return
+        datapath.assured = True
 
         for field in msg.match.fields:
             header = field.header


Best,
Victor
--
Victor J. Orlikowski <> vjo@[cs.]duke.edu

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to