From: <abe...@us...> - 2017-06-01 16:15:13
|
Revision: 8362 http://sourceforge.net/p/astlinux/code/8362 Author: abelbeck Date: 2017-06-01 16:15:11 +0000 (Thu, 01 Jun 2017) Log Message: ----------- arnofw, traffic-shaper plugin, add fq_codel to both 'htb' and 'hfsc'. Give 'hfsc' another look with this addition. Modified Paths: -------------- branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh Modified: branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh =================================================================== --- branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh 2017-06-01 13:02:20 UTC (rev 8361) +++ branches/1.0/package/arnofw/traffic-shaper/60traffic-shaper.plugin.sh 2017-06-01 16:15:11 UTC (rev 8362) @@ -2,11 +2,11 @@ # -= Arno's iptables firewall - HTB & HFSC traffic shaper plugin =- # PLUGIN_NAME="Traffic-Shaper plugin" -PLUGIN_VERSION="1.2.09-astlinux" +PLUGIN_VERSION="1.3.00" PLUGIN_CONF_FILE="traffic-shaper.conf" # -# Last changed : December 30, 2015 -# Requirements : kernel 2.6 + iproute2 +# Last changed : June 1, 2017 +# Requirements : kernel 3.16 + iproute2 # Comments : This plugin will shape traffic. It borrows heavily on # the logic of Maciej's original script (below), with # some minor changes to the actual bins that traffic @@ -15,6 +15,7 @@ # transfer). # [LRA]: Added htb support from astshape in AstLinux # [LRA]: Classify by DSCP class +# [LRA]: Use sch_fq_codel instead of sch_sfq # Author : (C) Copyright 2008-2010 by Philip Prindeville # Credits : Maciej Blizinski # Credits : Kristian Kielhofner @@ -185,6 +186,16 @@ iptables -t mangle -A SHAPER_CHAIN -m dscp --dscp-class CS1 -j CLASSIFY --set-class 1:60 } +outgoing_fair_queueing_codel() +{ + tc qdisc add dev $1 parent 1:10 handle 10: fq_codel quantum 300 noecn + tc qdisc add dev $1 parent 1:20 handle 20: fq_codel quantum 300 noecn + tc qdisc add dev $1 parent 1:30 handle 30: fq_codel quantum 300 noecn + tc qdisc add dev $1 parent 1:40 handle 40: fq_codel noecn + tc qdisc add dev $1 parent 1:50 handle 50: fq_codel noecn + tc qdisc add dev $1 parent 1:60 handle 60: fq_codel noecn +} + incoming_traffic_limit() { # Skip if DOWNLINK is 0 @@ -236,6 +247,7 @@ modprobe_multi nf_nat ip_nat modprobe sch_hfsc + modprobe sch_fq_codel printf "${INDENT}Shaping as (Down/Up) %d/%d kb/s using '%s' for interface: %s\n" $DOWNLINK $UPLINK hfsc "$SHAPER_IF" @@ -292,6 +304,8 @@ sc m1 0 d 4s m2 1kbit \ ul rate ${UPLINK}kbit + outgoing_fair_queueing_codel $eif1 + incoming_traffic_limit $eif1 disable_ethernet_offloading $eif1 @@ -310,6 +324,9 @@ # Some required modules are already loaded by the main script: modprobe_multi nf_nat ip_nat + modprobe sch_htb + modprobe sch_fq_codel + printf "${INDENT}Shaping as (Down/Up) %d/%d kb/s using '%s' for interface: %s\n" $DOWNLINK $UPLINK htb "$SHAPER_IF" iptables -t mangle -N SHAPER_CHAIN @@ -351,13 +368,7 @@ # p2p class 1:60 tc class add dev $eif1 parent 1:1 classid 1:60 htb rate $((5*$UPLINK/10))kbit burst 6k prio 6 - # all get Stochastic Fairness - tc qdisc add dev $eif1 parent 1:10 handle 10: sfq perturb 10 - tc qdisc add dev $eif1 parent 1:20 handle 20: sfq perturb 10 - tc qdisc add dev $eif1 parent 1:30 handle 30: sfq perturb 10 - tc qdisc add dev $eif1 parent 1:40 handle 40: sfq perturb 10 - tc qdisc add dev $eif1 parent 1:50 handle 50: sfq perturb 10 - tc qdisc add dev $eif1 parent 1:60 handle 60: sfq perturb 10 + outgoing_fair_queueing_codel $eif1 incoming_traffic_limit $eif1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |