patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'net/virtio: add barriers for extra descriptors on Rx split' has been queued to LTS release 18.11.2
@ 2019-04-10 17:59 Kevin Traynor
  0 siblings, 0 replies; only message in thread
From: Kevin Traynor @ 2019-04-10 17:59 UTC (permalink / raw)
  To: Ilya Maximets; +Cc: Maxime Coquelin, Kevin Traynor, dpdk 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 <i.maximets@samsung.com>
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 <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 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 <i.maximets@samsung.com>
 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 <i.maximets@samsung.com>
 Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
+Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
 ---
  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
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-10 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 17:59 [dpdk-stable] patch 'net/virtio: add barriers for extra descriptors on Rx split' has been queued to LTS release 18.11.2 Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).