From: Ilya Maximets Date: Thu, 24 Jan 2019 16:59:02 +0000 (+0300) Subject: net/virtio: add missing read barrier for packed dequeue X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4b058fdd27ceac277aa715df6f6bb0f7b37b150b;p=dpdk.git net/virtio: add missing read barrier for packed dequeue Read barrier is required between reading the flags (desc_is_used) and the content of descriptor to ensure the ordering. Otherwise, speculative read of desc.id could be reordered with reading of the desc.flags. Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets Reviewed-by: Jens Freimann Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 5ffed6a514..4c701c5147 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -124,6 +124,7 @@ virtqueue_dequeue_burst_rx_packed(struct virtqueue *vq, used_idx = vq->vq_used_cons_idx; if (!desc_is_used(&desc[used_idx], vq)) return i; + virtio_rmb(vq->hw->weak_barriers); len[i] = desc[used_idx].len; id = desc[used_idx].id; cookie = (struct rte_mbuf *)vq->vq_descx[id].cookie;