mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-16 06:31:51 -06:00
vhost: use avail event idx on vhost_svq_kick
So SVQ code knows if an event is needed. The code is not reachable at the moment. Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
01f8beacea
commit
22a6840ff2
1 changed files with 11 additions and 1 deletions
|
@ -218,12 +218,22 @@ static bool vhost_svq_add_split(VhostShadowVirtqueue *svq,
|
||||||
|
|
||||||
static void vhost_svq_kick(VhostShadowVirtqueue *svq)
|
static void vhost_svq_kick(VhostShadowVirtqueue *svq)
|
||||||
{
|
{
|
||||||
|
bool needs_kick;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to expose the available array entries before checking the used
|
* We need to expose the available array entries before checking the used
|
||||||
* flags
|
* flags
|
||||||
*/
|
*/
|
||||||
smp_mb();
|
smp_mb();
|
||||||
if (svq->vring.used->flags & VRING_USED_F_NO_NOTIFY) {
|
|
||||||
|
if (virtio_vdev_has_feature(svq->vdev, VIRTIO_RING_F_EVENT_IDX)) {
|
||||||
|
uint16_t avail_event = *(uint16_t *)(&svq->vring.used->ring[svq->vring.num]);
|
||||||
|
needs_kick = vring_need_event(avail_event, svq->shadow_avail_idx, svq->shadow_avail_idx - 1);
|
||||||
|
} else {
|
||||||
|
needs_kick = !(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!needs_kick) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue