Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
* [Cake] [PATCH net-next] sch_cake: Fix tin order when set through skb->priority
@ 2018-07-16 14:45 Toke Høiland-Jørgensen
  2018-07-16 21:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2018-07-16 14:45 UTC (permalink / raw)
  To: netdev; +Cc: cake, Toke Høiland-Jørgensen

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>
---
 net/sched/sch_cake.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 30695691e9ff..539c9490c308 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -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);
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Cake] [PATCH net-next] sch_cake: Fix tin order when set through skb->priority
  2018-07-16 14:45 [Cake] [PATCH net-next] sch_cake: Fix tin order when set through skb->priority Toke Høiland-Jørgensen
@ 2018-07-16 21:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-16 21:48 UTC (permalink / raw)
  To: toke; +Cc: netdev, cake

From: Toke Høiland-Jørgensen <toke@toke.dk>
Date: Mon, 16 Jul 2018 16:45:09 +0200

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-16 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 14:45 [Cake] [PATCH net-next] sch_cake: Fix tin order when set through skb->priority Toke Høiland-Jørgensen
2018-07-16 21:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox