USB Performance on Raspberry Pi

Oleksandr Tymoshenko gonzo at bluezbox.com
Sun Jul 7 03:32:35 UTC 2013


On 2013-07-06, at 8:23 PM, Warner Losh <imp at bsdimp.com> wrote:

> 
> On Jul 6, 2013, at 9:17 PM, Peter Jeremy wrote:
> 
>> 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.
> 
> sure sounds a lot like the USB polling issues...  Maybe we have a problem with the USB controller generating the proper interrupts, or some interrupt delivery problem?

We use PIO mode which is *really* slow. Linux uses DMA mode. I have this 
half-baked patch I've been sitting on for months:
http://people.freebsd.org/~gonzo/patches/dwc_otg-dma-nosplit.diff

There seems to be stability issues under heavy load and SPLIT transactions 
does not work which affects USB keyboards. I didn't have enough time/motivation 
to finish it :( 


More information about the freebsd-arm mailing list