ofproto-dpif: Do not block on uninitialized pause barriers.
authorZoltan Kiss <zoltan.kiss@linaro.org>
Fri, 25 Sep 2015 18:42:40 +0000 (11:42 -0700)
committerJoe Stringer <joestringer@nicira.com>
Fri, 25 Sep 2015 22:26:27 +0000 (15:26 -0700)
commitd997f23fe5eb75003a0aaa37b3a6e6fae8ecfa03
treed639068c7fc3f8c71d89d443efcbc53057c5d370
parent3a8653d716d92b563c70b6a81bd92385cba99d18
ofproto-dpif: Do not block on uninitialized pause barriers.

e4e74c3a "dpif-netdev: Purge all ukeys when reconfigure pmd." introduced a new
dp_purge_cb function, which calls udpif_pause_revalidators() and that tries to
block on pause_barrier.
But if OVS was started with flow-restore-wait="true" (e.g. through ovs-ctl),
type_run() will have backer->recv_set_enable == false, and udpif_set_threads
won't initialize the barrier, which leads to a segfault like this:

This patch introduces ofproto_dpif_backer_enabled(), which checks
recv_set_enable before touching the latch and blocking on pause_barrier.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Joe Stringer <joestringer@nicira.com>
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h