lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Understanding pbuf's


From: Bill Auerbach
Subject: Re: [lwip-users] Understanding pbuf's
Date: Tue, 17 Apr 2012 10:46:47 -0400

>I was also wondering: To pre-allocate pbufs, do I have to that in pbuf_init() (which is currently empty) or does LwiP take care of that internally? 

 

I create an array of pbuf pointers in ethernetif_init.  The ISR adds a RX packet to a pbuf next  in line in the array using a circular queue using the array index in and out slot.  Then my low_level_input (which is polled in my case) removes the new RX pbuf(s) and uses pbuf_alloc to replace it/them.  I then return the new RX pbuf.  lwIP will free this packet when it’s done.  The size of the array depends on how much memory you want to tie up in pbufs as they will always be allocated for keeping the array full.

 

 


reply via email to

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