Dual mode QOS
In one embodiment, a network device includes a network interface to receive packets over a packet data network, packet processing circuitry to manage a multiplex network receive queue, and including a policer to provide queue fairness for a plurality of network flows competing for access to the multiplex network receive queue, and including meters to label the received packets, and selectively operate in (a) a two-level mode with two-levels of the meters, and (b) a single-level mode with a single one of the meters, and queueing logic to add some of the received packets to the multiplex network receive queue and drop others of the received packets responsively to labelling of the packets by the meters.
1 . A network device, comprising:
a network interface to receive packets over a packet data network;
packet processing circuitry to manage a multiplex network receive queue, and including:
a policer to: provide queue fairness for a plurality of network flows competing for access to the multiplex network receive queue, and including meters to label the received packets, and selectively operate in: (a) a two-level mode with two-levels of the meters; and (b) a single-level mode with a single one of the meters; and automatically selectively toggle between the two-level mode and the single-level mode; and
queueing logic to add some of the received packets to the multiplex network receive queue and drop others of the received packets responsively to labeling of the packets by the meters.
2 . The network device according to claim 1 , wherein:
in the two-level mode, the two-levels of meters include:
level one meters to receive first packets from the network interface and label the first packets; and
a level two meter to receive at least some of the labeled first packets from the level one meters and relabel the at least some labeled first packets;
in the single-level mode, the level two meter is to receive second packets from the network interface and label the second packets; and
the queueing logic is to add ones of the first packets and the second packets labeled with a first label-type or a second label-type to the multiplex network receive queue and drop ones of the first packets and the second packets labeled with a third label-type.
3 . The network device according to claim 2 , wherein the packet processing circuitry is to configure packet steering to feed the first packets into the level one meters according to the network flows when toggling from operating in the single-level mode to operating in the two-level mode.
4 . The network device according to claim 2 , wherein the meters are to label the packets according to three label-types based on available per meter credits for the first label-type and the second label-type.
5 . The network device according to claim 4 , wherein the packet processing circuitry is to:
consume the available per meter credits according to a bandwidth of the packets for the level one meters;
periodically replenish the available per meter credits for the level one meters;
consume the available packet credits according to a number of the packets for the level two meter; and
add back consumed ones of the packet credits responsively to respective ones of the packets being consumed from the multiplex network receive queue.
6 . The network device according to claim 5 , wherein the packet processing circuitry is to assign a bandwidth limit to the first label-type and the second label-type for each of the level one meters according to a bandwidth limit of the multiplex network receive queue.
7 . The network device according to claim 2 , wherein:
the level two meter has a status equal to the first label type or the second label type or the third label type; and
the packet processing circuitry is to toggle the policer from operating in the single-level mode to operating in the two-level mode responsively to detecting that the status of the level two meter is the second label type or the third label type.
8 . The network device according to claim 7 , wherein the packet processing circuitry is to detect the status of the level two meter by sampling a current label being allocated by the level two meter and averaging over a sliding time window.
9 . The network device according to claim 7 , wherein the packet processing circuitry is to toggle the policer from operating in the two-level mode to operating in the single-level mode responsively to a given number or given fraction of the level one meters have a status equal to the first label type.
10 . A networking method, comprising:
receiving packets over a packet data network;
managing a multiplex network receive queue;
providing queue fairness for a plurality of network flows competing for access to the multiplex network receive queue using a policer including meters;
labelling by the meters the received packets;
selectively operating in: (a) a two-level mode with two-levels of the meters; and (b) a single-level mode with a single one of the meters;
automatically selectively toggling between the two-level mode and the single-level mode;
adding some of the received packets to the multiplex network receive queue; and
dropping others of the received packets responsively to the labeling of the packets.
11 . The method according to claim 10 , further comprising:
in the two-level mode:
receiving by level one meters first packets from a network interface and labeling the first packets; and
receiving by a level two meter at least some of the labeled first packets from the level one meters and relabeling the at least some labeled first packets; and
in the single-level mode:
receiving by the level two meter second packets from the network interface and labeling the second packets; and
adding ones of the first packets and the second packets labeled with a first label-type or a second label-type to the multiplex network receive queue and dropping ones of the first packets and the second packets labeled with a third label-type.
12 . The method according to claim 11 , further comprising configuring packet steering to feed the first packets into the level one meters according to the network flows when toggling from operating in the single-level mode to operating in the two-level mode.
13 . The method according to claim 11 , further comprising labeling the packets according to three label-types based on available per meter credits for the first label-type and the second label-type.
14 . The method according to claim 13 , further comprising:
consuming the available per meter credits according to a bandwidth of the packets for the level one meters;
periodically replenishing the available per meter credits for the level one meters;
consuming available packet credits according to a number of the packets for the level two meter; and
adding back consumed ones of the packet credits responsively to respective ones of the packets being consumed from the multiplex network receive queue.
15 . The method according to claim 14 , further comprising assigning a bandwidth limit to the first label-type and the second label-type for each of the level one meters according to a bandwidth limit of the multiplex network receive queue.
16 . The method according to claim 11 , wherein the level two meter has a status equal to the first label type or the second label type or the third label type, the method further comprising toggling the policer from operating in the single-level mode to operating in the two-level mode responsively to detecting that the status of the level two meter is the second label type or the third label type.
17 . The method according to claim 16 , further comprising detecting the status of the level two meter by sampling a current label being allocated by the level two meter and averaging over a sliding time window.
18 . The method according to claim 16 , further comprising toggling the policer from operating in the two-level mode to operating in the single-level mode responsively to a given number or given fraction of the level one meters have a status equal to the first label type.