Commit ed0c3125 authored by Yao Liu's avatar Yao Liu Committed by Tomasz Zawadzki
Browse files

vhost: add missing smp_rmb in vhost_vq_avail_ring_get



Signed-off-by: default avatarYao Liu <yotta.liu@ucloud.cn>
Change-Id: Ie8f42cb41ae923ae0926290019cc79d9f5afc868
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4647


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent f81cd2f3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -184,6 +184,8 @@ vhost_vq_avail_ring_get(struct spdk_vhost_virtqueue *virtqueue, uint16_t *reqs,
	uint16_t last_idx = virtqueue->last_avail_idx, avail_idx = avail->idx;
	uint16_t count, i;

	spdk_smp_rmb();

	count = avail_idx - last_idx;
	if (spdk_likely(count == 0)) {
		return 0;