> This sounds very similar to the buffer descriptors on the Atmel > AT91SAM7X chips that I'm using. Like Jonathan was saying, there are some > changes being tossed around for changing the way pbuf's work that should > make something like this more elegant. > > For now, this is how I solved the problem: > > I use in lwipopts: > #define PBUF_POOL_SIZE 100 // Allows for about 8 full-size > (1500 byte) packets > #define PBUF_POOL_BUFSIZE 128 // The receive descriptors are fixed > at 128 bytes > > I fill the buffer descriptor table with 32 empty pbuf's from this pool > (setting the table entry to point to the pbuf payload itself, so a > couple words after the start of the pointer I get back from pbuf_alloc). > As packets come in, I pull them out of the descriptor table, chain them > together, and then send it up the stack (no copy necessary). I replace > their entries with fresh pbuf's from the pool. When the pbuf is freed > after the application is done, then it gets put back in the pool.
Jared, you and Simon straightened me out, finally. It's seems so obvious now - changing the BD to point to a new pbuf and sending the previous one on for processing which will be freed when it's done is perfect. I was in the wrong mindset of thinking the BDs were static. Thank you again! Bill _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
