From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2668EA0096 for ; Wed, 10 Apr 2019 20:03:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB6751B116; Wed, 10 Apr 2019 20:03:09 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5DAA71B116 for ; Wed, 10 Apr 2019 20:03:09 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEFE7753F7; Wed, 10 Apr 2019 18:03:08 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 599725D9CD; Wed, 10 Apr 2019 18:03:05 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org, i.maximets@samsung.com, maxime.coquelin@redhat.com Cc: Kevin Traynor Date: Wed, 10 Apr 2019 19:02:52 +0100 Message-Id: <20190410180252.32734-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 10 Apr 2019 18:03:08 +0000 (UTC) Subject: [dpdk-stable] [18.11] net/virtio: add barriers for extra descriptors on Rx split X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Ilya Maximets [ upstream commit 23d25f1a40175343c8a27d539d47fecef477ecf5 ] 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") Signed-off-by: Ilya Maximets Reviewed-by: Maxime Coquelin Signed-off-by: Kevin Traynor --- drivers/net/virtio/virtio_rxtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 7e035130f..606706e94 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1100,4 +1100,5 @@ virtio_recv_mergeable_pkts_inorder(void *rx_queue, prev = rcv_pkts[nb_rx]; if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { + virtio_rmb(); num = virtqueue_dequeue_rx_inorder(vq, rcv_pkts, len, rcv_cnt); @@ -1264,4 +1265,5 @@ virtio_recv_mergeable_pkts(void *rx_queue, RTE_MIN(seg_res, RTE_DIM(rcv_pkts)); if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { + virtio_rmb(); uint32_t rx_num = virtqueue_dequeue_burst_rx(vq, -- 2.20.1