USB Performance on Raspberry Pi

Hans Petter Selasky hans.petter.selasky at bitfrost.no
Sun Jul 7 07:45:35 UTC 2013


Hi,

The DWC OTG hardware DMA API for doing USB transfers is simply crap, custom made and non-standard compared to XHCI/UHCI/OHCI and EHCI. I`ve chosen stability over throughput. Be glad the driver in the tree works reliably for BULK/CONTROL/INTERRUPT transfer types and all USB speeds.

Ping times are high because we use a 10ms timer to poll USB transfers. This is due to some design decisions made by the Synopsys guys, called a single shared fifo. Other chipset makers do this part completely different.

If you look at the linux USB mailing list you will see a lot of error reports regarding the DWC OTG and raspberry PI, for example in-ability to use USB audio devices, which even under Linux's DMA support require 8000 IRQ/s. The main reason we are getting low throughput is because the internal bus of the ARM core they use in the RPi is slow. Maybe there are some knobs to beef it up or adjust the clocks?

--HPS
 
-----Original message-----
> From:Peter Jeremy <peter at rulingia.com <mailto:peter at rulingia.com> >
> Sent: Sunday 7th July 2013 5:18
> To: Hans Petter Selasky <hselasky at c2i.net <mailto:hselasky at c2i.net> >
> Cc: freebsd-arm at freebsd.org <mailto:freebsd-arm at freebsd.org> 
> Subject: USB Performance on Raspberry Pi
> 
> Hi Hans,
> 
> USB performance on the Raspberry Pi is rather lacking.  This is important
> because pretty much everything goes via USB.  Do you have any suggestions
> on how to fix the bottlenecks?  I suspect one is that FreeBSD is using
> PIO, whereas Linux is using DMA.
> 
> I've previously commented about the sawtooth pattern in ping times:
> 64 bytes from 192.168.123.231: icmp_seq=6 ttl=64 time=2.701 ms
> 64 bytes from 192.168.123.231: icmp_seq=7 ttl=64 time=1.465 ms
> 64 bytes from 192.168.123.231: icmp_seq=8 ttl=64 time=10.589 ms
> 64 bytes from 192.168.123.231: icmp_seq=9 ttl=64 time=9.688 ms
> 64 bytes from 192.168.123.231: icmp_seq=10 ttl=64 time=8.673 ms
> 64 bytes from 192.168.123.231: icmp_seq=11 ttl=64 time=7.330 ms
> 64 bytes from 192.168.123.231: icmp_seq=12 ttl=64 time=6.857 ms
> 64 bytes from 192.168.123.231: icmp_seq=13 ttl=64 time=5.946 ms
> 64 bytes from 192.168.123.231: icmp_seq=14 ttl=64 time=3.955 ms
> 64 bytes from 192.168.123.231: icmp_seq=15 ttl=64 time=2.079 ms
> 64 bytes from 192.168.123.231: icmp_seq=16 ttl=64 time=1.072 ms
> 
> Whereas pinging a Linux RPi gives:
> round-trip min/avg/max/stddev = 0.276/0.373/0.455/0.049 ms
> 
> yongari@ gave me same patches for the SMSC NIC but they didn't have
> any noticable effect.
> 
> And the network throughput is also well below what Linux can achieve.
> 
> If I connect an external USB disk to a Linux RPi, I get 20.6 MBps
> read.  The same disk on FreeBSD RPi gives 6.3 MBps - with ˜50%
> interrupt time.
> 
> -- 
> Peter Jeremy
> 



More information about the freebsd-arm mailing list