lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] udp (RFC!)


From: Kieran Mansley
Subject: Re: [lwip-users] udp (RFC!)
Date: Tue, 18 Mar 2003 09:11:33 +0000 (GMT)

On Mon, 17 Mar 2003, Leon Woestenberg wrote:
> Correct me if I'm wrong, but I thought all BSD socket calls give their
> buffer by reference. In that case, we could still deploy the zero-copy
> tactic used by lwIP, but have lwIP do a copy-on-demand in case it
> cannot handle the data directly (during the blocking call).

Unfortunately zero-copy is much harder than that.  There are numerous
places where data can be queued after the sockets layer has returned to
the application, and even if you can preserve the data until it really is
written (not just put on a DMA queue as David points out) you still need
to prevent the application destroying it until you have received an ACK in
case you have to retransmit.  With sockets this is extremely hard as there
is no way to notify the application that it is safe to re-use the buffer,
and so a copy is necessary to guarantee correctness.  If a buffer really
is in ROM (or is completely static for the lifetime of the application)
and will not be overwritten then it is safe to not copy it, but that is
something of a special case.

I've just finished writing a paper on exactly this problem if anyone is
interested in reading more about it.

Kieran





reply via email to

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