[Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection

Maxime Coquelin posted 2 patches 6 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171116184835.28556-1-maxime.coquelin@redhat.com
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
hw/virtio/vhost.c          |  4 ++++
hw/virtio/virtio.c         | 10 ++++++++++
include/hw/virtio/virtio.h |  1 +
3 files changed, 15 insertions(+)
[Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection
Posted by Maxime Coquelin 6 years, 5 months ago
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


Re: [Qemu-devel] [PATCH 0/2] virtio-net: Fix TX data discard on backend disconnection
Posted by Jason Wang 6 years, 5 months ago

On 2017年11月17日 02:48, Maxime Coquelin wrote:
> 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(+)
>

Reviewed-by: Jason Wang <jasowang@redhat.com>