qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Performance of USB2.0
Date: Tue, 01 Nov 2011 10:37:03 +0100	[thread overview]
Message-ID: <4EAFBDBF.3070109@redhat.com> (raw)
In-Reply-To: <4EAE98A4.6000700@redhat.com>

  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

  parent reply	other threads:[~2011-11-01  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31  9:27 [Qemu-devel] Performance of USB2.0 Til Obes
2011-10-31 12:46 ` Hans de Goede
2011-10-31 13:37   ` Til Obes
2011-10-31 15:22     ` Hans de Goede
2011-11-01  9:37   ` Gerd Hoffmann [this message]
2011-11-01 13:42     ` Til Obes
2012-01-05 16:29     ` Til Obes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EAFBDBF.3070109@redhat.com \
    --to=kraxel@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).