From: Joyce Kong Date: Mon, 21 Dec 2020 15:50:31 +0000 (+0800) Subject: vhost: relax full barriers for used idx X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=10b8c36af0abb654907d97738641d6a643408b99 vhost: relax full barriers for used idx Used idx can be synchronized by one-way barrier instead of full write barrier for split vring. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Reviewed-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index ae6fdd24ed..99a926a772 100644 --- a/lib/librte_vhost/vdpa.c +++ b/lib/librte_vhost/vdpa.c @@ -217,8 +217,8 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m) idx++; } - rte_smp_wmb(); - vq->used->idx = idx_m; + /* used idx is the synchronization point for the split vring */ + __atomic_store_n(&vq->used->idx, idx_m, __ATOMIC_RELEASE); if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) vring_used_event(s_vring) = idx_m;