mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-dpdk: Fix dpdk_watchdog failure to quiesce.
Fix issue whereby vhost_thread is waiting for dpdk_watchdog thread to quiesce and at the same time dpdk_watchdog thread is waiting for vhost_thread to give up dpdk_mutex. Reported-by: Patrik Andersson R <patrik.r.andersson@ericsson.com> Signed-off-by: Patrik Andersson R <patrik.r.andersson@ericsson.com> Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
committed by
Daniele Di Proietto
parent
e752914179
commit
afee281f7f
1
AUTHORS
1
AUTHORS
@@ -360,6 +360,7 @@ Niels van Adrichem N.L.M.vanAdrichem@tudelft.nl
|
||||
Niklas Andersson nandersson@nicira.com
|
||||
Pankaj Thakkar thakkar@nicira.com
|
||||
Pasi Kärkkäinen pasik@iki.fi
|
||||
Patrik Andersson R patrik.r.andersson@ericsson.com
|
||||
Paulo Cravero pcravero@as2594.net
|
||||
Pawan Shukla shuklap@vmware.com
|
||||
Peter Amidon peter@picnicpark.org
|
||||
|
@@ -1904,6 +1904,7 @@ static void
|
||||
destroy_device(volatile struct virtio_net *dev)
|
||||
{
|
||||
struct netdev_dpdk *vhost_dev;
|
||||
bool exists = false;
|
||||
|
||||
ovs_mutex_lock(&dpdk_mutex);
|
||||
LIST_FOR_EACH (vhost_dev, list_node, &dpdk_list) {
|
||||
@@ -1912,24 +1913,32 @@ destroy_device(volatile struct virtio_net *dev)
|
||||
ovs_mutex_lock(&vhost_dev->mutex);
|
||||
dev->flags &= ~VIRTIO_DEV_RUNNING;
|
||||
ovsrcu_set(&vhost_dev->virtio_dev, NULL);
|
||||
exists = true;
|
||||
ovs_mutex_unlock(&vhost_dev->mutex);
|
||||
|
||||
/*
|
||||
* Wait for other threads to quiesce before
|
||||
* setting the virtio_dev to NULL.
|
||||
*/
|
||||
ovsrcu_synchronize();
|
||||
/*
|
||||
* As call to ovsrcu_synchronize() will end the quiescent state,
|
||||
* put thread back into quiescent state before returning.
|
||||
*/
|
||||
ovsrcu_quiesce_start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ovs_mutex_unlock(&dpdk_mutex);
|
||||
|
||||
VLOG_INFO("vHost Device '%s' %"PRIu64" has been removed", dev->ifname,
|
||||
dev->device_fh);
|
||||
if (exists == true) {
|
||||
/*
|
||||
* Wait for other threads to quiesce after setting the 'virtio_dev'
|
||||
* to NULL, before returning.
|
||||
*/
|
||||
ovsrcu_synchronize();
|
||||
/*
|
||||
* As call to ovsrcu_synchronize() will end the quiescent state,
|
||||
* put thread back into quiescent state before returning.
|
||||
*/
|
||||
ovsrcu_quiesce_start();
|
||||
VLOG_INFO("vHost Device '%s' %"PRIu64" has been removed", dev->ifname,
|
||||
dev->device_fh);
|
||||
} else {
|
||||
VLOG_INFO("vHost Device '%s' %"PRIu64" not found", dev->ifname,
|
||||
dev->device_fh);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct virtio_net *
|
||||
|
Reference in New Issue
Block a user