56.6.5.4 Deficit Weighted Round Robin (DWRR)
Any of the active queues can be selected as DWRR. If DWRR is required, then at least two of the active queues must be selected as DWRR. It must not be used in conjunction with Enhanced Transmission Selection (ETS).
A DWRR enabled queue has lower priority than a fixed priority queue with a higher index.
A DWRR enabled queue has lower priority than a CBS enabled queue.
The DWRR algorithm works by scanning all non-empty queues in sequence. Each queue is allocated a ‘deficit counter’ and an 8-bit weighting (or quantum) value. The value of the deficit counter is the maximum number of bytes that can be sent at the current time.
If the deficit counter of the scanned queue is greater than the length of the packet waiting for transmission, then the packet will be transmitted and the value of the deficit counter is decremented by the packet size. If it is not greater, the scheduler will skip to the next DWRR enabled queue.
If there is insufficient credit to transmit, the queue is simply skipped.
If the queue is empty, the value of the deficit counter is reset to 0.
If all queues have insufficient credit then each tx_clk cycle every queue’s deficit counter is incremented by its quantum value until a queue’s deficit counter obtains sufficient credit to transmit its first queued frame. The higher the quantum value chosen the quicker deficit counter will reach the required value.
If all DWRR queues have the same weighting, then all queues will be granted the same overall bandwidth. The weighting value is stored in four programmable registers starting at offset 0x590.
If CBS is also used in conjunction with DWRR, the DWRR queues will share the remaining bandwidth after the CBS allocation has been deducted.