Skip to content
Snippets Groups Projects
Commit 1f5d2e3b authored by Andrey Smetanin's avatar Andrey Smetanin Committed by Michael S. Tsirkin
Browse files

vhost_net: revert upend_idx only on retriable error


Fix possible virtqueue used buffers leak and corresponding stuck
in case of temporary -EIO from sendmsg() which is produced by
tun driver while backend device is not up.

In case of no-retriable error and zcopy do not revert upend_idx
to pass packet data (that is update used_idx in corresponding
vhost_zerocopy_signal_used()) as if packet data has been
transferred successfully.

v2: set vq->heads[ubuf->desc].len equal to VHOST_DMA_DONE_LEN
in case of fake successful transmit.

Signed-off-by: default avatarAndrey Smetanin <asmetanin@yandex-team.ru>
Message-Id: <20230424204411.24888-1-asmetanin@yandex-team.ru>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarAndrey Smetanin <asmetanin@yandex-team.ru>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent 376daf31
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment