lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Performance issue: sending large buffers


From: Vincenzo Di Paolo
Subject: [lwip-users] Performance issue: sending large buffers
Date: Wed, 20 Jul 2022 19:00:28 +0200

Hi all,

I am porting an old application to a new platform using FreeRTOS+lwIP. The problem is, the data rate of the new application is not nearly close to the old one. I'm talking about 200 kbps versus 8 Mbps.

I searched around for a solution but I suppose my application is very peculiar, because I didn't really find anything useful.

Essentially the application is made up by a few tasks: a business logic task, a TCP server (which receives most of the traffic) and 2 UDP servers used very rarely. The TCP server waits for new connections, receives some commands and passes them to the business logic task. The last of these commands is used to send a large buffer to the client (around 4 MB) generated by the business logic task.

Just like in the old application, I'm using the Berkeley socket like API (lwip_socket, lwip_send, lwip_recv, etc...). In particular, for sending the large buffer:

sent = lwip_send(cli_sock, (void*)buf, len, 0);

I've already tried some tweaks to increase the performance but I didn't manage to obtain a data rate higher than 200 kbps:
In the following the specifications of the old and new platforms.

Old platform:
New platform:
  • Microsemi SmartFusion2 FPGA
  • ARM M3
  • MAC: ARM MAC
  • DDR3 RAM
  • OS: FreeRTOS
  • TCP/IP stack: lwIP
Some considerations:
  • CPUs and RAMs are running at about the same frequencies of the old platform.
  • Task priorities are the same as the old application.
  • Both PHYs manage to negotiate full duplex 100 Mbps.
  • When the TCP server task calls the lwip_send function, all the other tasks are waiting on some event, so the "tcpip_thread" task should be the only one to be scheduled, can you confirm that?
The only things I can think of now are some tweaks to implement in the "lwipopts.h" file or in the MAC driver, but I have no clue.

What do you think? What can I do to improve the data rate? Any suggestions? Or experience with sending large buffers?

Thank you very much,
Vince.

reply via email to

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