[ECOS] The performance of ethernet driver and freebsd stack is not good

Andrew Lunn andrew@lunn.ch
Wed Jan 12 08:21:00 GMT 2005


On Wed, Jan 12, 2005 at 11:47:08AM +0800, Jack wrote:
> Hi all:
>   I am new at ecos os. I am working at Ethernet driver and tcp/ip stack.
>   But I find the performance of driver and stack is not good enough.
>   I test them by nc_test_master and nc_test_slave including in ecos package.
>   TCP_echo item shows the through is about 12Mb/s.
>   And at the same platform(ARM7 TDMI at 80 MHZ), the through is about 32 Mb/s
>   on uClinux os.
>   The problem let the through so low will be the stack or Ethernet driver?

eCos is not expected to reach the same performance as Linux in terms
of networksing. Linux is a general purpose OS which has a very
optimized TCP/IP stack and driver interface. eCos is a real time
operating system, which is optimized to give low latency to switching
threads. To some extent these two aims are mutually exclusive. Linux
acheives part of its performance by doing all the networking stuff
inside interrupts handlers and in kernel space. This means that user
processes loose out when there is heavy network traffic. For an RTOS
this is not acceptable. TCP/IP is intrisinsicly not real time and
should not interfere with threads that are real time. So eCos does
only the minimum needed in interrupts context and the rest of the
device driver and TCP/IP stack is run in a thread. This allows high
priority threads to preemtpy the low priority networking. The down
side of this is it adds some overheads and the network stack does not
run as fast.

Having said that, the difference between 12 and 32 is quite large, so
it does look like there is something else going on here.

You have not said what ethernet device you are using. You might want
to check if the Linux version is using DMA while the eCos version is
polled IO. 

I would also suggest you run the profiler on eCos and find out where
it is spending time. You might be able to optimize a few routines to
speed things up a bit. 

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list