vhost: add missing smp_rmb in vhost_vq_avail_ring_get

Signed-off-by: Yao 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: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Yao Liu 2020-10-13 17:57:54 +08:00 committed by Tomasz Zawadzki
parent f81cd2f3e2
commit ed0c3125fb

View File

@ -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;