lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Zero copy pbufs (Re: [lwip] Memory leak and queued packets


From: Adam Dunkels
Subject: [lwip-users] Zero copy pbufs (Re: [lwip] Memory leak and queued packets in etharp.c)
Date: Wed, 08 Jan 2003 23:48:47 -0000

Hi!

On Mon, 2002-11-11 at 22:08, Leon Woestenberg wrote:
> Then, the question is: how can zero-copy be used between
> application-managed-memory
> and lwIP in the current architecture?
> 
> The PBUF_ROM type can be used to exploit the "zero-copy" feature of lwIP,
> i.e.
> payload is never redundantly copied between data and network interface
> hardware.
> 
> This is a desirable feature. (Many UNIX stacks are not zero-copy; one of the
> BSDs
> recently has achieved the "zero-copy" feature, cannot remember if it was
> NetBSD or
> one of the others.)
> 
> AFAIK, abusing PBUF_ROM is the only way to exploit zero-copy of payload data
> in
> application-managed-memory.
> 
> For non-ROM non-lwIP managed memory, maybe the introduction of PBUF_REF
> is desirable. It has the same properties as PBUF_ROM, only that the data
> itself is
> not be considered constant after it has been submitted to lwIP.
> 
> Using such an approach would allow zero-copy in case the packet can be
> immediately
> send, or payload-copying in case the packet is queued in lwIP.

Adding a PBUF_REF type sounds like a very good way to do it. A callback
probably is the best way to handle the notification when the memory can
be reused.

/adam
-- 
Adam Dunkels <address@hidden>

[This message was sent through the lwip discussion list.]




reply via email to

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