FreeBSD ARM network speed

Stanislav Sedov stas at FreeBSD.org
Fri Oct 2 09:35:47 UTC 2009


On Fri, 2 Oct 2009 12:58:38 +0700
Yohanes Nugroho <yohanes at gmail.com> mentioned:

> I have two question:
> 1. Is the network speed in Freebsd ARM currently slower than Linux ARM?
>

I don't think so.  Our network stack is arch-independent and should perform
equally well on all platforms.  I've been able to acchieve speeds up to
70 Mbps on my 180Mhz AT91 based board which uses very plain and dumb
ethernet controller (although, DMA is supported).

> Here is how the sending part works on STR9104:
> 
> - In the initialization part, I allocate a ring, the size of the ring
> is 256 entries (same as Linux version).
> - When being asked to send a packet, I will do the following thing:
>   - stop the network TX DMA
>   - put the address of each segment of the packet to the ring, and set
> a flag so that the entry in the ring will be sent by hardware
>   - start the network TX DMA
> 

This looks weird.  Why do you stop the TX engine to add more packets
in the ring?  This thing definitely can kill the network performace
as the controller unable to transmit anything during the time you're
filling the ring.  You should not also generally transmit only one
packet a time as in this case your driver will do a lot of extra
work and, considering that you're stopping the TX engine when filling
the ring, will prevent the adapter doing any useful work.

The main strategy of the driver should be to keep the ring filled,
waking up when some reasonable amount of space in the ring become
available, and sleeping all other time when the adapter is working.
I'm not sure why Linux doesn't use interrupt, but this looks really
wrong.

I'd suggest you to ananlyze the performance of network driver
either by using the profiling tools available (kgmon, hardware
counters (if any)) or/and via system monitoring tools (top, etc).
Top, in particular, will allow you to see where all the CPU time 
went.

-- 
Stanislav Sedov
ST4096-RIPE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20091002/e028db3a/attachment.pgp


More information about the freebsd-net mailing list