vhost: remove unnecessary SMP barrier for desc flags
authorJoyce Kong <joyce.kong@arm.com>
Mon, 21 Dec 2020 15:50:28 +0000 (23:50 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 17:07:55 +0000 (18:07 +0100)
As function desc_is_avail performs a load-acquire barrier to
enforce the ordering between desc flags and desc content, it is
unnecessary to add a rte_smp_rmb barrier around the trace which
follows desc_is_avail.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/virtio_net.c

index 6c51286..ae67237 100644 (file)
@@ -1281,8 +1281,6 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,
                        return -1;
        }
 
-       rte_smp_rmb();
-
        vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
                lens[i] = descs[avail_idx + i].len;
 
@@ -1343,7 +1341,6 @@ virtio_dev_rx_single_packed(struct virtio_net *dev,
        struct buf_vector buf_vec[BUF_VECTOR_MAX];
        uint16_t nr_descs = 0;
 
-       rte_smp_rmb();
        if (unlikely(vhost_enqueue_single_packed(dev, vq, pkt, buf_vec,
                                                 &nr_descs) < 0)) {
                VHOST_LOG_DATA(DEBUG,