lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Packet queues (was Re: [bug #11400] ARP multi-packet-qu


From: Kieran Mansley
Subject: Re: [lwip-devel] Packet queues (was Re: [bug #11400] ARP multi-packet-queue modifies TCP ...)
Date: Tue, 10 Apr 2007 10:59:26 +0100

On Thu, 2007-04-05 at 16:44 +0100, Jonathan Larmour wrote:

> 
> A new pbuf type seems the most backwardly compatible approach as no 
> external APIs change, and drivers don't even have to support it: the user 
> can ensure they only use it if they know the driver supports it. The notion 
> of whether that pbuf needs copying or not stays with the pbuf all the way 
> through the stack with no further changes. This approach is also amenable 
> to being a configurable option since it should be well contained. Pretty 
> much the only special treatment for PBUF_RAM_NOCOPY would be in the low 
> level drivers themselves, which would call pbuf_free() on tx completion for 
> this type of pbuf.
> 
> Note that tcp_write is already asymmetric with udp_send: the former takes a 
> character array and length, the latter takes a pbuf instead of those args. 
> This change would only mean the pbuf also subsumes the 'copy' property as 
> well.

You make a compelling case!  I find the change in ownership of the pbuf
depending on its type a little disconcerting though - I prefer APIs to
have few special cases like this, unless they are really obvious.  Would
we also need to introduce ROM_NOCOPY and POOL_NOCOPY equivalents to
protect against the pbuf structure being reused?  i.e. Is it just the
payload region we're trying to protect, or the whole pbuf structure?

Kieran





reply via email to

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