Skip to content

Commit

Permalink
sch_cake: Fix tin order when set through skb->priority
Browse files Browse the repository at this point in the history
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: 83f8fd6 ("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>
  • Loading branch information
Toke Høiland-Jørgensen authored and David S. Miller committed Jul 16, 2018
1 parent 1eb94d4 commit 301f935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_cake.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
if (TC_H_MAJ(skb->priority) == sch->handle &&
TC_H_MIN(skb->priority) > 0 &&
TC_H_MIN(skb->priority) <= q->tin_cnt) {
tin = TC_H_MIN(skb->priority) - 1;
tin = q->tin_order[TC_H_MIN(skb->priority) - 1];

if (q->rate_flags & CAKE_FLAG_WASH)
cake_wash_diffserv(skb);
Expand Down

0 comments on commit 301f935

Please sign in to comment.