[dpdk-dev] [PATCH v1 4/8] vhost: remove unnecessary smp barrier for avail idx

Joyce Kong joyce.kong at arm.com
Mon Dec 21 16:50:29 CET 2020


The ordering between avail index and desc reads has been enforced
by load-acquire for split vring, so smp_rmb barrier is not needed
behind it.

Signed-off-by: Joyce Kong <joyce.kong at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
---
 lib/librte_vhost/virtio_net.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index ae6723766..c912ae354 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1494,13 +1494,10 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,
 	struct async_inflight_info *pkts_info = vq->async_pkts_info;
 	int n_pkts = 0;
 
-	avail_head = __atomic_load_n(&vq->avail->idx, __ATOMIC_ACQUIRE);
-
 	/*
-	 * The ordering between avail index and
-	 * desc reads needs to be enforced.
+	 * The ordering between avail index and desc reads need to be enforced.
 	 */
-	rte_smp_rmb();
+	avail_head = __atomic_load_n(&vq->avail->idx, __ATOMIC_ACQUIRE);
 
 	rte_prefetch0(&vq->avail->ring[vq->last_avail_idx & (vq->size - 1)]);
 
-- 
2.29.2



More information about the dev mailing list