net/virtio: fix read barriers on packed Tx cleanup
authorIlya Maximets <i.maximets@samsung.com>
Thu, 24 Jan 2019 16:59:00 +0000 (19:59 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Feb 2019 18:27:07 +0000 (19:27 +0100)
commit3eb50f0c7979a471c5ec9699ad8859982eb17b92
tree6603b0839573e12e317412cf5033e1ac58abe1b8
parente5ed1e5f382fc7d75e46988a39b764555dd6d849
net/virtio: fix read barriers on packed Tx cleanup

Read barrier must be implied between reading descriptor flags
and descriptor id. Otherwise, in case of reordering, we could
read wrong descriptor id.

For the reference, similar barrier for split rings is the read
barrier between VIRTQUEUE_NUSED (reading the used->idx) and
the call to the virtio_xmit_cleanup().

Additionally removed double update of 'used_idx'. It's enough
to set it in the end of the loop.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_rxtx.c