Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jan 2011 10:45:35 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: libusb performance on 8.1
Message-ID:  <6B2C00E3-1BDB-48D5-AC3E-E2ED7091E194@gsoft.com.au>
In-Reply-To: <201101221433.23194.hselasky@c2i.net>
References:  <9CF6C32F-E230-446B-94FC-C57F0F02B0E4@gsoft.com.au> <201101221433.23194.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On 23/01/2011, at 24:03, Hans Petter Selasky wrote:
>> While doing some speed testing I find that FreeBSD does ~4Mb/sec, but =
Linux
>> does 17Mb/sec & OS X does 8-10Mb/sec.
>=20
> You need to change the way you buffer the data. FreeBSD does not queue =
more=20
> than 2 URB's at any time, and the turnaround time varies from 1ms to =
125us due=20
> to hardware IRQ restrictions. Linux queues up all it can get, which =
leads to=20
> other kind of problems. The current internal buffer limit is 16Kbyte =
8000=20
> times per second which gives a MAX of 128 MByte/second.
>=20
> In general during hardware design:
>=20
> 1) Avoid short packets.
> 2) Make sure transfer buffers are matched between host and device.
>=20
> =46rom my experience it is very possible to reach +30Mbyte/second with =
LibUSB=20
> under FreeBSD 8.2+, given the buffering is optimal for the kernel.
>=20

Hmm... I am transferring fixed size packets of 512 bytes, so there =
shouldn't be any short packets (unless I misunderstand what you mean).

Ahh, I I see what you mean now.. I was transferring a single packet at a =
time because I didn't realise you could transfer more at once.

If I switch to transferring 2k at once it goes up to 16Mb/sec.

Thanks :)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C









Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6B2C00E3-1BDB-48D5-AC3E-E2ED7091E194>