lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Zero Copy Ethernet interface


From: Paul Black
Subject: [lwip-users] Zero Copy Ethernet interface
Date: Wed, 19 Sep 2007 14:42:55 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20070728)

I'm trying to get to grips with lwip and one of the things I'm looking
at is how data moves between the stack and the ethernet interface.

For input:
The examples ethernetif.c has a function called low_level_input which
copies data from somewhere into a chain of pbufs that are then passed up.

I'm thinking that I can do something like the following:
 - Allocate several pbufs in advance for incoming packets: can I
   allocate a single pbuf as I would need to dechain them otherwise. How
   do I allocate a pbuf of maximum size or find the maximum space in a
   single pbuf?
 - When the packet comes in, find out how many pbufs were used - I'm
   guessing I can then chain them together again with pbuf_cat()?
 - Pass this to wherever.


For output:
I get passed a chain of pbufs:
 - Because I want to hang on to these until an interrupt has fired, I
   guess I need to call pbuf_ref()?
 - It might make my code easier for tidying up after transmission if I
   split the chain into its constituent parts - for this I would call
   pbuf_dechain()?

Am I thinking along the right lines?

Cheers

-- 
Paul





reply via email to

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