VirtIO id X is not a head!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

i try to implement a virtual device/driver, but i ran into some
trouble using the virtio api.
My implementation looks as follows:
A kthread exposes memory via add_buf, kicks and sleeps. If a callback
is issued he is woken up and takes the filled buffer back via get_buf.
(No other kthread, process or whatever works on this vq in the
kernel).
In qemu a qemu_thread waits for some shared memory and tries to pop
elements from the vq and copies some data into the guest accessible
memory. Not all elements are  necessarily poped before fill flush and
notify are called. If a pop returns with < 0 the thread goes to sleep
until the handler routine for this vq wakes the thread up again.

from time to time (after several 100k gets,adds and pops) i get: id %u
is not a head!.
virtio_ring.c:
if (unlikely(i >= vq->vring.num)) {
		BAD_RING(vq, "id %u out of range\n", i);
		return NULL;

I have no idea what i am doing wrong. Is synchronization needed
between add pop and get or am i not allowed to use a qemu_thread when
working on a vq?

Do you have any suggestions?

regards
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux