From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKrFj-0001x3-L3 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 08:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKrFi-0002Gj-IC for qemu-devel@nongnu.org; Mon, 31 Oct 2011 08:46:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKrFi-0002GR-B8 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 08:46:10 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9VCk733006816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 31 Oct 2011 08:46:07 -0400 Received: from shalem.localdomain (vpn1-4-232.ams2.redhat.com [10.36.4.232]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9VCk552002499 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 31 Oct 2011 08:46:07 -0400 Message-ID: <4EAE98A4.6000700@redhat.com> Date: Mon, 31 Oct 2011 13:46:28 +0100 From: Hans de Goede MIME-Version: 1.0 References: <4EAE6A16.60303@obes.name> In-Reply-To: <4EAE6A16.60303@obes.name> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Performance of USB2.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, On 10/31/2011 10:27 AM, Til Obes wrote: > Hello all, > > i want to use a virtual router which is connected to a cable box > via an usb ethernet controller. The device itself runs properly > at normal usage. But inside the virtual machine i get only about 7MBit. > I configured the the usb device with the following xml syntax of > libvirt: > >
> > > > > > > > > Inside the guest i get this output of lsusb: > Bus 001 Device 002: ID 9710:7830 MosChip Semiconductor MCS7830 10/100 Mbps Ethernet adapter > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > lsusb -v shows this output for the root hub: > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 2.00 > bDeviceClass 9 Hub > bDeviceSubClass 0 Unused > bDeviceProtocol 0 Full speed (or root) hub > bMaxPacketSize0 64 > idVendor 0x1d6b Linux Foundation > idProduct 0x0002 2.0 root hub > bcdDevice 2.06 > iManufacturer 3 Linux 2.6.32-5-amd64 ehci_hcd > iProduct 2 EHCI Host Controller > iSerial 1 0000:00:07.0 > > Does this "Full speed" mean, that it is still running with 12MBit? No, as lsusb says bDeviceProtocol 0 is standard for root hubs even for usb2 (so high speed / 480mbit capable) root hubs. > What is the status of High Speed USB (480Mbit) inside the guest? It should work fine since qemu 0.15. If you're using libvirt to start qemu, then it will also pass -usb to qemu, so you will have both a usb-1 (uhci) and a usb-2 (ehci) controller inside your vm, since your hostdev xml code does not specify a bus the hostdev will likely get connected to the first usb bus which is the one attached to the uhci controller, although your lsusb output suggests otherwise (to my surprise). So assuming that I'm reading your lsusb output correct, the device does seem to be connected to the virtual ehci controller rather then to the virtual uhci controller, which more or less rules that out as the cause. This means that the likely cause is just that usb emulation / pass through causes quite a bit of overhead, which is not unexpected since both the usb protocol and the ehci controller interface are both quite hard to emulate. It is likely better to just use the usb nic directly from the host, and then pass it through the virtio-net using bridging. Regards, Hans