qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] virtio-net with virtio-mmio


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] virtio-net with virtio-mmio
Date: Fri, 30 Dec 2011 12:21:09 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Dec 28, 2011 at 06:16:42PM +0800, Ying-Shiuan Pan wrote:
> I'm very interested in virtio-mmio Peter Maydell did for QEMU,
> (http://lists.nongnu.org/archive/html/qemu-devel/2011-11/msg01870.html)
> 
> actually, I've tested the virtio-blk, and it is working.
> I applied those patch to QEMU-1.0 and brought the virtio_mmio.c from
> Linux-3.2-rc back to Linux-linaro-2.6.38.
> 
> I also found a small bug in virito-mmio.c: virtio_mmio_write(),
> Peter forgot to break in each case of switch block.
> After fixed the small bug, the virtio-balloon works as well.

PMM: Do you have a git branch where you could apply Ying-Shiuan's fix?

> Then, when I attempted to enable the virtio-net, the initialization part is
> fine,
> however, the QEMU crashed and printed this message:
> "virtio-net header not in first element"
> 
> It happens when the front-end virtio-net is invoking virtqueue_kick() at
> the end of try_fill_recv().
> Then, QEMU gets this message and invokes virtio_net_receive(), then the
> error happens.

virtio-net is looking at a virtqueue element (a packet buffer provided
by the guest OS into which QEMU will copy the received packet) but the
virtqueue element does not have the expected format.  You can check the
virtio specification for the details on the virtio-net buffer layout:
http://ozlabs.org/~rusty/virtio-spec/

It sounds like the vring is corrupted or QEMU's virtio code is not
correctly reading the virtqueue element (which is basically an iovec
array).

virtio-net is more advanced than virtio-blk in how it uses virtio so
it's not surprising that you've discovered an issue.  Debugging this
comes down to looking at the vring descriptors and the virtqueue
elements that QEMU extracts.

It sounds like there's a problem with the rx queue, you could try
indirect_desc=off to disable indirect vring descriptors to see if that
is part of the problem.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]