From 636e61fffa8c70a92082d7b0474b488da6d441db Mon Sep 17 00:00:00 2001 From: Toastman Date: Sun, 4 Mar 2012 20:46:22 +0700 Subject: [PATCH] fix QOS prios --- .../linux/linux-2.6/include/linux/pkt_sched.h | 8 ++++---- release/src/linux/linux/include/linux/pkt_sched.h | 6 +++--- release/src/router/rc/qos.c | 23 ++++++++++++++++++---- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/release/src-rt/linux/linux-2.6/include/linux/pkt_sched.h b/release/src-rt/linux/linux-2.6/include/linux/pkt_sched.h index e28dd880c8..7e68f2fab5 100644 --- a/release/src-rt/linux/linux-2.6/include/linux/pkt_sched.h +++ b/release/src-rt/linux/linux-2.6/include/linux/pkt_sched.h @@ -256,9 +256,9 @@ struct tc_gred_sopt }; /* HTB section */ -#define TC_HTB_NUMPRIO 10 -#define TC_HTB_MAXDEPTH 8 -#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ +#define TC_HTB_NUMPRIO 11 /* Toastman */ +#define TC_HTB_MAXDEPTH 8 +#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ struct tc_htb_opt { @@ -337,7 +337,7 @@ enum /* CBQ section */ -#define TC_CBQ_MAXPRIO 8 +#define TC_CBQ_MAXPRIO 11 /* Toastman */ #define TC_CBQ_MAXLEVEL 8 #define TC_CBQ_DEF_EWMA 5 diff --git a/release/src/linux/linux/include/linux/pkt_sched.h b/release/src/linux/linux/include/linux/pkt_sched.h index 0c774042e3..5f881d5e38 100644 --- a/release/src/linux/linux/include/linux/pkt_sched.h +++ b/release/src/linux/linux/include/linux/pkt_sched.h @@ -280,9 +280,9 @@ struct tc_gred_sopt }; /* HTB section */ -#define TC_HTB_NUMPRIO 10 +#define TC_HTB_NUMPRIO 11 /* Toastman */ #define TC_HTB_MAXDEPTH 8 -#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ +#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ struct tc_htb_opt { @@ -354,7 +354,7 @@ enum /* CBQ section */ -#define TC_CBQ_MAXPRIO 8 +#define TC_CBQ_MAXPRIO 11 /* Toastman */ #define TC_CBQ_MAXLEVEL 8 #define TC_CBQ_DEF_EWMA 5 diff --git a/release/src/router/rc/qos.c b/release/src/router/rc/qos.c index 25601a0678..dfd55558dc 100644 --- a/release/src/router/rc/qos.c +++ b/release/src/router/rc/qos.c @@ -3,6 +3,22 @@ Tomato Firmware Copyright (C) 2006-2009 Jonathan Zarate + + +Notes: + +Originally Tomato had 10 classes, but only used 6 priority levels for some unknown reason. +Therefore, the last 4 classes all had the same prio of 7. The ingress system had no priority system +and allowed only class limits. It looked as if this was a legacy of an earlier prototype using CBQ. + +On 4th February 2012 a new IMQ based ingress system was added to Toastman builds which +allows use of priorities on all incoming classes. QOS now uses 10 prios in both egress and ingress. + +An incoming bandwidth pie chart was added at the same time, making it easier to see the result of +QOS rules on incoming data. + +-Toastman + */ #include "rc.h" @@ -94,7 +110,7 @@ void ipt_qos(void) numeric (0:63) - dscp value afXX, csX, be, ef - dscp class class_prio: - 0-10 // Changed from 8 in pkt_sched.h - Toastman + 0-10 // was 0-8 - Changed from 8 in pkt_sched.h - Toastman -1 = disabled */ @@ -433,8 +449,7 @@ void start_qos(void) "\t$TQA parent 1:%d handle %d: $Q\n" "\t$TFA parent 1: prio %d protocol ip handle %d fw flowid 1:%d\n", i, rate, ceil, -// x, calc(bw, rate), s, burst_leaf, (i >= 6) ? 7 : (i + 1), mtu, - x, calc(bw, rate), s, burst_leaf, i, mtu, //Toastman + x, calc(bw, rate), s, burst_leaf, i+1, mtu, //prios 1-10 - Toastman x, x, x, i + 1, x); } @@ -622,7 +637,7 @@ void start_qos(void) unsigned int classid = ((unsigned int)i + 1) * 10; // priority - unsigned int priority = (unsigned int)i + 1; + unsigned int priority = (unsigned int)i + 1; //prios 1-10 - Toastman // rate in kb/s unsigned int rateInKilobitsPerSecond = -- 2.11.4.GIT