vhost: prevent IO freeze by kicking all queues after starting device
See comment in vhost.c file for more details why this fix is needed. Change-Id: I782119768fb200ad36f9253e704cc08a3be36ae6 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/395514 Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
a4f3920d51
commit
29181903ce
@ -985,6 +985,21 @@ start_device(int vid)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Not sure right now but this look like some kind of QEMU bug and guest IO
|
||||||
|
* might be frozed without kicking all queues after live-migration. This look like
|
||||||
|
* the previous vhost instance failed to effectively deliver all interrupts before
|
||||||
|
* the GET_VRING_BASE message. This shouldn't harm guest since spurious interrupts
|
||||||
|
* should be ignored by guest virtio driver.
|
||||||
|
*
|
||||||
|
* Tested on QEMU 2.10.91 and 2.11.50.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < num_queues; i++) {
|
||||||
|
if (vdev->virtqueue[i].vring.callfd != -1) {
|
||||||
|
eventfd_write(vdev->virtqueue[i].vring.callfd, (eventfd_t)1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vdev->lcore = spdk_vhost_allocate_reactor(vdev->cpumask);
|
vdev->lcore = spdk_vhost_allocate_reactor(vdev->cpumask);
|
||||||
rc = spdk_vhost_event_send(vdev, vdev->backend->start_device, 3, "start device");
|
rc = spdk_vhost_event_send(vdev, vdev->backend->start_device, 3, "start device");
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user