lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #6735] Provide new pbuf type: PBUF_RAM_NOCOPY


From: Jared Grubb
Subject: [lwip-devel] [task #6735] Provide new pbuf type: PBUF_RAM_NOCOPY
Date: Fri, 10 Aug 2007 18:48:36 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

Follow-up Comment #24, task #6735 (project lwip):

> But I don't think that's workable for PBUF_REF. You may only find deep down
that you need to queue it or copy it, and where it not for that you may not
need to. I think we should keep the existing behaviour of only copying pbufs
when they need to be queued (although it will be incumbent on the stack to
then mark the copy PBUF_RAM_NOCOPY so it isn't copied a further time). 

I propose one policy: All functions in lwIP expect that zero-copy is valid on
pbufs handed to it, except in a handful of exact places on the app/stack
boundary. If a function does something that breaks the zero-copy expectation
to another function, then it must fix it before passing the pbuf on.

If an application submits a PBUF_REF, then it would get copied immediately in
TCP/UDP. If lwIP creates a PBUF_REF at some point, then lwIP knows the
zero-copy requirements already, and there's no need to ever copy it later,
right?

What condition would this fail? Where would "pbuf_copy_required==FALSE" at
the app/stack boundary but later change to TRUE in the driver?

> This also avoids penalty for polled drivers that may not need separate
copying in the driver at all.
I personally think the driver should *never* copy. The stack should take care
of all of that when it is necessary.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6735>

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





reply via email to

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