lwip-devel
[Top][All Lists]
Advanced

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

RE: [lwip-devel] [bug #21049] Allow reuse of pbufs after return fromAPIs


From: Julian Gardner [RSD]
Subject: RE: [lwip-devel] [bug #21049] Allow reuse of pbufs after return fromAPIs
Date: Wed, 12 Sep 2007 15:27:33 +0100

My initial question was "what was the right way to do this.." as i was having a 
problem with the reusing and in time critical code having to pbuf_alloc and 
pbuf_free every time i want to send a block of data was a bit of a pain.

Also as most of the time i could just point into my circular buffer it would 
save me the time of copying the data for each block, but with my buffers being 
0x20000 and my packet size being 1324 there is a point where i need to copy the 
buffer which overruns the circular data, and i also need to add in special 
packets of 112 bytes every few seconds.

I will be converting my code to use 2 pbufs, one will be a PBUF_REF for the 
main cases where i have access to the circular buffer and the normal alloc for 
other cases.

hope this works and copying 4-5Mb of data every second, i should save quite a 
bit of processor time.

thanks for all the messages and sorry if this is causing any problems, but to 
me i would expect an API to return a pbuf back the way you sent it! I will be 
adding a pbuf_header( p, -???) to my code to see if this allows the reuse to 
work properly.

joolz

-----Original Message-----
From: address@hidden on behalf of Jonathan Larmour
Sent: Wed 12/09/2007 15:14
To: Jonathan Larmour; Simon Goldschmidt; address@hidden
Subject: [lwip-devel] [bug #21049] Allow reuse of pbufs after return fromAPIs
 

Follow-up Comment #2, bug #21049 (project lwip):

The problem is that most people won't be interested in reusing pbufs. The
socket layer won't for example. So we shouldn't add overhead for a usually
unnecssary operation.

A user-created pre-filled pbuf could have been changed in many ways. The
payload pointer could have been changed arbitrarily. The only way you could
guarantee reuse of the contents is to copy the pbuf and payload every time no
matter what. That's too painful.

I think if you really want to reuse pbuf data, you should be using a
PBUF_REF. Otherwise we should draw the line.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?21049>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
lwip-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-devel

<<winmail.dat>>


reply via email to

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