Commit df8d361f authored by Jie Wang's avatar Jie Wang Committed by Tomasz Zawadzki
Browse files

lib/vhost: fix memory barrier miss before read avail flags



When guest enabling interrupts, vhost need paired with the barrier
that the Guest executes. Otherwise maybe miss vhost_vq_used_signal
and occur IO hang.

Change-Id: I62775aea0b9ae48eea5d44e22732b5e7481a2198
Signed-off-by: default avatarJie Wang <wangjie88@huawei.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20504


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent fa509b84
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -409,6 +409,8 @@ check_session_vq_io_stats(struct spdk_vhost_session *vsession,
static inline bool
vhost_vq_event_is_suppressed(struct spdk_vhost_virtqueue *vq)
{
	spdk_smp_mb();

	if (spdk_unlikely(vq->packed.packed_ring)) {
		if (vq->vring.driver_event->flags & VRING_PACKED_EVENT_FLAG_DISABLE) {
			return true;