From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 4C1645A4A for ; Thu, 24 Jan 2019 17:59:19 +0100 (CET) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190124165918euoutp019198fc4c5f411123da7dd01a4e55bc6c~811s-dA7K3111331113euoutp01g for ; Thu, 24 Jan 2019 16:59:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190124165918euoutp019198fc4c5f411123da7dd01a4e55bc6c~811s-dA7K3111331113euoutp01g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548349158; bh=o9h4CjbGJOEcTcyxFLPrNRX91JeJVjMhSsdDTTVE290=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGR9r0f1SiUD9XKD0kM8yp2g0lbbRowUZ8WVe1FP0TElfPKvf7J7d5F4MeiF1TxVz Ia4LUYsm+TVHXlPxLgJHOSwk6ltUD0pHrW4i0YJg675sE4lr3RggC7jxxnJIYsSCDV EHAL861XoiGiyjO/KYB970S95Ohrnl/9S3f/Lov8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190124165918eucas1p12a786aa37ab0d11fab04454a9dde044d~811smdFZe2975429754eucas1p1J; Thu, 24 Jan 2019 16:59:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 59.62.04294.6EEE94C5; Thu, 24 Jan 2019 16:59:18 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190124165917eucas1p21b83186e336b1099ee32937fa81d8cc7~811rz5NNx0263202632eucas1p2R; Thu, 24 Jan 2019 16:59:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190124165917eusmtrp13713104e0752a691b24b21a0ac5d8531~811rlo5hY2842228422eusmtrp1H; Thu, 24 Jan 2019 16:59:17 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-2a-5c49eee6f48f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 23.26.04128.5EEE94C5; Thu, 24 Jan 2019 16:59:17 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190124165916eusmtip2b906013c304c975f0719abe7263bd5b9~811qn6P-E1425414254eusmtip2Z; Thu, 24 Jan 2019 16:59:16 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Maxime Coquelin , "Michael S . Tsirkin" Cc: Tiwei Bie , Zhihong Wang , Jens Freimann , Ilya Maximets , stable@dpdk.org Date: Thu, 24 Jan 2019 19:59:01 +0300 Message-Id: <20190124165902.24178-3-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124165902.24178-1-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRmVeSWpSXmKPExsWy7djPc7rP3nnGGFz7wmHx7tN2Josr7T/Z Lc6tWcpicaxzD4vF/1+vWC3+dfxht9ja8J/JYvPFSUwOHB6/Fixl9Vi85yWTx/t9V9k8+ras YgxgieKySUnNySxLLdK3S+DK6P1RW7CMq2L20ZWsDYz7OboYOTkkBEwkXl6/ytTFyMUhJLCC UeL1nh4o5wujxKv7V9ghnM+MEg8nvGKEael+9pkNIrGcUeJL/yRGCOcHo8S0AyAZTg42AR2J U6uPgHWICGRInLz9HKyIWWAto8TZzidMIAlhgUCJ9stLwIpYBFQlppy/xQJi8wpYS0xunccC sU5eYvWGA8wgNqeAjcTni9PYI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czEoivK4X3WKEeFMSK6tSi/Lji0pzUosPMZoCHTWRWUo0OR8YT3kl8YamhuYWlobm xubGZhZK4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhjTz80p2BT1ZkdPhssW9ffr7N5mzCn/ OjnRombl/z/P+mNP+7PlVItN/dq5ZcNS1hVzT8sXOrvNaSxhUzh30Gn3orudH25cZf3VLDvh 8rrj2x/2r131ad72bXmnEiR0K656zarbUybLZMq/LeGG9DmhPyo6x9SLrwsfPyaf92zOK8Hp aU6XxA9xK7EUZyQaajEXFScCAEI1hc1vAgAA X-CMS-MailID: 20190124165917eucas1p21b83186e336b1099ee32937fa81d8cc7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190124165917eucas1p21b83186e336b1099ee32937fa81d8cc7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190124165917eucas1p21b83186e336b1099ee32937fa81d8cc7 References: <20190124165902.24178-1-i.maximets@samsung.com> Subject: [dpdk-stable] [PATCH 2/3] 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: , X-List-Received-Date: Thu, 24 Jan 2019 16:59:19 -0000 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 --- 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 63e4370e4..5ffed6a51 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; -- 2.17.1