English
Language : 

LAN9353 Datasheet, PDF (222/523 Pages) Microchip Technology – Interfaces at up to 200Mbps via Turbo MII
LAN9353
10.4 Buffer Manager (BM)
The Buffer Manager (BM) provides control of the free buffer space, the multiple priority transmit queues, transmission
scheduling and packet dropping. VLAN tag insertion and removal is also performed by the Buffer Manager. The follow-
ing sections detail the various features of the Buffer Manager.
10.4.1 PACKET BUFFER ALLOCATION
The packet buffer consists of 32 kB of RAM that is dynamically allocated in 128 byte blocks as packets are received. Up
to 16 blocks may be used per packet, depending on the packet length. The blocks are linked together as the packet is
received. If a packet is filtered, dropped or contains a receive error, the buffers are reclaimed.
10.4.1.1 Buffer Limits and Flow Control Levels
The BM keeps track of the amount of buffers used per each ingress port. These counts are used to generate flow control
(half-duplex backpressure or full-duplex pause frames) and to limit the amount of buffer space that can be used by any
individual receiver (hard drop limit). The flow control and drop limit thresholds are dynamic and adapt based on the cur-
rent buffer usage. Based on the number of active receiving ports, the drop level and flow control pause and resume
thresholds adjust between fixed settings and two user programmable levels via the Buffer Manager Drop Level Register
(BM_DROP_LVL), the Buffer Manager Flow Control Pause Level Register (BM_FC_PAUSE_LVL) and the Buffer Man-
ager Flow Control Resume Level Register (BM_FC_RESUME_LVL) respectively.
The BM also keeps a count of the number of buffers that are queued for multiple ports (broadcast queue). This count is
compared against the Buffer Manager Broadcast Buffer Level Register (BM_BCST_LVL) and if the configured drop level
is reached or exceeded, subsequent packets are dropped.
10.4.2 RANDOM EARLY DISCARD (RED)
Based on the ingress flow monitoring detailed in Section 10.3.6, "Ingress Flow Metering and Coloring," on page 215,
packets are colored as Green, Yellow or Red. Packets colored Red are always discarded if the Drop on Red bit in the
Buffer Manager Configuration Register (BM_CFG) is set. If the Drop on Yellow bit in the Buffer Manager Configuration
Register (BM_CFG) is set, packets colored Yellow are randomly discarded based on the moving average number of
buffers used by the ingress port.
The probability of a discard is programmable into the Random Discard Weight table via the Buffer Manager Random
Discard Table Command Register (BM_RNDM_DSCRD_TBL_CMD), the Buffer Manager Random Discard Table Write
Data Register (BM_RNDM_DSCRD_TBL_WDATA) and the Buffer Manager Random Discard Table Read Data Register
(BM_RNDM_DSCRD_TBL_RDATA). The Random Discard Weight table contains sixteen entries, each 10-bits wide.
Each entry corresponds to a range of the average number of buffers used by the ingress port. Entry 0 is for 0 to 15
buffers, entry 1 is for 16 to 31 buffers, etc. The probability for each entry is set in 1/1024. For example, a setting of 1 is
1-in-1024 or approximately 0.1%. A setting of all ones (1023) is 1023-in-1024 or approximately 99.9%.
Refer to Section 10.7.4.10, "Buffer Manager Random Discard Table Command Register (BM_RNDM_DSCRD_T-
BL_CMD)," on page 328 for additional details on writing and reading the Random Discard Weight table.
10.4.3 TRANSMIT QUEUES
Once a packet has been completely received, it is queued for transmit. There are four queues per transmit port, one for
each level of transmit priority. Each queue is virtual (if there are no packets for that port/priority, the queue is empty) and
dynamic (a queue may have any length if there is enough memory space). When a packet is read from the memory and
sent out to the corresponding port, the used buffers are released.
10.4.4 TRANSMIT PRIORITY QUEUE SERVICING
When a transmit queue is non-empty, it is serviced and the packet is read from the buffer RAM and sent to the transmit
MAC. If there are multiple queues that require servicing, one of two methods may be used: fixed priority ordering or
weighted round-robin ordering. If the Fixed Priority Queue Servicing bit in the Buffer Manager Configuration Register
(BM_CFG) is set, a strict order, fixed priority is selected. Transmit queue 3 has the highest priority, followed by 2, 1 and
0. If the Fixed Priority Queue Servicing bit in the Buffer Manager Configuration Register (BM_CFG) is cleared, a
weighted round-robin order is followed. Assuming all four queues are non-empty, the service is weighted with a 9:4:2:1
ratio (queue 3,2,1,0). The servicing is blended to avoid burstiness (e.g., queue 3, then queue 2, then queue 3, etc.).
DS00001925A-page 222
 2015 Microchip Technology Inc.