lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Desired - reference netconn_write() to external memory


From: Kieran Mansley
Subject: Re: [lwip-users] Desired - reference netconn_write() to external memory
Date: Tue, 10 Oct 2006 19:30:29 +0100
User-agent: Mutt/1.5.11

On Tue, Oct 10, 2006 at 04:01:56PM +0000, Alan Lamphier wrote:

> What came to mind today was the possibility to call netconn_write() with
> NO_COPY, referencing an external memory location instead of pointing to an
> internal buffer.

If you can guarantee that the data will still be accessible should TCP
need to retransmit the packet some time later it should be fine to
call without requesting a copy.  The copy is necessary as normally
when the write call returns the caller is free to do what it likes
with the buffer that it has just passed in.  TCP may need to access
that memory many times, and so it has to copy it to make sure it's
still available.

I'm not sure about your hardware but depending on the speed of the
external memory compared to RAM, doing the copy may surprisingly help
performance.  If the external memory was slow, and TCP tried to read
from it many times (e.g. checksum, write to network, and retransmit)
it might have worked out faster to just read it from the slow external
memory into faster RAM once and then TCP can access it from there.
Something to consider anyway.

Hope that helps,

Kieran




reply via email to

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