A QoS scheduler, scheduling method, and computer program product are provided
for
implementing Quality-of-Service (QoS) scheduling with detecting and anticipating
the end of a chain of flows. A first indicator is provided for indicating a number
of flows being chained to a physical entry. A second indicator is provided for
indicating when the first indicator has saturated. The second indicator is set
active for a flow whose chaining causes the first indicator to saturate. During
de-chaining of the flows from the physical entry, the second indicator is used
to determine when the first indicator becomes accurate to begin decrementing the
first indicator. The first indicator is decremented for detecting the end of the
chain of flows. Responsive to the first indicator being not saturated, the first
indicator is used for anticipating the end of a chain of flows. The first indicator
and the second indicator include a predefined number of bits or n-bits. The first
indicator includes n-1 bits stored in a physical entry and the second indicator
includes 1-bit stored in a chained link list.