vhost: don't start device before got valid descriptor
For each virt queue's kickfd and callfd, there are 2 invalid status: VIRTIO_UNINITIALIZED_EVENTFD and VIRTIO_INVALID_EVENTFD. Don't set the virt queue to ready status until got the valid descriptor. This is safe for polling mode drivers in Guest OS, the backend vhost process will not post notification to interrupt vector for PMD mode in Guest, but the interrupt vector still valid. Change-Id: Icdf1e67f3c4e8da221843eb1383469ca1fba485c Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.gerrithub.io/365327 Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
b3022e129d
commit
c9a97addeb
@ -654,7 +654,9 @@ vq_is_ready(struct vhost_virtqueue *vq)
|
||||
{
|
||||
return vq && vq->desc &&
|
||||
vq->kickfd != VIRTIO_UNINITIALIZED_EVENTFD &&
|
||||
vq->callfd != VIRTIO_UNINITIALIZED_EVENTFD;
|
||||
vq->callfd != VIRTIO_UNINITIALIZED_EVENTFD &&
|
||||
vq->kickfd != VIRTIO_INVALID_EVENTFD &&
|
||||
vq->callfd != VIRTIO_INVALID_EVENTFD;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user