net/virtio: use virtio barrier in packed ring
authorTiwei Bie <tiwei.bie@intel.com>
Tue, 22 Jan 2019 17:01:42 +0000 (01:01 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 24 Jan 2019 09:08:31 +0000 (10:08 +0100)
Always use the virtio variants which support the platform
memory ordering.

Fixes: 9230ab8d7913 ("net/virtio: support platform memory ordering")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_rxtx.c

index ebb86ef..cc476b8 100644 (file)
@@ -425,7 +425,7 @@ virtqueue_enqueue_recv_refill_packed(struct virtqueue *vq,
                vq->vq_desc_head_idx = dxp->next;
                if (vq->vq_desc_head_idx == VQ_RING_DESC_CHAIN_END)
                        vq->vq_desc_tail_idx = vq->vq_desc_head_idx;
-               rte_smp_wmb();
+               virtio_wmb(hw->weak_barriers);
                start_dp[idx].flags = flags;
                if (++vq->vq_avail_idx >= vq->vq_nentries) {
                        vq->vq_avail_idx -= vq->vq_nentries;
@@ -687,7 +687,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 
        vq->vq_avail_idx = idx;
 
-       rte_smp_wmb();
+       virtio_wmb(vq->hw->weak_barriers);
        head_dp->flags = head_flags;
 }