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 <[email protected]> Fixes: 1f8675481e8c ("ofproto-dpif-upcall: Fix ovs-vswitchd crash.") Signed-off-by: Ilya Maximets <[email protected]> --- 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 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
