[Top][All Lists]
[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: |
Tue, 28 Feb 2012 16:02:21 +0100 |
Chris Ponder <address@hidden> wrote:
> Using tcpip_callback only gave 65.4 Mbps :(
> ...
> /* Infinite loop */
I'm not sure using an infinite loop is the best example: don't you call
tcpip_callback too often? Also, you don't check the return value...
I'd rather let your ISR check if a call to 'udpSendData()' is already queued
and if so, only set a flag for udpSendData() to loop (maybe with a maximum loop
count to prevent RX from stopping. On the other hand, using that technique you
risk using 100% CPU power for sending...
> while (1)
> {
> // Store then increment the packet count
> *puiPacketNumber = uiPacketCount++;
> szPacket[4] = (unsigned char)NULL;
>
> tcpip_callback(udpSendData, szPacket);
> }
> ...
>
> void udpSendData(void *arg)
> {
> char *szPacket = (char*)arg;
> struct pbuf *p;
>
> /* allocate pbuf from pool*/
> p = pbuf_alloc(PBUF_TRANSPORT, ciPayloadSize, PBUF_POOL);
Pay attentention here to the fact that you now a) use PBUF_POOL instead of
PBUF_RAM so you might end with a pbuf-chain instead of a single pbuf and...
>
> if (p != NULL)
> {
> /* copy data to pbuf */
> pbuf_take(p, (char*)szPacket, ciPayloadSize);
b) pbuf_take() calls memcpy (maybe multiple times) which might slow down the
whole thing.
Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de