Hi Wei,

On 9/20/18 4:13 PM, Maxime Coquelin wrote:
      }
@@ -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.

It seems you didn't fixed this issue in your last revision.
I guess it works for virtio-net Kernel driver (with the fix you
proposed) in guest because it is using indirect descs.

But Virtio PMD does not use indirect descs for the control vq.

Thanks,
Maxime

Reply via email to