diff --git a/lib/vhost/rte_vhost/vhost.c b/lib/vhost/rte_vhost/vhost.c index 61cbb1209..d9c119f99 100644 --- a/lib/vhost/rte_vhost/vhost.c +++ b/lib/vhost/rte_vhost/vhost.c @@ -521,6 +521,13 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx) if (!vq) return -1; + /* Ensure all our used ring changes are visible to the guest at the time + * of interrupt. + * TODO: this is currently an sfence on x86. For other architectures we + * will most likely need an smp_mb(), but smp_mb() is an overkill for x86. + */ + rte_wmb(); + if (vq->callfd != -1) { eventfd_write(vq->callfd, (eventfd_t)1); return 0; diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index b2c675f08..15564562c 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -463,13 +463,6 @@ spdk_vhost_vq_used_ring_enqueue(struct spdk_vhost_session *vsession, * (volatile uint16_t *) &used->idx = virtqueue->last_used_idx; spdk_vhost_log_used_vring_idx(vsession, virtqueue); - /* Ensure all our used ring changes are visible to the guest at the time - * of interrupt. - * TODO: this is currently an sfence on x86. For other architectures we - * will most likely need an smp_mb(), but smp_mb() is an overkill for x86. - */ - spdk_wmb(); - virtqueue->used_req_cnt++; }