* [dpdk-stable] [18.11] net/virtio: add barriers for extra descriptors on Rx split
@ 2019-04-10 18:02 Kevin Traynor
0 siblings, 0 replies; only message in thread
From: Kevin Traynor @ 2019-04-10 18:02 UTC (permalink / raw)
To: stable, i.maximets, maxime.coquelin; +Cc: Kevin Traynor
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-10 18:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 18:02 [dpdk-stable] [18.11] net/virtio: add barriers for extra descriptors on Rx split 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).