DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>
Cc: Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Jens Freimann <jfreimann@redhat.com>,
	Ilya Maximets <i.maximets@samsung.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] net/virtio: add missing read barrier for packed dequeue
Date: Thu, 24 Jan 2019 19:59:02 +0300	[thread overview]
Message-ID: <20190124165902.24178-4-i.maximets@samsung.com> (raw)
In-Reply-To: <20190124165902.24178-1-i.maximets@samsung.com>

Read barrier is required between reading the flags (desc_is_used)
and the content of descriptor to ensure the ordering.
Otherwise, speculative read of desc.id could be reordered with
reading of the desc.flags.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 drivers/net/virtio/virtio_rxtx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 5ffed6a51..4c701c514 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -124,6 +124,7 @@ virtqueue_dequeue_burst_rx_packed(struct virtqueue *vq,
 		used_idx = vq->vq_used_cons_idx;
 		if (!desc_is_used(&desc[used_idx], vq))
 			return i;
+		virtio_rmb(vq->hw->weak_barriers);
 		len[i] = desc[used_idx].len;
 		id = desc[used_idx].id;
 		cookie = (struct rte_mbuf *)vq->vq_descx[id].cookie;
-- 
2.17.1

  parent reply	other threads:[~2019-01-24 16:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190124165910eucas1p212dd655a34f42e11048e85eb17c7d0d0@eucas1p2.samsung.com>
2019-01-24 16:58 ` [dpdk-dev] [PATCH 0/3] net/virtio: missing/wrong read barriers Ilya Maximets
     [not found]   ` <CGME20190124165914eucas1p111b991d9e398368f63da918290e768de@eucas1p1.samsung.com>
2019-01-24 16:59     ` [dpdk-dev] [PATCH 1/3] net/virtio: fix improper read barriers on packed Tx cleanup Ilya Maximets
2019-01-25 12:43       ` Jens Freimann
2019-01-25 12:49       ` Jens Freimann
     [not found]   ` <CGME20190124165917eucas1p21b83186e336b1099ee32937fa81d8cc7@eucas1p2.samsung.com>
2019-01-24 16:59     ` [dpdk-dev] [PATCH 2/3] net/virtio: add barriers for extra descriptors on Rx split Ilya Maximets
     [not found]   ` <CGME20190124165921eucas1p1fee7e668285fc26bc4f01c6b5ec0b66a@eucas1p1.samsung.com>
2019-01-24 16:59     ` Ilya Maximets [this message]
2019-01-25 12:44       ` [dpdk-dev] [PATCH 3/3] net/virtio: add missing read barrier for packed dequeue Jens Freimann
2019-01-25 12:48       ` Jens Freimann
2019-01-25  4:43   ` [dpdk-dev] [PATCH 0/3] net/virtio: missing/wrong read barriers Tiwei Bie
2019-01-25 15:50   ` Maxime Coquelin
2019-02-08 18:04   ` Maxime Coquelin

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=20190124165902.24178-4-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=dev@dpdk.org \
    --cc=jfreimann@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /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).