From: Tiwei Bie Date: Tue, 22 Jan 2019 17:01:42 +0000 (+0800) Subject: net/virtio: use virtio barrier in packed ring X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=18f42d78864836d25bff30714f3bc77eb2c0b67e;p=dpdk.git net/virtio: use virtio barrier in packed ring Always use the virtio variants which support the platform memory ordering. Fixes: 9230ab8d7913 ("net/virtio: support platform memory ordering") Signed-off-by: Tiwei Bie Acked-by: Ilya Maximets Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index ebb86ef700..cc476b8985 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -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; }