Used idx can be synchronized by one-way barrier instead of full write barrier for split vring.
Signed-off-by: Joyce Kong <joyce.k...@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com> --- 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 ae6fdd24e..99a926a77 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.29.2