This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2431: Are there any settings that can improve the message processing speed in LWIP?

Part Number: AM2431
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I am using SDK8.3.0 (It is currently difficult for us to upgrade to the latest SDK version.)

I am testing whether the actions are correct under the load of the network. And I found the delay in ACK processing.

My load environment is:Every 10 milliseconds, 10 pieces of udp data with lengths ranging from 10 to 1000 will be sent.

After running for a period of time, it will be found that the processing of ACK is delayed.

Sender(using LWIP):192.168.1.16

Receiver:192.168.1.94

The packets captured by Wireshark are as follows, and the ACKs from 1 to 6 are all processed normally.

The serial output of the ACK message in LWIP is as follows.

For the 7th packet, the receiver has sent an ACK, but the sender seems to have either not received this ACK or has not processed it.

I suspect that the delay in processing the ACK is due to handling the UDP load packets.

Can you give me some advice on how to improve the speed of message processing?

  • By the way I have changed some setting in lwipopts.h

    #define MEMP_NUM_TCP_SEG        128->400

    #define PBUF_POOL_SIZE               30->50

    #define TCP_SND_BUF             (8 * TCP_MSS)->  (40 * TCP_MSS)

  • Hi ,

    Thanks for your query.

    I will check on this and get back to you.

    Regards

    Ashwani

  • The issue looks to be stack related. Please check this with lwip forum.

    • Screenshot shows TCP packet while you write UDP traffic

    Some suggestions to try:

    Please check

    • LWIP STATS
    • MACPORT stats
    • HOSTPORT stats

    and confirm the behavior is reflecting in stats as well.

    Regards

    Ashwani

  • Thanks for your suggestions. I will check this with Lwip forum.

    I would like to ask one more thing.

    I want to adjust the priority of tasks in LWIP.

    Can you give me some suggestions on how to adjust the priorities of internal LWIP tasks and their relationship with the priorities of APP side tasks?

    For example, APP task (low) < tcpip thread priority < Lwip2Enet_rxPacketTask (high).

  • Hi,

    You can look for below code and update as per requirement

    File: lwip_opts.h:

    /* TCP thread priority level*/
    #define TCPIP_THREAD_PRIO                7

    File: <mcu_plus_sdk>/source/networking/enet/core/sysconfig/networking/.meta/enet_cpsw/templates:

    #define OS_TASKPRIHIGH 8U
    #define LWIPIF_RX_PACKET_TASK_PRI (OS_TASKPRIHIGH)
    #define LWIPIF_TX_PACKET_TASK_PRI (OS_TASKPRIHIGH)
    #define LWIP_POLL_TASK_PRI (OS_TASKPRIHIGH - 1U)

    Regards

    Ashwani