From: Eugenio Pérez Date: Wed, 20 Jul 2022 06:59:30 +0000 (+0200) Subject: vhost: Reorder vhost_svq_kick X-Git-Tag: v7.1.0-rc0~8^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d93a2405ca6efa9dc1c420cee5a34bd8242818d0;p=thirdparty%2Fqemu.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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c index 560d07ab36d..043a185b96c 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. *