lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Transferring large data fast and pointing pbufs directl


From: address@hidden
Subject: Re: [lwip-users] Transferring large data fast and pointing pbufs directly to Ethernet receive buffers
Date: Wed, 12 Dec 2007 21:31:52 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)


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




reply via email to

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