qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection
@ 2017-11-16 18:48 Maxime Coquelin
  2017-11-16 18:48 ` [Qemu-devel] [PATCH 1/2] virtio: Add queue interface to restore avail index from vring used index Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Maxime Coquelin @ 2017-11-16 18:48 UTC (permalink / raw)
  To: mst, yuri.benditovich, yvugenfi, jasowang, qemu-devel; +Cc: Maxime Coquelin

This series fixes TX data discard when backend disconnects.

On backend disconnection, QEMU cannot retrieve its internal
avail index, which makes the virtio queue internal state
inconsistent (last_avail_idx will always be 0, whereas used_idx
is correct).

It results in discarding TX data to corrupt the vring state, by
completing descriptors already completed by the backend.

This series fixes this by restoring last_avail_idx to the vring
used idx, as some backends used to do on reconnection.

Maxime Coquelin (2):
  virtio: Add queue interface to restore avail index from vring used
    index
  vhost: restore avail index from vring used index on disconnection

 hw/virtio/vhost.c          |  4 ++++
 hw/virtio/virtio.c         | 10 ++++++++++
 include/hw/virtio/virtio.h |  1 +
 3 files changed, 15 insertions(+)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-17  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16 18:48 [Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection Maxime Coquelin
2017-11-16 18:48 ` [Qemu-devel] [PATCH 1/2] virtio: Add queue interface to restore avail index from vring used index Maxime Coquelin
2017-11-17  9:15   ` Jens Freimann
2017-11-16 18:48 ` [Qemu-devel] [PATCH 2/2] vhost: restore avail index from vring used index on disconnection Maxime Coquelin
2017-11-17  9:14   ` Jens Freimann
2017-11-17  4:01 ` [Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection Jason Wang

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).