lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #9734] fix TCP_CLOSE in high load applications


From: Dainius Zilys
Subject: [lwip-devel] [patch #9734] fix TCP_CLOSE in high load applications
Date: Fri, 14 Dec 2018 04:08:43 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

URL:
  <https://savannah.nongnu.org/patch/?9734>

                 Summary: fix TCP_CLOSE in high load applications
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: vakaras
            Submitted on: Fri 14 Dec 2018 09:08:41 AM UTC
                Category: TCP
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

api_msg.c file:

When a TCP socket has a CLOSE_WAIT state, the  recv_tcp() function sends a
message to tcpip_thread() to close the socket. After that, function continues
to work the pcb, calls API_EVENT(). 

In a high load CPU usage and high Ethernet bitrate, OS switches to
tcpip_thread() just after the post, which releases pcb BEFORE the API_EVENT()
has been executed. This memory block becomes free, and a new Ethernet packet
arrives into the pcb location. So we have a hard fault.

Resolution: to call the API_EVENT() before the sys_mbox_trypost()



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 14 Dec 2018 09:08:41 AM UTC  Name: tcp_close_api_msg.patch  Size:
950B   By: vakaras
A patch to fix tcp close
<http://savannah.nongnu.org/patch/download.php?file_id=45648>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9734>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

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