Using tcpip_callback only gave 65.4 Mbps :(
...
/* Infinite loop */
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);
if (p != NULL)
{
/* copy data to pbuf */
pbuf_take(p, (char*)szPacket, ciPayloadSize);
/* send udp data */
udp_send(upcb, p);
/* free pbuf */
pbuf_free(p);
}
}
Cheers
Chris
Chris Ponder
Tritech International Limited
Morecambe Road, Ulverston Cumbria LA12 0BH
++ 44 (0)1229 586672 (tel)
++ 44 (0)1229 586696 (fax)
DDI:++ 44 (0)(0)1229 484261
www.tritech.co.uk
Tritech International Limited is registered in Scotland.
Registered number: 85501. Registered office: Tritech International Ltd,
Peregrine Road, Westhill, Aberdeen.
This message (and any associated files) is intended only for the use of the
individual or entity to which it is addressed and may contain information that
is confidential, subject to copyright or constitutes a trade secret. If you are
not the intended recipient you are hereby notified that any dissemination,
copying or distribution of this message, or files associated with this message,
is strictly prohibited. If you have received this message in error, please
notify us immediately by replying to the message and deleting it from your
computer. Any views or opinions presented are solely those of the author and do
not necessarily represent those of Tritech International Limited. Tritech
International Limited is a Halma Plc company.
please consider the environment before printing this e-mail
-----Original Message-----
From: Simon Goldschmidt
Sent: 28 February 2012 10:24
To: Mailing list for lwIP users
Subject: Re: [lwip-users] lwIP performance with FreeRTOS
Chris Ponder wrote:
> I have been wondering if
> there is a way of using the pbuf interface and encapsulating the whole
> lwIP plus send code in a single thread, but so far this has proved an
> elusive target.
You can let the code that creates pbufs (and sends them) run in tcpip_thread by
calling tcpip_callback(), e.g. when your interrupt (or whatever it is) detects
that data is to be sent, just call tcpip_callback() with a function pointer and
the function pass as parameter runs in tcpip_thread.
When doing this from an ISR, you only have one single task switch from the ISR
to tcpip_thread. Of course RX packets are not processed while doing this, but
from what you wrote, that should be OK.
Oh, and while looking at the lwIP sources, I saw you'd better call
netconn_sendto() instead of netconn_connect() and netconn_send(), as it is
implemented with only 1 call into the core instead of 2.
Another thing to speed up might be cumulating TX-finished interrupts (if you
use them) and generally checking your netif driver is as fast as it can be (are
you using DMA?).
Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis
zu 50,- Euro! https://freundschaftswerbung.gmx.de
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
********************************************************
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this communication is
strictly prohibited. If you have received this transmission in
error please notify the sender immediately and then delete this e-mail.
E-mail transmission cannot be guaranteed to be secure or error free as
information could be intercepted, corrupted lost, destroyed, arrive late or
incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of e-mail
transmission. If verification is required please request a hard copy
version.
********************************************************
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users