mirror of https://github.com/xemu-project/xemu.git
vhost: Reorder vhost_svq_kick
Future code needs to call it from vhost_svq_add. No functional change intended. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
c381abc37f
commit
d93a2405ca
|
@ -215,6 +215,20 @@ static bool vhost_svq_add_split(VhostShadowVirtqueue *svq,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vhost_svq_kick(VhostShadowVirtqueue *svq)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* We need to expose the available array entries before checking the used
|
||||||
|
* flags
|
||||||
|
*/
|
||||||
|
smp_mb();
|
||||||
|
if (svq->vring.used->flags & VRING_USED_F_NO_NOTIFY) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event_notifier_set(&svq->hdev_kick);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an element to a SVQ.
|
* Add an element to a SVQ.
|
||||||
*
|
*
|
||||||
|
@ -235,20 +249,6 @@ static bool vhost_svq_add(VhostShadowVirtqueue *svq, VirtQueueElement *elem)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vhost_svq_kick(VhostShadowVirtqueue *svq)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* We need to expose the available array entries before checking the used
|
|
||||||
* flags
|
|
||||||
*/
|
|
||||||
smp_mb();
|
|
||||||
if (svq->vring.used->flags & VRING_USED_F_NO_NOTIFY) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event_notifier_set(&svq->hdev_kick);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forward available buffers.
|
* Forward available buffers.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue