From 10b8c36af0abb654907d97738641d6a643408b99 Mon Sep 17 00:00:00 2001 From: Joyce Kong Date: Mon, 21 Dec 2020 23:50:31 +0800 Subject: [PATCH] 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 --- lib/librte_vhost/vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1