OSDN Git Service

sch_cake: Add DiffServ handling
authorToke Høiland-Jørgensen <toke@toke.dk>
Fri, 6 Jul 2018 15:37:19 +0000 (17:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jul 2018 03:06:34 +0000 (20:06 -0700)
commit83f8fd69af4f62136765b60fd0efa1c9167917c5
treec2061b6f6c9193b2bd8aa624319056aa43761a0e
parentea82511518f4f2e5fe83d2fe1884ef5fc6be6204
sch_cake: Add DiffServ handling

This adds support for DiffServ-based priority queueing to CAKE. If the
shaper is in use, each priority tier gets its own virtual clock, which
limits that tier's rate to a fraction of the overall shaped rate, to
discourage trying to game the priority mechanism.

CAKE defaults to a simple, three-tier mode that interprets most code points
as "best effort", but places CS1 traffic into a low-priority "bulk" tier
which is assigned 1/16 of the total rate, and a few code points indicating
latency-sensitive or control traffic (specifically TOS4, VA, EF, CS6, CS7)
into a "latency sensitive" high-priority tier, which is assigned 1/4 rate.
The other supported DiffServ modes are a 4-tier mode matching the 802.11e
precedence rules, as well as two 8-tier modes, one of which implements
strict precedence of the eight priority levels.

This commit also adds an optional DiffServ 'wash' mode, which will zero out
the DSCP fields of any packet passing through CAKE. While this can
technically be done with other mechanisms in the kernel, having the feature
available in CAKE significantly decreases configuration complexity; and the
implementation cost is low on top of the other DiffServ-handling code.

Filters and applications can set the skb->priority field to override the
DSCP-based classification into tiers. If TC_H_MAJ(skb->priority) matches
CAKE's qdisc handle, the minor number will be interpreted as a priority
tier if it is less than or equal to the number of configured priority
tiers.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cake.c