lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #6330] Limit input packets on tcpip mbox


From: Simon Goldschmidt
Subject: [lwip-devel] [patch #6330] Limit input packets on tcpip mbox
Date: Thu, 06 Dec 2007 20:55:24 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11

URL:
  <http://savannah.nongnu.org/patch/?6330>

                 Summary: Limit input packets on tcpip mbox
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Donnerstag 06.12.2007 um 20:55
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

To prevent the input mbox overflowing, I suggest to define an upper limit of
input packets on the input queue (the mbox in tcpip.c).

The reason for this is even a return value for sys_mbox_post is no good here:
input packets might fill the queue and an application task can't execute a
send call -> unwanted behaviour.

The patch is a simple counting variable: counted up in tcpip_input when
enqueueing a packet, counted down in tcpip_thread when dequeueing a packet. If
an upper limit is reached, tcpip_input returns ERR_MEM and the caller can
delete the packet.

In addition to that, I included 2 defines that are called when the upper
level is reached and left. Normally define to nothing, a user can override
them to get informed. Use case for this would be to turn off TX interrupt
while the queue is full. A hysteresis to block/unblock would help further.

Please see attached patch for the implementation.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Donnerstag 06.12.2007 um 20:55  Name: tcpic.c_limitinput.patch  Size:
2kB   By: goldsimon

<http://savannah.nongnu.org/patch/download.php?file_id=14578>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6330>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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