}
@@ -575,6 +630,34 @@ void virtqueue_flush(VirtQueue *vq, unsigned int
count)
vq->signalled_used_valid = false;
}
+static void virtqueue_packed_flush(VirtQueue *vq, unsigned int count)
+{
+ if (unlikely(!vq->vring.desc)) {
+ return;
+ }
+
+ vq->inuse -= count;
+ vq->used_idx += count;
I think it is wrong, because count seems to be representing the number
of descriptor chains.
But in case of packed ring layout, used index must be incremented by the
number of descriptors.
For example, I'm having trouble with the ctrl queue, where the commands
sent by the guest use 3 descriptors, but count is 1.