aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-01 18:16:54 +0300
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-02 07:28:58 +0000
commit537214e7bfd9ce56e8f0c418ac0cd628365387b8 (patch)
tree5e3af39d08db0464e3762f9754d0075d9725226e
parent87db9527d0d0766412a40e344fcb864fc817d183 (diff)
downloadaports-537214e7bfd9ce56e8f0c418ac0cd628365387b8.tar.bz2
aports-537214e7bfd9ce56e8f0c418ac0cd628365387b8.tar.xz
main/iproute2-qos: add htb burst and fix privileged class ceiling
The HTB classifier uses a burst parameter to figure how much of packets can be queued when the class is lending from other classes. It should be set automatically by tc / kernel, but appears not be set, so set it explictly. This fixes htb class not getting full speed if difference of ceil and rate is large. This also changes Privileged class to get ceil of the total bandwidth instead of the previous hard limit of guaranteed rate. While, it is consider good practices for Privileged class to have hard ceil less than max. speed, it will cause problems links with asymmetric speeds (e.g. ADSL 24M/1M cannot gain full download speed if Privileged class is limited this heavily). It might be a good idea to later have the hard ceiling configurable, but for now it's better to ceil it to wire speed.
-rw-r--r--main/iproute2-qos/APKBUILD2
-rw-r--r--main/iproute2-qos/qos.initd22
2 files changed, 12 insertions, 12 deletions
diff --git a/main/iproute2-qos/APKBUILD b/main/iproute2-qos/APKBUILD
index bb0b27a6f3..2d3c3b8f6f 100644
--- a/main/iproute2-qos/APKBUILD
+++ b/main/iproute2-qos/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Ilya Strelkin <iilluzion@gmail.com>
# Maintainer: Ilya Strelkin <iilluzion@gmail.com>
pkgname=iproute2-qos
-pkgver=0.3
+pkgver=0.4
pkgrel=0
pkgdesc="Scripts to set up quality of service with iproute2"
url="http://git.alpinelinux.org/cgit/aports"
diff --git a/main/iproute2-qos/qos.initd b/main/iproute2-qos/qos.initd
index 9986a8cce4..09677353a9 100644
--- a/main/iproute2-qos/qos.initd
+++ b/main/iproute2-qos/qos.initd
@@ -225,11 +225,11 @@ set_filters()
set_htb()
{
$ECHO tc qdisc add dev $DEV root handle 1 htb default 60
- $ECHO tc class add dev $DEV parent 1: classid 1:2 htb rate $DEV_RATE
- $ECHO tc class add dev $DEV parent 1:2 classid 1:30 htb rate $WAN_SUB_RATE
- $ECHO tc class add dev $DEV parent 1:30 classid 1:40 htb rate $INTERACTIVE_RATE prio 1
- $ECHO tc class add dev $DEV parent 1:30 classid 1:50 htb rate $PRIVILEGED_RATE ceil $WAN_SUB_RATE prio 3
- $ECHO tc class add dev $DEV parent 1:30 classid 1:60 htb rate $BESTEFFORT_RATE ceil $WAN_SUB_RATE prio 6
+ $ECHO tc class add dev $DEV parent 1: classid 1:2 htb rate $DEV_RATE burst $(($DEV_RATE*5/4))
+ $ECHO tc class add dev $DEV parent 1:2 classid 1:30 htb rate $WAN_SUB_RATE burst $(($WAN_SUB_RATE*5/4))
+ $ECHO tc class add dev $DEV parent 1:30 classid 1:40 htb rate $INTERACTIVE_RATE ceil $WAN_SUB_RATE prio 1
+ $ECHO tc class add dev $DEV parent 1:30 classid 1:50 htb rate $PRIVILEGED_RATE ceil $WAN_SUB_RATE prio 3 burst $(($WAN_SUB_RATE*5/4))
+ $ECHO tc class add dev $DEV parent 1:30 classid 1:60 htb rate $BESTEFFORT_RATE ceil $WAN_SUB_RATE prio 6 burst $(($WAN_SUB_RATE*5/4))
if [ $OUT_OF_WAN_RATE -gt 0 ]; then
$ECHO tc class add dev $DEV parent 1:2 classid 1:70 htb rate $OUT_OF_WAN_RATE prio 7
@@ -250,7 +250,7 @@ set_hfsc()
$ECHO tc qdisc add dev $DEV root handle 1 hfsc default 60
$ECHO tc class add dev $DEV parent 1: classid 1:2 hfsc sc rate $DEV_RATE ul rate $DEV_RATE
$ECHO tc class add dev $DEV parent 1:2 classid 1:30 hfsc sc rate $WAN_SUB_RATE ul rate $WAN_SUB_RATE
- $ECHO tc class add dev $DEV parent 1:30 classid 1:40 hfsc sc umax $INTERACTIVE_HFSC_UMAX dmax $INTERACTIVE_HFSC_DMAX rate $INTERACTIVE_RATE ul rate $INTERACTIVE_RATE
+ $ECHO tc class add dev $DEV parent 1:30 classid 1:40 hfsc sc umax $INTERACTIVE_HFSC_UMAX dmax $INTERACTIVE_HFSC_DMAX rate $INTERACTIVE_RATE ul rate $WAN_SUB_RATE
$ECHO tc class add dev $DEV parent 1:30 classid 1:50 hfsc sc umax $PRIVILEGED_HFSC_UMAX dmax $PRIVILEGED_HFSC_DMAX rate $PRIVILEGED_RATE ul rate $WAN_SUB_RATE
$ECHO tc class add dev $DEV parent 1:30 classid 1:60 hfsc sc rate $BESTEFFORT_RATE ul rate $WAN_SUB_RATE
@@ -272,7 +272,7 @@ set_prio()
{
PARENT_CLASSID=10
$ECHO tc qdisc add dev $DEV root handle 1 prio bands 2 priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 # by default unclassified traffic goes to flowid 1:2
- $ECHO tc qdisc add dev $DEV parent 1:1 handle 40: tbf rate $INTERACTIVE_RATE burst $INTERACTIVE_PRIO_BURST latency $INTERACTIVE_PRIO_LATENCY
+ $ECHO tc qdisc add dev $DEV parent 1:1 handle 40: tbf rate $INTERACTIVE_RATE burst $WAN_SUB_RATE latency $INTERACTIVE_PRIO_LATENCY
$ECHO tc qdisc add dev $DEV parent 1:2 handle $PARENT_CLASSID: htb default 60
$ECHO tc class add dev $DEV parent $PARENT_CLASSID: classid $PARENT_CLASSID:30 htb rate $WAN_SUB_RATE
$ECHO tc class add dev $DEV parent $PARENT_CLASSID:30 classid $PARENT_CLASSID:50 htb rate $PRIVILEGED_RATE ceil $WAN_SUB_RATE prio 3
@@ -309,7 +309,7 @@ set_police()
# burst = rate / 17 (taken basing on experemental results)
POLICE_BURST_SCALE=17
- WAN_POLICE_BURST=$((WAN_RATE / POLICE_BURST_SCALE))
+ WAN_POLICE_BURST=$((WAN_RATE / POLICE_BURST_SCALE))
WAN_POLICE_FLOWID=1
@@ -329,9 +329,9 @@ set_cpolice()
# burst = rate / 17 (taken basing on experemental results)
POLICE_BURST_SCALE=17
- INTERACTIVE_POLICE_BURST=$((INTERACTIVE_RATE / POLICE_BURST_SCALE))
- PRIVILEGED_POLICE_BURST=$((PRIVILEGED_RATE / POLICE_BURST_SCALE))
- BESTEFFORT_POLICE_BURST=$((BESTEFFORT_RATE / POLICE_BURST_SCALE))
+ INTERACTIVE_POLICE_BURST=$((INTERACTIVE_RATE / POLICE_BURST_SCALE))
+ PRIVILEGED_POLICE_BURST=$((PRIVILEGED_RATE / POLICE_BURST_SCALE))
+ BESTEFFORT_POLICE_BURST=$((BESTEFFORT_RATE / POLICE_BURST_SCALE))
CLASS_TYPES="INTERACTIVE PRIVILEGED"
INTERACTIVE_POLICE_FLOWID=1