patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org, i.maximets@samsung.com, maxime.coquelin@redhat.com
Cc: Kevin Traynor <ktraynor@redhat.com>
Subject: [dpdk-stable] [18.11] net/virtio: add barriers for extra descriptors on Rx split
Date: Wed, 10 Apr 2019 19:02:52 +0100	[thread overview]
Message-ID: <20190410180252.32734-1-ktraynor@redhat.com> (raw)

From: Ilya Maximets <i.maximets@samsung.com>

[ 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


                 reply	other threads:[~2019-04-10 18:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190410180252.32734-1-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=i.maximets@samsung.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).