Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com> --- ofproto/ofproto.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 30b1b97..b8f0e62 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1357,10 +1357,17 @@ ofproto_flush__(struct ofproto *ofproto) { struct oftable *table; + /* This will flush all datapath flows. */ if (ofproto->ofproto_class->flush) { ofproto->ofproto_class->flush(ofproto); } + /* XXX: There is a small race window here, where new datapath flows can be + * created by upcall handlers based on the existing flow table. We can not + * call ofproto class flush while holding 'ofproto_mutex' to prevent this, + * as then we could deadlock on syncing with the handler threads waiting on + * the same mutex. */ + ovs_mutex_lock(&ofproto_mutex); OFPROTO_FOR_EACH_TABLE (table, ofproto) { struct rule *rule; @@ -1373,6 +1380,9 @@ ofproto_flush__(struct ofproto *ofproto) ofproto_rule_delete__(rule, OFPRR_DELETE); } } + /* XXX: Concurrent handler threads may insert new learned flows based on + * learn actions of the now deleted flows right after we release + * 'ofproto_mutex'. */ ovs_mutex_unlock(&ofproto_mutex); } -- 1.7.10.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev