diff options
author | Eugenio Pérez <eperezma@redhat.com> | 2022-07-20 08:59:30 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2022-07-20 16:58:08 +0800 |
commit | d93a2405ca6efa9dc1c420cee5a34bd8242818d0 (patch) | |
tree | 180e5a5d079f362bb7f29ff1fff5ec5bb22deae0 /hw | |
parent | c381abc37f0aba42ed2e3b41cdace8f8438829e4 (diff) | |
download | qemu-d93a2405ca6efa9dc1c420cee5a34bd8242818d0.zip qemu-d93a2405ca6efa9dc1c420cee5a34bd8242818d0.tar.gz qemu-d93a2405ca6efa9dc1c420cee5a34bd8242818d0.tar.bz2 |
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/vhost-shadow-virtqueue.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c index 560d07a..043a185 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -215,6 +215,20 @@ static bool vhost_svq_add_split(VhostShadowVirtqueue *svq, 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. * @@ -235,20 +249,6 @@ static bool vhost_svq_add(VhostShadowVirtqueue *svq, VirtQueueElement *elem) 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. * |