From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLAmQ-0001u8-21 for qemu-devel@nongnu.org; Tue, 01 Nov 2011 05:37:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLAmK-00028p-4B for qemu-devel@nongnu.org; Tue, 01 Nov 2011 05:37:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLAmJ-00028a-QL for qemu-devel@nongnu.org; Tue, 01 Nov 2011 05:37:08 -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 pA19b6du011540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Nov 2011 05:37:06 -0400 Message-ID: <4EAFBDBF.3070109@redhat.com> Date: Tue, 01 Nov 2011 10:37:03 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <4EAE6A16.60303@obes.name> <4EAE98A4.6000700@redhat.com> In-Reply-To: <4EAE98A4.6000700@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 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: Hans de Goede Cc: qemu-devel@nongnu.org Hi, > 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. I think the main issue here is that we don't do buffering / pipelining for bulk transfers at the moment. We grab a single transfer request from the guest, pass it to the kernel, when it is done pass it back to the guest, then look look for the next one. Instead we could queue up all transfer requests from the guest to the kernel, which would give a noticable better throughput. The qemu usb subsystem can't handle that (yet). Fixing that is one the TODO list though. Additionally all bulk xfer processing is done in the 1000 Hz frame timer, which combined with the above limits the number of packets to 1000 packets per second (and direction), i.e. with a MTU of 1500 you'll get 1500 * 1000 = 1.5 MB/s max. This you can expect to get with the current code. Add some protocol and other overhead to the 7 MBit/s you are actually seeing and the numbers are pretty close, so there isn't much room to improve things. The only option I see is to operate the device with an larger MTU if the usb device and your network setup can handle that. HTH, Gerd