Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sch_cake: Fix tin order when set through skb->priority

In diffserv mode, CAKE stores tins in a different order internally than
the logical order exposed to userspace. The order remapping was missing
in the handling of 'tc filter' priority mappings through skb->priority,
resulting in bulk and best effort mappings being reversed relative to
how they are displayed.

Fix this by adding the missing mapping when reading skb->priority.

Fixes: 83f8fd69af4f ("sch_cake: Add DiffServ handling")
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Toke Høiland-Jørgensen and committed by
David S. Miller
301f935b 1eb94d44

+1 -1
+1 -1
net/sched/sch_cake.c
··· 1546 1546 if (TC_H_MAJ(skb->priority) == sch->handle && 1547 1547 TC_H_MIN(skb->priority) > 0 && 1548 1548 TC_H_MIN(skb->priority) <= q->tin_cnt) { 1549 - tin = TC_H_MIN(skb->priority) - 1; 1549 + tin = q->tin_order[TC_H_MIN(skb->priority) - 1]; 1550 1550 1551 1551 if (q->rate_flags & CAKE_FLAG_WASH) 1552 1552 cake_wash_diffserv(skb);