On Wed, Jul 24, 2013 at 8:55 PM, Rusty Russell <ru...@rustcorp.com.au> wrote:
> Hi all,
>
>         Using latest kernel and master qemu, the following doesn't use
> vhost acceleration:
>
> sudo qemu-system-x86_64 -machine pc,accel=kvm $ARGS -m 1024 -net 
> tap,script=/home/rusty/bin/kvm-ifup,downscript=no,vhost=on -net 
> nic,model=virtio -drive file=$QEMUIMAGE,index=0,media=disk,if=virtio -kernel 
> arch/x86/boot/bzImage -append "root=/dev/vda1 $KARGS $*"

sudo qemu-system-x86_64 -enable-kvm $ARGS -m 1G -netdev
tap,script=/home/rusty/bin/kvm-ifup,vhost=on,id=net0 -device
virtio-net-pci,netdev=net0 -drive file=$QEMUIMAGE,if=virtio -kernel
arch/x86/boot/bzImage -append "root=/dev/vda1 $KARGS $*"

We really ought to strongly deprecate -net because it's misleading.  I
suspect we can reasonably add a warning for model=virtio saying
"please don't use this" and eventually remove it entirely.

> Culprit is here:
>
> hw/net/virtio-net.c:virtio_net_vhost_status():
>     if (nc->peer->info->type != NET_CLIENT_OPTIONS_KIND_TAP) {
>         return;
>     }
>
> info->type is NET_CLIENT_OPTIONS_KIND_HUBPORT.
>
> At a glance, it seems like vlan is always enabled, and that means a hub,
> so that change silently disabled vhost acceleration.
>
> It's quite possible that I've screwed up qemu's impenetrable command
> line (-net or -netdev, who knows what's better?).

It is for -net.  The whole vlan concept sucks and makes it too hard to
do offload or vhost.  It's still around for compatibility.

Regards,

Anthony Liguori

> Frustrated,
> Rusty.
>

Reply via email to