A system for managing shared memory resources in a high-speed switching
environment includes a data memory logically divided into multiple blocks
that correspond to multiple credits. The system includes a central agent
that can maintain a pool of available credits that includes one or more
of the credits. The central agent can also allocate a credit to an input
port module from the pool of credits. The allocated credit indicates that
the corresponding one of the blocks is available to the input port
module. The system includes multiple input port modules that can each
track allocated credits received from the central agent, receive a
packet, determine whether enough of the allocated credits are available
to write the packet to the data memory, and, if enough of the allocated
credits are available, write the packet to one or more blocks
corresponding to one or more of the allocated credits that are available.
The system includes multiple output port modules that can each read from
a block and return the credit corresponding to the read block to the pool
of credits.