From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Maximets Subject: [PATCH 3/3] net/virtio: add missing read barrier for packed dequeue Date: Thu, 24 Jan 2019 19:59:02 +0300 Message-ID: <20190124165902.24178-4-i.maximets@samsung.com> References: <20190124165902.24178-1-i.maximets@samsung.com> Content-Type: text/plain; charset="utf-8" Cc: Tiwei Bie , Zhihong Wang , Jens Freimann , Ilya Maximets , stable@dpdk.org To: dev@dpdk.org, Maxime Coquelin , "Michael S . Tsirkin" Return-path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 941F75B2C for ; Thu, 24 Jan 2019 17:59:23 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190124165923euoutp02fe75293394adbec5cbebbadd0e6ddf19~811xT3d6M1959619596euoutp02A for ; Thu, 24 Jan 2019 16:59:23 +0000 (GMT) In-Reply-To: <20190124165902.24178-1-i.maximets@samsung.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/virtio/virtio_rxtx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 5ffed6a51..4c701c514 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; -- 2.17.1