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

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Sat 20 Mar 2010 10:40:29 AM UTC  
 
Category: pbufsSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 04 May 2010 07:36:59 PM UTCgoldsimonStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri 30 Apr 2010 07:09:12 PM UTCgoldsimonStatusNone=>In Progress
      Assigned toNone=>goldsimon
      Planned Release=>1.4.0

    Back to the top


    Powered by Savane 3.1-cleanup1