[v1,4/8] vhost: remove unnecessary smp barrier for avail idx
Checks
Commit Message
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@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
lib/librte_vhost/virtio_net.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Comments
On 12/21/20 4:50 PM, Joyce Kong wrote:
> 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@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> lib/librte_vhost/virtio_net.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
@@ -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)]);