From 18f42d78864836d25bff30714f3bc77eb2c0b67e Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 23 Jan 2019 01:01:42 +0800 Subject: [PATCH] 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 --- drivers/net/virtio/virtio_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.20.1