A dynamic queue allocation and de-allocation mechanism for managing
traffic flowing through a switching node. If a packet matches conditions
of a particular QoS policy rule, a determination is made as to whether a
queue associated with the matched QoS policy rule exists on an egress
port that is to forward the packet. If such a queue does not exist, a
determination is made as to whether enough resources are available for
dynamically creating the queue according to the QoS action parameters of
the matched QoS policy rule. If the new queue may not be created because
of resource limitation, queues of lower priority existing on the port are
reclaimed and their resources reassigned to the new queue.