buglwIP - A Lightweight TCP/IP stack - Bugs: bug #29271, Application can't re-use pbufs

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29271: Application can't re-use pbufs

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Sat 20 Mar 2010 10:40:29 AM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Tue 04 May 2010 07:36:59 PM UTC, comment #2: 

Fixed by updating rawapi.doc.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 30 Apr 2010 07:09:12 PM UTC, comment #1: 

I think this must be solved for 1.4.0 since it involves API- or documentation-changes.

Anyone against limiting applications to not re-use pbufs after passing them to send-functions which returned ERR_OK?


Simon Goldschmidt <goldsimon>
Group administrator
Sat 20 Mar 2010 10:40:29 AM UTC, original submission:  

This has been mentioned multiple times, especially regarding ARP-queueing and zero-copy netif drivers:

Currently, we have no clear documentation whether an application may reuse a pbuf passed to udp_send/raw_send. I had the impression it was allowed (which is the reason ARP-queueing has to copy even single-PBUF_RAM-pbufs when queueing), but that isn't really correct, as the pbuf's payload is change when udp_send returns (i.e. from the UDP payload to the ethernet header). After all, ARP-queueing behaves just like a really slow zero-copy-MAC: it has a reference on the pbuf until it is sent.

If we wanted to allow this we would:
a) have to limit reusing to p->ref == 1 (if > 1, the pbuf is still queued somewhere)
b) somehow set back the payload pointer to the original status, which is kind of hard when the pbuf is queued for sending (cannot set the payload pointer back while returning from the various send layers since the pbuf might still be queued).

To sum it up, I think we need to update the documentation so that an application is not allowed to reuse pbufs passed to send functions. This also allows easier implementation of TX-zero-copy netif drivers.

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-04 goldsimon StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2010-04-30 goldsimon StatusNone In Progress
        Assigned toNone goldsimon
        Planned Release 1.4.0

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code