From be8194bb5935141f12339085032da5d63f856f16 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 16 Sep 2011 09:50:35 -0700 Subject: [PATCH] ofproto-dpif: Flush flows before dpif_recv_set_mask(). 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 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index bd976f76..47a9d29e 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; -- 2.30.2