add a rcu_barrier before close_dpif_backer to ensure that
all meters has been freed before id_pool_destory meter's
id-pool.

Signed-off-by: Peng He <[email protected]>
---
 ofproto/ofproto-dpif.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index a4c44052d..1739544e5 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1797,6 +1797,16 @@ add_internal_flows(struct ofproto_dpif *ofproto)
     return error;
 }
 
+static void
+ofproto_rcu_barrier(void)
+{
+    struct seq *seq = seq_create();
+    while(!ovsrcu_barrier(seq, 1000)) {
+        /* do nothing */
+    }
+    seq_destroy(seq);
+}
+
 static void
 destruct(struct ofproto *ofproto_, bool del)
 {
@@ -1848,6 +1858,9 @@ destruct(struct ofproto *ofproto_, bool del)
 
     seq_destroy(ofproto->ams_seq);
 
+    /* wait for all the meter destroy work finished
+     */
+    ofproto_rcu_barrier();
     close_dpif_backer(ofproto->backer, del);
 }
 
-- 
2.25.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to