[ovs-dev] [PATCH 3/5] ofproto-dpif: Flush flows before dpif_recv_set_mask().

Jesse Gross jesse at nicira.com
Mon Sep 19 22:00:06 UTC 2011


Now that upcalls from the kernel use unicast sockets, we need to
tell the kernel where to send them explicitly.  This means that
when the switch is restarted it's necessary to take control of any
existing objects, which is done when the dpif listen mask becomes
non-zero.  Since we're going to blow away the flows anyways, we
might as well do it before going through the trouble of updating
all of them.
---
 ofproto/ofproto-dpif.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index bd976f7..47a9d29 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -465,6 +465,9 @@ construct(struct ofproto *ofproto_, int *n_tablesp)
     ofproto->max_ports = dpif_get_max_ports(ofproto->dpif);
     ofproto->n_matches = 0;
 
+    dpif_flow_flush(ofproto->dpif);
+    dpif_recv_purge(ofproto->dpif);
+
     error = dpif_recv_set_mask(ofproto->dpif,
                                ((1u << DPIF_UC_MISS) |
                                 (1u << DPIF_UC_ACTION) |
@@ -474,8 +477,6 @@ construct(struct ofproto *ofproto_, int *n_tablesp)
         dpif_close(ofproto->dpif);
         return error;
     }
-    dpif_flow_flush(ofproto->dpif);
-    dpif_recv_purge(ofproto->dpif);
 
     ofproto->netflow = NULL;
     ofproto->sflow = NULL;
-- 
1.7.4.1




More information about the dev mailing list