From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCllb-0006j5-5Z for qemu-devel@nongnu.org; Tue, 05 Mar 2013 01:54:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCllZ-0002eH-GC for qemu-devel@nongnu.org; Tue, 05 Mar 2013 01:54:27 -0500 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:56511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCllZ-0002e5-8u for qemu-devel@nongnu.org; Tue, 05 Mar 2013 01:54:25 -0500 Received: by mail-ob0-f174.google.com with SMTP id 16so2430411obc.19 for ; Mon, 04 Mar 2013 22:54:23 -0800 (PST) Message-ID: <513596D7.3060307@ozlabs.ru> Date: Tue, 05 Mar 2013 17:55:19 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] QEMU -netdev vhost=on + -device virtio-net-pci bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: rusty@rustcorp.com.au, "qemu-devel@nongnu.org" , David Gibson Hi! The patch f56a12475ff1b8aa61210d08522c3c8aaf0e2648 "vhost: backend masking support" breaks virtio-net + vhost=on on PPC64 platform. The problem command line is: 1) -netdev tap,id=tapnet,ifname=tap0,script=qemu-ifup.sh,vhost=on \ -device virtio-net-pci,netdev=tapnet,addr=0.0 \ Without the patch, the eth0 in the guest works fine, with the patch it simply does not. The guest's eth0 also works with the following configs: 2) new -netdev interface with vhost=off: -netdev tap,id=tapnet,ifname=tap0,script=qemu-ifup.sh \ -device virtio-net-pci,netdev=tapnet,addr=0.0 3) old -net interface with vhost=on: -net tap,ifname=tap0,script=qemu-ifup.sh,vhost=on \ -net nic,model=virtio,addr=0:0:0 4) old -net interface with vhost=off: -net tap,ifname=tap0,script=qemu-ifup.sh \ -net nic,model=virtio,addr=0:0:0 I run http://junkcode.samba.org/ftp/unpacked/junkcode/socklib/ on 10Gb ethernet and observe 1020MB/s for 1) (without the patch), 800MB/s for 2), 70MB/s for 3) and 4). The virtio features (cat /sys/bus/virtio/devices/virtio0/features) for 1) and 2) are: "1100011111111111111100000000110000000000000000000000000000000000" and for 3) and 4) they are: "0000011000000001111100000000110000000000000000000000000000000000" I guess this is because the old -net interface creates an internal hub as "info qtree" shows vlan=0 and netdev=hub0port1 while the new -netdev interface does not seem to create any internal hub (vlan=, netdev=tapnet). btw why are the configs so different? The network config is below. Both host and guest are running 3.8 kernel. The qemu tree from qemu.org/master still has this problem. What am I missing? Thanks. The full command line is like below plus the network config from the examples above: sudo qemu-impreza/ppc64-softmmu/qemu-system-ppc64 -m 1024 -machine pseries,kernel_irqchip=on -trace events=trace_events \ -nographic -vga none -enable-kvm -kernel vml38_64k -initrd 1.cpio This is the host config: [aik@vpl2 ~]$ cat qemu-ifup.sh #! /bin/sh /sbin/ifconfig $1 0.0.0.0 promisc up /usr/sbin/brctl addif brtest $1 [aik@vpl2 ~]$ brctl show bridge name bridge id STP enabled interfaces brtest 8000.00145e992e88 no eth0 [aik@vpl2 ~]$ ifconfig eth0 eth0: flags=4163 mtu 1500 inet6 fe80::214:5eff:fe99:2e88 prefixlen 64 scopeid 0x20 ether 00:14:5e:99:2e:88 txqueuelen 1000 (Ethernet) RX packets 1781219 bytes 124692636 (118.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 13734906 bytes 20755102658 (19.3 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 49 memory 0x3c0500800000-3c0500800fff [aik@vpl2 ~]$ lspci -vs 1:1:0.0 0001:01:00.0 Ethernet controller: Chelsio Communications Inc T310 10GbE Single Port Adapter Subsystem: IBM Device 038c Flags: bus master, fast devsel, latency 0, IRQ 49 Memory at 3c0500800000 (64-bit, non-prefetchable) [size=4K] Memory at 3c0500000000 (64-bit, non-prefetchable) [size=8M] Memory at 3c0500801000 (64-bit, non-prefetchable) [size=4K] [virtual] Expansion ROM at 3c0500c00000 [disabled] [size=512K] Capabilities: Kernel driver in use: cxgb3 [aik@vpl2 ~]$ ls -l /sys/bus/pci/devices/0001\:01\:00.0/net/ total 0 drwxr-xr-x. 5 root root 0 Mar 5 12:59 eth0 [aik@vpl2 ~]$ uname -a Linux vpl2.ozlabs.ibm.com 3.8.0-kvm-64k-aik+ #239 SMP Tue Mar 5 12:50:05 EST 2013 ppc64 ppc64 ppc64 GNU/Linux This is the running guest: root@erif_root:~# lspci -v 00:00.0 Ethernet controller: Qumranet, Inc. Virtio network device Subsystem: Qumranet, Inc. Device 0001 Flags: bus master, fast devsel, latency 0, IRQ 19 I/O ports at 0020 [size=32] Memory at 100b0000000 (32-bit, non-prefetchable) [size=4K] Expansion ROM at 100b0010000 [disabled] [size=64K] Capabilities: [40] MSI-X: Enable+ Count=3 Masked- Kernel driver in use: virtio-pci root@erif_root:~# ifconfig -a eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56 inet addr:172.20.1.2 Bcast:172.20.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:36 errors:0 dropped:6 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2268 (2.2 KiB) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@erif_root:~# uname -a Linux erif_root 3.8.0-aik-guest+ #262 SMP Mon Mar 4 15:58:55 EST 2013 ppc64 GNU/Linux -- Alexey