lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Zero Copy Ethernet interface


From: Goldschmidt Simon
Subject: RE: [lwip-users] Zero Copy Ethernet interface
Date: Thu, 20 Sep 2007 08:08:59 +0200

[re jifl's mail:]
> > 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()?
> 
> [..]
> 
> For you, if you can impose a constraint on your applications 
> that they are not allowed to modify pbufs after transmission 
> (except to free them) then you can get away with just a 
> pbuf_ref() (and consequent pbuf_free() when the transmission 
> completes).
> 

Note that for UDP sockets, PBUF_REFs are used, so you also have
to make sure that socket applications don't change the buffer they
passed to lwip_send afterwards.


[re andrew's mail:]

> input_thread_loop:
>     pbuf_alloc() 1514 bytes
>     pass pbuf to driver and block waiting for packet then DMA from
device
>     pbuf_realloc() <- trim to actual length
>     netif->input()

Which pbuf type do you use here? If you use PBUF_POOL, then
pbuf_realloc()
effectively only adjuts the length information, so small packets still
waste
a significant amount of memory.

Simon




reply via email to

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