lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwIP performance with FreeRTOS


From: Simon Goldschmidt
Subject: Re: [lwip-users] lwIP performance with FreeRTOS
Date: Fri, 24 Feb 2012 13:25:03 +0100

Chris Ponder <address@hidden> wrote:

I then switched to the FreeRTOS version of the echo client which contains TCP and UDP tasks. I disabled the TCP task and the pretty flashing LED task and replaced the echo code with the same code I used in the standalone version but using netconn and netbuf. The performance plummeted to barely over 36Mbps, nearly one third of the standalone performance.


I'm assuming you used the same transfer mode (I.e. send by reference or copying the data) with both raw API and netconn API and therefore expect just a tiny overhead?

The traditional way of multitasking in lwIP is to pass messages between threads. This can be quite slow depending on how fast your OS implements task switches as in this mode, you typically have 2 tasks switches per send-call:
- application task calls send, prepares netbuf
- task switch to tcpip_thread, which actually sends the packet
- back to application thread, send function returns

Changing thread priorities doesn't change this behaviour. However, you can try TCPIP_CORE_LOCKING, which changes from thread switching to locking (using a mutex), which has the potential to be faster (again, depending on how your OS implements that and on how you use the stack, I.e. how many application threads you have). I guess it's worth a try.

Simon


reply via email to

[Prev in Thread] Current Thread [Next in Thread]