use ovsrcu_set first then use ovsrcu_postpone

CC: Eelco Chaudron <echau...@redhat.com>
Fixes: f82b3b6a2f4d (\ofproto-dpif-upcall: Only call ovsrcu_postpone()
on active actions\)

Acked-by: Yanqin Wei <yanqin....@arm.com>
Signed-off-by: Linhaifeng <haifeng....@huawei.com>
---
 ofproto/ofproto-dpif-upcall.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 5e08ef10d..be6dafb78 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1658,11 +1658,10 @@ ukey_set_actions(struct udpif_key *ukey, const struct 
ofpbuf *actions)
     struct ofpbuf *old_actions = ovsrcu_get_protected(struct ofpbuf *,
                                                       &ukey->actions);
 
+    ovsrcu_set(&ukey->actions, ofpbuf_clone(actions));
     if (old_actions) {
         ovsrcu_postpone(ofpbuf_delete, old_actions);
     }
-
-    ovsrcu_set(&ukey->actions, ofpbuf_clone(actions));
 }
 
 static struct udpif_key *
-- 
2.21.0.windows.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to