From 2d10780a296f3f680caeb89a3c03f1c1debe1e49 Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Wed, 17 Jun 2015 20:45:35 +0200 Subject: [PATCH 1/9] [SQM/luci-app-sqm] Enable sqm initiscript if a single sqm instance gets enabled The SQM gui has confused its users with an enable button, that only served to selecively activate/de-activate sqm instances instead of controlling sqm's initscript (which needs to be enabled so the sqm properly starts up after a reboot and also for hotplug to work properly). luci-app-sqm will now enable sqm's initscript when a single sqm instance get enabled. It also informs the user about this fact in the top margin of the sqm page. Note sqm will not disable the initscript behind the user's back if sqm instances get disabled. While I would have prefered this notice to be more prominent an attentive user should notice, and most users should not care anyway. This also increases the package release number. Signed-off-by: Sebastian Moeller --- net/luci-app-sqm/Makefile | 2 +- net/luci-app-sqm/files/sqm-cbi.lua | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/net/luci-app-sqm/Makefile b/net/luci-app-sqm/Makefile index c4fbc1283..b5ec1add6 100644 --- a/net/luci-app-sqm/Makefile +++ b/net/luci-app-sqm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-sqm PKG_VERSION:=3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPLv2 LUCI_DIR:=/usr/lib/lua/luci diff --git a/net/luci-app-sqm/files/sqm-cbi.lua b/net/luci-app-sqm/files/sqm-cbi.lua index 49ab13057..7633b7a1a 100644 --- a/net/luci-app-sqm/files/sqm-cbi.lua +++ b/net/luci-app-sqm/files/sqm-cbi.lua @@ -36,9 +36,30 @@ s.addremove = true -- set to true to allow adding SQM instances in the GUI s.anonymous = true -- BASIC -e = s:taboption("tab_basic", Flag, "enabled", translate("Enable")) +e = s:taboption("tab_basic", Flag, "enabled", translate("Enable this SQM instance.")) e.rmempty = false +-- sm: following jow's advise, be helpful to the user and enable +-- sqm's init script if even a single sm instance/interface +-- is enabled; this is unexpected in that the init script gets +-- enabled as soon as at least one sqm instance is enabled +-- and that state is saved, so it does not require "Save & Apply" +-- to effect the init scripts. +-- the implementation was inpired/lifted from +-- https://github.com/openwrt/luci/blob/master/applications/luci-app-minidlna/luasrc/model/cbi/minidlna.lua +function e.write(self, section, value) + if value == "1" then + luci.sys.init.enable("sqm") + m.message = translate("The SQM GUI has just enabled the sqm initscript on your behalf. Remember to disable the sqm initscript manually under System Startup menu in case this change was not wished for.") +-- luci.sys.call("/etc/init.d/sqm start >/dev/null") +-- else +-- luci.sys.call("/etc/init.d/sqm stop >/dev/null") +-- luci.sys.init.disable("sqm") + end + return Flag.write(self, section, value) +end +-- TODO: inform the user what we just did... + n = s:taboption("tab_basic", ListValue, "interface", translate("Interface name")) -- sm lifted from luci-app-wol, the original implementation failed to show pppoe-ge00 type interface names for _, iface in ipairs(ifaces) do From 0418469955d157716115ce0f583a086187348198 Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Wed, 17 Jun 2015 21:03:33 +0200 Subject: [PATCH 2/9] [SQM/luci-app-sqm] Fix SQM GUI help messages. Make clear that configuration options guarded by checkboxes are only effective as long as those boxes are checked. The sqm gui has giarded some advanced configuration options behind exposing checkboxes, meaning these optiopn's values were only used as long as those boxes were checked. This commit just improves the description of the checkboxes to included this useage instruction... Signed-off-by: Sebastian Moeller --- net/luci-app-sqm/Makefile | 2 +- net/luci-app-sqm/files/sqm-cbi.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/luci-app-sqm/Makefile b/net/luci-app-sqm/Makefile index b5ec1add6..494dcc569 100644 --- a/net/luci-app-sqm/Makefile +++ b/net/luci-app-sqm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-sqm PKG_VERSION:=3 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=GPLv2 LUCI_DIR:=/usr/lib/lua/luci diff --git a/net/luci-app-sqm/files/sqm-cbi.lua b/net/luci-app-sqm/files/sqm-cbi.lua index 7633b7a1a..f3b5802d3 100644 --- a/net/luci-app-sqm/files/sqm-cbi.lua +++ b/net/luci-app-sqm/files/sqm-cbi.lua @@ -110,7 +110,7 @@ sc.default = "simple.qos" sc.rmempty = false sc.description = qos_desc -ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show and Use Advanced Configuration")) +ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show and Use Advanced Configuration. Advanced options will only be used as long as this box is checked.")) ad.default = false ad.rmempty = true @@ -142,7 +142,7 @@ eecn.default = "NOECN" eecn.rmempty = true eecn:depends("qdisc_advanced", "1") -ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show and Use Dangerous Configuration")) +ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show and Use Dangerous Configuration. Dangerous options will only be used as long as this box is checked.")) ad2.default = false ad2.rmempty = true ad2:depends("qdisc_advanced", "1") @@ -199,7 +199,7 @@ po:depends("linklayer", "ethernet") po:depends("linklayer", "atm") -adll = s:taboption("tab_linklayer", Flag, "linklayer_advanced", translate("Show Advanced Linklayer Options, (only needed if MTU > 1500)")) +adll = s:taboption("tab_linklayer", Flag, "linklayer_advanced", translate("Show Advanced Linklayer Options, (only needed if MTU > 1500). Advanced options will only be used as long as this box is checked.")) adll.rmempty = true adll:depends("linklayer", "ethernet") -- adll:depends("linklayer", "adsl") From 73db5d2311f1a12bae1f3aa86c0eb553af799565 Mon Sep 17 00:00:00 2001 From: Dave Taht Date: Thu, 19 Feb 2015 14:03:59 -0800 Subject: [PATCH 3/9] sqm-scripts: Support the cake qdisc. Signed-off-by: Dave Taht --- net/sqm-scripts/Makefile | 2 +- net/sqm-scripts/files/usr/lib/sqm/simple.qos | 25 ++++++++++++++++--- .../files/usr/lib/sqm/simplest.qos | 10 ++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile index 68a599063..daf8f5d38 100644 --- a/net/sqm-scripts/Makefile +++ b/net/sqm-scripts/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sqm-scripts PKG_VERSION:=8 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPLv2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos index 6e5af4a94..34a4dd8bd 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple.qos @@ -25,13 +25,17 @@ ipt_setup() { ipt -t mangle -N QOS_MARK_${IFACE} -ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} +case $QDISC in + cake*) sqm_logger cake does all the diffserv work - no need for iptables rules ;; + *) +ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} # You can go further with classification but... ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING} ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING} ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING} ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING} ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING} +esac # and it might be a good idea to do it for udp tunnels too @@ -43,9 +47,11 @@ ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-ma if [ "$SQUASH_DSCP" = "1" ] then sqm_logger "Squashing differentiated services code points (DSCP) from ingress." +CAKE_OPTS=besteffort # someday squash ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be else sqm_logger "Keeping differentiated services code points (DSCP) from ingress." +CAKE_OPTS="" ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} fi @@ -81,6 +87,9 @@ BE_CEIL=`expr $CEIL - 16` # A little slop at the top LQ="quantum `get_mtu $IFACE $CEIL`" $TC qdisc del dev $IFACE root 2> /dev/null +case $QDISC in + cake*) $TC qdisc add dev $IFACE root $QDISC bandwidth ${CEIL}kbit ;; + *) $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12 $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` @@ -92,7 +101,6 @@ $TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `g $TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS} $TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS} - # Need a catchall rule $TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \ @@ -122,6 +130,8 @@ $TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \ $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \ u32 match ip protocol 1 0xff flowid 1:13 +;; +esac #diffserv $IFACE @@ -146,14 +156,21 @@ if [ "$SQUASH_INGRESS" = "1" ] then sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)" # Revert to no dscp based filtering -$TC qdisc del dev $DEV root 2>/dev/null +case $QDISC in + cake*) $TC qdisc add dev $DEV root $QDISC bandwidth ${DOWNLINK}kbit besteffort ;; + *) $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} +;; +esac else sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)" +case $QDISC in + cake*) $TC qdisc add dev $IFACE root $QDISC bandwidth ${DOWNLINK}kbit $CAKE_OPTS;; + *) $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12 $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` @@ -168,6 +185,8 @@ $TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get $TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS} diffserv $DEV +;; +esac fi diff --git a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos index f06c25211..e0cff2afe 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos @@ -17,10 +17,15 @@ egress() { LQ="quantum `get_mtu $IFACE ${UPLINK}`" $TC qdisc del dev $IFACE root 2>/dev/null +case $QDISC in + cake*) $TC qdisc add dev $IFACE root cake bandwidth ${UPLINK}kbit besteffort ;; + *) $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10 $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string` $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string` $TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS} +;; +esac } @@ -33,6 +38,9 @@ $TC qdisc add dev $IFACE handle ffff: ingress LQ="quantum `get_mtu $IFACE ${DOWNLINK}`" $TC qdisc del dev $DEV root 2>/dev/null +case $QDISC in + cake*) $TC qdisc add dev $DEV root cake bandwidth ${DOWNLINK}kbit besteffort ;; + *) $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` @@ -43,6 +51,8 @@ $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil # Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance #$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}` $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} +;; +esac ifconfig $DEV up From e7bab97599a401c59449048ac2a23cdb21a66038 Mon Sep 17 00:00:00 2001 From: Dave Taht Date: Wed, 29 Apr 2015 20:15:00 -0700 Subject: [PATCH 4/9] luci-app-sqm: add cake support --- net/luci-app-sqm/files/sqm-cbi.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/net/luci-app-sqm/files/sqm-cbi.lua b/net/luci-app-sqm/files/sqm-cbi.lua index f3b5802d3..b35c44a95 100644 --- a/net/luci-app-sqm/files/sqm-cbi.lua +++ b/net/luci-app-sqm/files/sqm-cbi.lua @@ -92,6 +92,7 @@ c:value("codel") c:value("ns2_codel") c:value("pie") c:value("sfq") +c:value("cake") c.default = "fq_codel" c.rmempty = false From 2ba6a3f9ab9e92f6c449ec815d3137c1a89536ee Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Thu, 18 Jun 2015 21:08:01 +0200 Subject: [PATCH 5/9] [SQM/luci-app-sqm] Wire up link layer dandling for cake The cake traffic-shaper qdisc omne stop solution knows how to handle link layer adjustments for ATM and can account for per packet overhead. This commit adds cake as link layer adjustment mechanism in the GUI and passes numerically specified overhead as well as the ATM linklayer keywords on to cake. This change also passes the "advanced option strings" from the Queue Discipline tab to cake. But as before no error checking. This needs testing, as I have no working cake qdisc available so caveat emptor... Signed-off-by: Sebastian Moeller --- net/luci-app-sqm/Makefile | 2 +- net/luci-app-sqm/files/sqm-cbi.lua | 1 + net/sqm-scripts/Makefile | 2 +- .../files/usr/lib/sqm/functions.sh | 17 ++++ net/sqm-scripts/files/usr/lib/sqm/simple.qos | 97 ++++++++++--------- .../files/usr/lib/sqm/simplest.qos | 38 ++++---- 6 files changed, 93 insertions(+), 64 deletions(-) diff --git a/net/luci-app-sqm/Makefile b/net/luci-app-sqm/Makefile index 494dcc569..fd8cd87ce 100644 --- a/net/luci-app-sqm/Makefile +++ b/net/luci-app-sqm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-sqm PKG_VERSION:=3 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPLv2 LUCI_DIR:=/usr/lib/lua/luci diff --git a/net/luci-app-sqm/files/sqm-cbi.lua b/net/luci-app-sqm/files/sqm-cbi.lua index b35c44a95..6609fc382 100644 --- a/net/luci-app-sqm/files/sqm-cbi.lua +++ b/net/luci-app-sqm/files/sqm-cbi.lua @@ -228,6 +228,7 @@ smpu.rmempty = true smpu:depends("linklayer_advanced", "1") lla = s:taboption("tab_linklayer", ListValue, "linklayer_adaptation_mechanism", translate("Which linklayer adaptation mechanism to use; for testing only")) +lla:value("cake") lla:value("htb_private") lla:value("tc_stab", "tc_stab ("..translate("default")..")") lla.default = "tc_stab" diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile index daf8f5d38..b65905cf4 100644 --- a/net/sqm-scripts/Makefile +++ b/net/sqm-scripts/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sqm-scripts PKG_VERSION:=8 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_LICENSE:=GPLv2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/net/sqm-scripts/files/usr/lib/sqm/functions.sh b/net/sqm-scripts/files/usr/lib/sqm/functions.sh index a0b2c6ffd..4f3cc9df3 100644 --- a/net/sqm-scripts/files/usr/lib/sqm/functions.sh +++ b/net/sqm-scripts/files/usr/lib/sqm/functions.sh @@ -139,6 +139,23 @@ get_stab_string() { echo ${STABSTRING} } +#sm: cake knows how to handle ATM and per packet overhead, so expose and use this... +get_cake_lla_string() { + STABSTRING="" + if [ "${LLAM}" = "cake" -a "${LINKLAYER}" != "none" ]; + then + if [ "${LINKLAYER}" = "atm" ]; + then + STABSTRING="atm" + fi + + STABSTRING="${STABSTRING} overhead ${OVERHEAD}" + sqm_logger "cake link layer adjustments: ${STABSTRING}" + fi + echo ${STABSTRING} +} + + sqm_stop() { $TC qdisc del dev $IFACE ingress $TC qdisc del dev $IFACE root diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos index 34a4dd8bd..cde3a1c8e 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple.qos @@ -7,7 +7,7 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # -# Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller +# Copyright (C) 2012-5 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller # Compared to the complexity that debloat had become # this cleanly shows a means of going from diffserv marking @@ -26,15 +26,18 @@ ipt_setup() { ipt -t mangle -N QOS_MARK_${IFACE} case $QDISC in - cake*) sqm_logger cake does all the diffserv work - no need for iptables rules ;; + cake*) + sqm_logger cake does all the diffserv work - no need for iptables rules + ;; *) -ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} -# You can go further with classification but... -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING} -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING} -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING} -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING} -ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING} + ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} + # You can go further with classification but... + ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING} + ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING} + ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING} + ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING} + ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING} + ;; esac # and it might be a good idea to do it for udp tunnels too @@ -88,49 +91,51 @@ LQ="quantum `get_mtu $IFACE $CEIL`" $TC qdisc del dev $IFACE root 2> /dev/null case $QDISC in - cake*) $TC qdisc add dev $IFACE root $QDISC bandwidth ${CEIL}kbit ;; + cake*) + $TC qdisc add dev $IFACE root $QDISC bandwidth ${CEIL}kbit get_cake_lla_string ${EQDISC_OPTS} + ;; *) -$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12 -$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` + $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12 + $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` + $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` + $TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` + $TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` + $TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` -$TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS} -$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS} -$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS} + $TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS} + $TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS} + $TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS} -# Need a catchall rule + # Need a catchall rule -$TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \ - match ip protocol 0 0x00 flowid 1:12 + $TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \ + match ip protocol 0 0x00 flowid 1:12 -# FIXME should probably change the filter here to do pre-nat + # FIXME should probably change the filter here to do pre-nat -$TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11 -$TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12 -$TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13 + $TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11 + $TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12 + $TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13 -# ipv6 support. Note that the handle indicates the fw mark bucket that is looked for + # ipv6 support. Note that the handle indicates the fw mark bucket that is looked for -$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11 -$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12 -$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13 + $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11 + $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12 + $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13 -# Arp traffic + # Arp traffic -$TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11 + $TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11 -# ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods -# better instead + # ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods + # better instead -$TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \ - u32 match ip protocol 1 0xff flowid 1:13 + $TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \ + u32 match ip protocol 1 0xff flowid 1:13 -$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \ - u32 match ip protocol 1 0xff flowid 1:13 -;; + $TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \ + u32 match ip protocol 1 0xff flowid 1:13 + ;; esac #diffserv $IFACE @@ -157,13 +162,15 @@ then sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)" # Revert to no dscp based filtering case $QDISC in - cake*) $TC qdisc add dev $DEV root $QDISC bandwidth ${DOWNLINK}kbit besteffort ;; + cake*) + $TC qdisc add dev $DEV root $QDISC bandwidth ${DOWNLINK}kbit besteffort get_cake_lla_string ${IQDISC_OPTS} + ;; *) -$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 -$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` -$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} -;; + $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 + $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` + $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} + ;; esac else diff --git a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos index e0cff2afe..5eb11c41d 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos @@ -7,7 +7,7 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # -# Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller +# Copyright (C) 2012-5 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller . /usr/lib/sqm/functions.sh sqm_logger "Starting simplest.qos" @@ -18,13 +18,15 @@ LQ="quantum `get_mtu $IFACE ${UPLINK}`" $TC qdisc del dev $IFACE root 2>/dev/null case $QDISC in - cake*) $TC qdisc add dev $IFACE root cake bandwidth ${UPLINK}kbit besteffort ;; + cake*) + $TC qdisc add dev $IFACE root cake bandwidth ${UPLINK}kbit besteffort get_cake_lla_string ${EQDISC_OPTS} + ;; *) -$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10 -$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string` -$TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS} -;; + $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10 + $TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string` + $TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string` + $TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS} + ;; esac } @@ -39,19 +41,21 @@ LQ="quantum `get_mtu $IFACE ${DOWNLINK}`" $TC qdisc del dev $DEV root 2>/dev/null case $QDISC in - cake*) $TC qdisc add dev $DEV root cake bandwidth ${DOWNLINK}kbit besteffort ;; + cake*) + $TC qdisc add dev $DEV root cake bandwidth ${DOWNLINK}kbit besteffort get_cake_lla_string ${IQDISC_OPTS} + ;; *) -$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 -$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` + $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 + $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` -# FIXME: I'd prefer to use a pre-nat filter but we need to detect if nat is on this interface -# AND we need to permute by a random number which we can't do from userspace filters + # FIXME: I'd prefer to use a pre-nat filter but we need to detect if nat is on this interface + # AND we need to permute by a random number which we can't do from userspace filters -# Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance -#$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}` -$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} -;; + # Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance + #$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}` + $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} + ;; esac ifconfig $DEV up From a754eb7a741b870bd5442297bd570d1ab3ecbd0e Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Thu, 18 Jun 2015 21:54:21 +0200 Subject: [PATCH 6/9] [SQM] Fix changes relating to cake lnk layer adjustments The last batch of changes tried to teach the GUI to pass link layer options to cake but forgot to actually call the function that parses the GUI variables and used it as a string insteead. So this fixes that it also tries to allow the use of the tc_stab link layer adjustment method with cake so the implementations can be validated against each other easily. Needs testing... Signed-off-by: Sebastian Moeller --- net/sqm-scripts/files/usr/lib/sqm/simple.qos | 65 ++++++++++--------- .../files/usr/lib/sqm/simplest.qos | 4 +- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos index cde3a1c8e..e1ce37266 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple.qos @@ -92,7 +92,7 @@ LQ="quantum `get_mtu $IFACE $CEIL`" $TC qdisc del dev $IFACE root 2> /dev/null case $QDISC in cake*) - $TC qdisc add dev $IFACE root $QDISC bandwidth ${CEIL}kbit get_cake_lla_string ${EQDISC_OPTS} + $TC qdisc add dev $IFACE root `get_stab_string` $QDISC bandwidth ${CEIL}kbit `get_cake_lla_string` ${EQDISC_OPTS} ;; *) $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12 @@ -159,42 +159,43 @@ $TC qdisc del dev $DEV root 2> /dev/null if [ "$SQUASH_INGRESS" = "1" ] then -sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)" -# Revert to no dscp based filtering -case $QDISC in - cake*) - $TC qdisc add dev $DEV root $QDISC bandwidth ${DOWNLINK}kbit besteffort get_cake_lla_string ${IQDISC_OPTS} - ;; - *) - $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 - $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` - $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` - $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} - ;; -esac + sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)" + # Revert to no dscp based filtering + case $QDISC in + cake*) + $TC qdisc add dev $DEV root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit besteffort `get_cake_lla_string` ${IQDISC_OPTS} + ;; + *) + $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 + $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` + $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} + ;; + esac else -sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)" -case $QDISC in - cake*) $TC qdisc add dev $IFACE root $QDISC bandwidth ${DOWNLINK}kbit $CAKE_OPTS;; - *) -$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12 -$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` + sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)" + case $QDISC in + cake*) + $TC qdisc add dev $IFACE root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit `get_cake_lla_string` $CAKE_OPTS ${IQDISC_OPTS} + ;; + *) + $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12 + $TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` + $TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` -# I'd prefer to use a pre-nat filter but that causes permutation... + # I'd prefer to use a pre-nat filter but that causes permutation... -$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS} -$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS} -$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS} - -diffserv $DEV -;; -esac + $TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS} + $TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS} + $TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS} + diffserv $DEV + ;; + esac fi ifconfig $DEV up diff --git a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos index 5eb11c41d..95362afff 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos @@ -19,7 +19,7 @@ LQ="quantum `get_mtu $IFACE ${UPLINK}`" $TC qdisc del dev $IFACE root 2>/dev/null case $QDISC in cake*) - $TC qdisc add dev $IFACE root cake bandwidth ${UPLINK}kbit besteffort get_cake_lla_string ${EQDISC_OPTS} + $TC qdisc add dev $IFACE root `get_stab_string` cake bandwidth ${UPLINK}kbit besteffort `get_cake_lla_string` ${EQDISC_OPTS} ;; *) $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10 @@ -42,7 +42,7 @@ LQ="quantum `get_mtu $IFACE ${DOWNLINK}`" $TC qdisc del dev $DEV root 2>/dev/null case $QDISC in cake*) - $TC qdisc add dev $DEV root cake bandwidth ${DOWNLINK}kbit besteffort get_cake_lla_string ${IQDISC_OPTS} + $TC qdisc add dev $DEV root `get_stab_string` cake bandwidth ${DOWNLINK}kbit besteffort `get_cake_lla_string` ${IQDISC_OPTS} ;; *) $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 From 034e4d24754682fff71fcfb6ac425b1b4e147532 Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Mon, 29 Jun 2015 10:04:52 +0200 Subject: [PATCH 7/9] [SQM] Fix sqm_logger to accept empty strings as input sqm_logger tried tro wait indefinitely if passed an empty string. This in turn makes sqm-scripts hang. Quoting the input argument in sqm_logger seems to fix the problem. Signed-off-by: Sebastian Moeller --- net/sqm-scripts/files/usr/lib/sqm/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sqm-scripts/files/usr/lib/sqm/functions.sh b/net/sqm-scripts/files/usr/lib/sqm/functions.sh index 4f3cc9df3..ec4583da0 100644 --- a/net/sqm-scripts/files/usr/lib/sqm/functions.sh +++ b/net/sqm-scripts/files/usr/lib/sqm/functions.sh @@ -6,7 +6,7 @@ #improve the logread output sqm_logger() { - logger -t SQM -s ${1} + logger -t SQM -s "${1}" } insmod() { From 517954b7f5b57f48ecc21033f8b74fc7cc20eeb3 Mon Sep 17 00:00:00 2001 From: Sebastian Moeller Date: Mon, 29 Jun 2015 10:29:34 +0200 Subject: [PATCH 8/9] [SQM] Fix simple.qos to allow using cake as ingress shaper simple.qos had accidentally set up the egress shaper twice, once with the true egress parameters and a second time using the ingress parameters, effectively misconfiguring both directions. This bub only affected situations where 3-tier ingress classification was used. Signed-off-by: Sebastian Moeller --- net/sqm-scripts/Makefile | 2 +- net/sqm-scripts/files/usr/lib/sqm/simple.qos | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile index b65905cf4..6a5848137 100644 --- a/net/sqm-scripts/Makefile +++ b/net/sqm-scripts/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sqm-scripts PKG_VERSION:=8 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_LICENSE:=GPLv2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos index e1ce37266..5a36df1cf 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple.qos @@ -177,7 +177,7 @@ else sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)" case $QDISC in cake*) - $TC qdisc add dev $IFACE root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit `get_cake_lla_string` $CAKE_OPTS ${IQDISC_OPTS} + $TC qdisc add dev $DEV root `get_stab_string` $QDISC bandwidth ${DOWNLINK}kbit `get_cake_lla_string` $CAKE_OPTS ${IQDISC_OPTS} ;; *) $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12 From d29c656c99fff4b49792d5cdde8a9d1c530084b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Sun, 12 Jul 2015 22:16:18 +0200 Subject: [PATCH 9/9] sqm-scripts: Default to ECN on for egress. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Toke Høiland-Jørgensen --- net/sqm-scripts/files/etc/config/sqm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sqm-scripts/files/etc/config/sqm b/net/sqm-scripts/files/etc/config/sqm index d03980853..13a7a0b84 100644 --- a/net/sqm-scripts/files/etc/config/sqm +++ b/net/sqm-scripts/files/etc/config/sqm @@ -8,7 +8,7 @@ config queue 'eth1' option script 'simple.qos' option qdisc_advanced '0' option ingress_ecn 'ECN' - option egress_ecn 'NOECN' + option egress_ecn 'ECN' option qdisc_really_really_advanced '0' option itarget 'auto' option etarget 'auto'