BDs (Buffer Descriptors) are a sequential list of 2-word (8 byte) entries
that contain status that the program and hardware update, the buffer length,
and a pointer to the buffer.  The last BD has a bit marking the last and the
PowerPC has a register to know the first. It can cycle through the BDs using
buffers as needed.  It checks each BD status for the next free one and
stores the packet into memory pointed to by the BD.  The program clears a
bit when it's done with a buffer and the PPC sets the bit when it's filled a
buffer.  It's a pretty cool mechanism I've not seen before.
Isn't that normal BD behaviour? Anyway, the opencores MAC does it that way, too. What you have to do is allocate one PBUF_POOL that has the size of the maximum received ETH frame for each BD. When one BD changes to 'received', use the address stored in the BD to get back the pbuf pointer (will be ~16 bytes below for PBUF_POOLs), allocate a fresh PBUF_POOL, store its payload address into the BD and set it as available again. At this point, you have the BD available for receiving again and can pass the previous PBUF_POOL into the stack (without copying at all)!

Simon


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to