From 417488643611acbf8e3e2525d1e6c83f5eb107fa Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 25 Apr 2017 13:49:51 -0700 Subject: vhost: core dump on quit with worker threads Patch 6347 removed the socket file when the interface is deleted and when VPP process is exitting. The CLI for deleting the interface has builtin vlib_worker_thread_barrier_sync to prevent the worker threads from running. Unfortunately, the CLI quit does not have the builtin vlib_worker_thread_barrier_sync. As a result, it may cause the worker thread to crash. The fix is to add the vlib_worker_thread_barrier_sync in vhost_user_exit. Change-Id: I1eff81170e131098f1799662f0ab48d6fca3def7 Signed-off-by: Steven --- src/vnet/devices/virtio/vhost-user.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/vnet') diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c index 4f4f038a38b..bcfef9f5aee 100644 --- a/src/vnet/devices/virtio/vhost-user.c +++ b/src/vnet/devices/virtio/vhost-user.c @@ -2589,11 +2589,13 @@ vhost_user_exit (vlib_main_t * vm) vhost_user_main_t *vum = &vhost_user_main; vhost_user_intf_t *vui; + vlib_worker_thread_barrier_sync (vlib_get_main ()); /* *INDENT-OFF* */ pool_foreach (vui, vum->vhost_user_interfaces, { vhost_user_delete_if (vnm, vm, vui->sw_if_index); }); /* *INDENT-ON* */ + vlib_worker_thread_barrier_release (vlib_get_main ()); return 0; } -- cgit 1.2.3-korg