From: Ilya Maximets Date: Thu, 24 Jan 2019 16:59:01 +0000 (+0300) Subject: net/virtio: add barriers for extra descriptors on Rx split X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=23d25f1a40175343c8a27d539d47fecef477ecf5;p=dpdk.git net/virtio: add barriers for extra descriptors on Rx split There should be read barrier between checking VIRTQUEUE_NUSED (reading the used->idx) and reading these descriptors. It's done for the first checks at the beginning of these functions but missed while checking for extra required descriptors. Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx") Fixes: 13ce5e7eb94f ("virtio: mergeable buffers") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 63e4370e4a..5ffed6a514 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1456,6 +1456,7 @@ virtio_recv_pkts_inorder(void *rx_queue, prev = rcv_pkts[nb_rx]; if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { + virtio_rmb(hw->weak_barriers); num = virtqueue_dequeue_rx_inorder(vq, rcv_pkts, len, rcv_cnt); uint16_t extra_idx = 0; @@ -1642,6 +1643,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, prev = rcv_pkts[nb_rx]; if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { + virtio_rmb(hw->weak_barriers); num = virtqueue_dequeue_burst_rx(vq, rcv_pkts, len, rcv_cnt); uint16_t extra_idx = 0;