Before this commit, the ofproto-dpif-xlate module uses ovs-rcu to
postpone the destroy of previous configuration.  However, the delayed
close of object like 'struct netdev' could cause failure in immediate
re-add or reconfigure of the same device.

To fix the above issue, this commit makes the ofproto-dpif-xlate
module call ovsrcu_synchronize(), which waits for all threads
to finish the use of reference to previous config.  Then, the
module can just directly destroy the previous config.

Reported-by: Cian Ferriter <[email protected]>
Signed-off-by: Alex Wang <[email protected]>
---
 ofproto/ofproto-dpif-xlate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 53ec297..93b3de8 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -671,8 +671,8 @@ xlate_txn_commit(void)
     struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);
 
     ovsrcu_set(&xcfgp, new_xcfg);
-    ovsrcu_postpone(xlate_xcfg_free, xcfg);
-
+    ovsrcu_synchronize();
+    xlate_xcfg_free(xcfg);
     new_xcfg = NULL;
 }
 
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to