linux/drivers/vhost
Jason Wang 779bcdd4b9 vhost: rewind next_avail_head while discarding descriptors
When discarding descriptors with IN_ORDER, we should rewind
next_avail_head otherwise it would run out of sync with
last_avail_idx. This would cause driver to report
"id X is not a head".

Fixing this by returning the number of descriptors that is used for
each buffer via vhost_get_vq_desc_n() so caller can use the value
while discarding descriptors.

Fixes: 67a873df0c ("vhost: basic in order support")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20251120022950.10117-1-jasowang@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-26 14:44:58 -08:00
..
Kconfig vhost: Reintroduce kthread API and add mode selection 2025-08-01 09:11:09 -04:00
Makefile
iotlb.c
net.c vhost: rewind next_avail_head while discarding descriptors 2025-11-26 14:44:58 -08:00
scsi.c vhost-scsi: fix argument order in tport allocation error message 2025-09-15 18:25:58 -04:00
test.c
test.h
vdpa.c vdpa: support virtio_map 2025-10-01 07:24:43 -04:00
vhost.c vhost: rewind next_avail_head while discarding descriptors 2025-11-26 14:44:58 -08:00
vhost.h vhost: rewind next_avail_head while discarding descriptors 2025-11-26 14:44:58 -08:00
vringh.c vhost: vringh: Fix copy_to_iter return value check 2025-10-01 07:24:31 -04:00
vsock.c vsock/virtio: Rename virtio_vsock_skb_rx_put() 2025-08-01 09:11:09 -04:00