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 DB7A1A0096 for ; Wed, 10 Apr 2019 19:59:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88D001B3EA; Wed, 10 Apr 2019 19:59:28 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 523F21B3EA for ; Wed, 10 Apr 2019 19:59:27 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71B2FC04FFFB; Wed, 10 Apr 2019 17:59:26 +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 E7F785D719; Wed, 10 Apr 2019 17:59:22 +0000 (UTC) From: Kevin Traynor To: Ilya Maximets Cc: Maxime Coquelin , Kevin Traynor , dpdk stable Date: Wed, 10 Apr 2019 18:59:18 +0100 Message-Id: <20190410175918.32564-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 10 Apr 2019 17:59:26 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio: add barriers for extra descriptors on Rx split' has been queued to LTS release 18.11.2 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" Hi Ilya/Maxime, I had to do some rework on this patch to backport it. Please check it's ok. FYI, your patch has been queued to LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >From bdf0a328273f9a4436a89ebb08e7da8af1408198 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Thu, 24 Jan 2019 19:59:01 +0300 Subject: [PATCH] net/virtio: add barriers for extra descriptors on Rx split [ 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 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-10 18:53:29.775196859 +0100 +++ 0001-net-virtio-add-barriers-for-extra-descriptors-on-Rx-.patch 2019-04-10 18:53:29.740006625 +0100 @@ -1,8 +1,10 @@ -From 23d25f1a40175343c8a27d539d47fecef477ecf5 Mon Sep 17 00:00:00 2001 +From bdf0a328273f9a4436a89ebb08e7da8af1408198 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Thu, 24 Jan 2019 19:59:01 +0300 Subject: [PATCH] net/virtio: add barriers for extra descriptors on Rx split +[ 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 @@ -10,30 +12,30 @@ 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 +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 63e4370e4..5ffed6a51 100644 +index 7e035130f..606706e94 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c -@@ -1457,4 +1457,5 @@ virtio_recv_pkts_inorder(void *rx_queue, +@@ -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(hw->weak_barriers); ++ virtio_rmb(); num = virtqueue_dequeue_rx_inorder(vq, rcv_pkts, len, rcv_cnt); -@@ -1643,4 +1644,5 @@ 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); +@@ -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