[ovs-dev] [PATCH 2/2] ofproto-dpif-upcall: Don't flush datapath flows in quiescent state.
Ilya Maximets
i.maximets at samsung.com
Thu Nov 1 13:58:41 UTC 2018
Datapath implementation of 'flow_flush()' could use cmaps.
dpif-netdev actively uses them to store flow tables and the polling
threads. Flushing flows while in a quiescent state may lead to
wrong memory accesses because implementaion of concurrent hash maps
relies on the rcu protected pointers which could float away.
CC: Alex Wang <ee07b291 at gmail.com>
Fixes: 1f8675481e8c ("ofproto-dpif-upcall: Fix ovs-vswitchd crash.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
ofproto/ofproto-dpif-upcall.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 02ae2aabe..1b6e23e4e 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -710,11 +710,13 @@ udpif_flush(struct udpif *udpif)
size_t n_revalidators_ = udpif->n_revalidators;
ovsrcu_quiesce_start();
-
udpif_stop_threads(udpif);
+ ovsrcu_quiesce_end();
+
dpif_flow_flush(udpif->dpif);
- udpif_start_threads(udpif, n_handlers_, n_revalidators_);
+ ovsrcu_quiesce_start();
+ udpif_start_threads(udpif, n_handlers_, n_revalidators_);
ovsrcu_quiesce_end();
}
--
2.17.1
More information about the dev
mailing list