Skip to content

Commit

Permalink
Reorganize the Queueing Discipline configuration tab
Browse files Browse the repository at this point in the history
The Queueing Discipline tab in the default state did only show a blank check box.
To let the user know what is configured expose the queueing discipline and
the queue setup script unconditionally. The ECN settings stay hidden under control
of the advanced configuration checkbox. The "Show Dangerous Configuration" check box
now allows to define one string for ingress and egress each that is appended
to each tcx command line setting up each qdisc (under AQM control).
This allows easier access to the more specalized options of each qdisc for testing and research.
Since there is no checking whatsoever perfomed on these two strings
ths option is truely for experts and hence dangerous.
  • Loading branch information
moeller0 committed Dec 18, 2013
1 parent b6a6c47 commit b3512ec
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
29 changes: 20 additions & 9 deletions luci/luci-app-aqm/files/aqm-cbi.lua
Expand Up @@ -42,17 +42,15 @@ for _, iface in ipairs(ifaces) do
end
n.rmempty = false

dl = s:taboption("tab_basic", Value, "download", translate("Download speed (kbit/s)"))
dl = s:taboption("tab_basic", Value, "download", translate("Download speed (kbit/s) (ingress):"))
dl.datatype = "and(uinteger,min(0))"
dl.rmempty = false

ul = s:taboption("tab_basic", Value, "upload", translate("Upload speed (kbit/s)"))
ul = s:taboption("tab_basic", Value, "upload", translate("Upload speed (kbit/s) (egress):"))
ul.datatype = "and(uinteger,min(0))"
ul.rmempty = false

-- QDISC
ad = s:taboption("tab_qdisc", Flag, "advanced", translate("Show Advanced Configuration"))
ad.rmempty = true

c = s:taboption("tab_qdisc", ListValue, "qdisc", translate("Queueing discipline"))
c:value("fq_codel", "fq_codel ("..translate("default")..")")
Expand All @@ -64,8 +62,7 @@ c:value("ns2_codel")
c:value("pie")
c:value("sfq")
c.default = "fq_codel"
c.rmempty = true
c:depends("advanced", "1")
c.rmempty = false

local qos_desc = ""
sc = s:taboption("tab_qdisc", ListValue, "script", translate("Queue setup script"))
Expand All @@ -79,9 +76,12 @@ for file in fs.dir(path) do
end
end
sc.default = "simple.qos"
sc.rmempty = true
sc.rmempty = false
sc.description = qos_desc
sc:depends("advanced", "1")

ad = s:taboption("tab_qdisc", Flag, "advanced", translate("Show Advanced Configuration"))
ad.default = false
ad.rmempty = true

iecn = s:taboption("tab_qdisc", ListValue, "ingress_ecn", translate("Explicit congestion notification (ECN) status on inbound packets (ingress):"))
iecn:value("ECN", "ECN ("..translate("default")..")")
Expand All @@ -90,13 +90,24 @@ iecn.default = "ECN"
iecn.rmempty = true
iecn:depends("advanced", "1")

eecn = s:taboption("tab_qdisc", ListValue, "egress_ecn", translate("Eexplicit congestion notification (ECN) status on outbound packets (egress)."))
eecn = s:taboption("tab_qdisc", ListValue, "egress_ecn", translate("Explicit congestion notification (ECN) status on outbound packets (egress)."))
eecn:value("NOECN", "NOECN ("..translate("default")..")")
eecn:value("ECN")
eecn.default = "NOECN"
eecn.rmempty = true
eecn:depends("advanced", "1")

ad2 = s:taboption("tab_qdisc", Flag, "really_really_advanced", translate("Show Dangerous Configuration"))
ad2.default = false
ad2.rmempty = true

iqdisc_opts = s:taboption("tab_qdisc", Value, "iqdisc_opts", translate("Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully."))
iqdisc_opts.rmempty = true
iqdisc_opts:depends("really_really_advanced", "1")

eqdisc_opts = s:taboption("tab_qdisc", Value, "eqdisc_opts", translate("Advanced option string to pass to the egress queueing disciplines; no error checking, use very carefully."))
eqdisc_opts.rmempty = true
eqdisc_opts:depends("really_really_advanced", "1")

-- LINKLAYER
lla = s:taboption("tab_linklayer", ListValue, "linklayer_adaptation_mechanism", translate("Which linklayer adaptation mechanism to use; especially useful for DSL/ATM links:")) -- Creates an element list (select box)
Expand Down
4 changes: 4 additions & 0 deletions net/aqm-scripts/files/usr/lib/aqm/functions.sh
Expand Up @@ -39,10 +39,14 @@ do_modules() {
#[ -z "$ALLECN" ] && ALLECN=2
[ -z "$iECN" ] && iECN="ECN"
[ -z "$eECN" ] && eECN="NOECN"
[ -z "$iqdisc_opts" ] && iqdisc_opts=""
[ -z "$eqdisc_opts" ] && eqdisc_opts=""
[ -z "$TC" ] && TC=`which tc`
#[ -z "$TC" ] && TC="logger tc" # this redirects all tc calls into the log
[ -z "$INSMOD" ] && INSMOD=`which insmod`

#logger "iqdisc opts: ${iqdisc_opts}"
#logger "eqdisc opts: ${eqdisc_opts}"

#logger "LLAM: ${LLAM}"
#logger "LINKLAYER: ${LINKLAYER}"
Expand Down
14 changes: 5 additions & 9 deletions net/aqm-scripts/files/usr/lib/aqm/run.sh
Expand Up @@ -23,19 +23,15 @@ run_simple_qos() {
export STAB_MPU=$(config_get "$section" MPU)
export iECN=$(config_get "$section" ingress_ecn)
export eECN=$(config_get "$section" egress_ecn)
export iqdisc_opts=$(config_get "$section" iqdisc_opts)
export eqdisc_opts=$(config_get "$section" eqdisc_opts)

export DEV="ifb${IFB_NUM}"
IFB_NUM=$(expr $IFB_NUM + 1)
export IFACE=$(config_get "$section" interface)
if [ $(config_get "$section" advanced) -eq 1 ]; then
export QDISC=$(config_get "$section" qdisc)
SCRIPT=/usr/lib/aqm/$(config_get "$section" script)
logger "Queue Setup Script: ${SCRIPT}"
else
export QDISC=fq_codel
SCRIPT=/usr/lib/aqm/simple.qos
logger "defaulting to simple.qos using fq_codel"
fi
export QDISC=fq_codel
SCRIPT=/usr/lib/aqm/simple.qos
logger "Queue Setup Script: ${SCRIPT}"
[ "$STOP" -eq 1 ] && { /usr/lib/aqm/stop.sh; return 0; }
[ -x "$SCRIPT" ] && $SCRIPT
}
Expand Down
12 changes: 6 additions & 6 deletions net/aqm-scripts/files/usr/lib/aqm/simple.qos
Expand Up @@ -76,9 +76,9 @@ $TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRI
$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 limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${PRIO_RATE}`
$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${BE_RATE}`
$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${BK_RATE}`
$TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${eqdisc_opts}
$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${eqdisc_opts}
$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC limit 600 `get_ECN ${eECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${eqdisc_opts}


# Need a catchall rule
Expand Down Expand Up @@ -127,9 +127,9 @@ $TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil

# I'd prefer to use a pre-nat filter but that causes permutation...

$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 500` `get_flows ${PRIO_RATE}`
$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 1500` `get_flows ${BE_RATE}`
$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 1500` `get_flows ${BK_RATE}`
$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${iqdisc_opts}
$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${iqdisc_opts}
$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC limit 1000 `get_ECN ${iECN}` `get_quantum 1500` `get_flows ${BK_RATE}` ${iqdisc_opts}

diffserv $DEV

Expand Down
2 changes: 1 addition & 1 deletion net/aqm-scripts/files/usr/lib/aqm/simple.qos.help
@@ -1 +1 @@
HTB-limited three-tier prioritisation scheme with fq_codel on each queue.
HTB-limited three-tier prioritisation scheme with fq_codel on each queue. (default)
4 changes: 2 additions & 2 deletions net/aqm-scripts/files/usr/lib/aqm/simplest.qos
Expand Up @@ -20,7 +20,7 @@ $TC qdisc del dev $IFACE root 2>/dev/null
$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 limit 600 `get_ECN ${eECN}` `get_flows ${UPLINK}`
$TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC limit 600 `get_ECN ${eECN}` `get_flows ${UPLINK}` ${eqdisc_opts}

}

Expand All @@ -42,7 +42,7 @@ $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 1000 $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}`
$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit 1000 `get_ECN ${iECN}` `get_flows ${DOWNLINK}`
$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit 1000 `get_ECN ${iECN}` `get_flows ${DOWNLINK}` ${iqdisc_opts}

ifconfig $DEV up

Expand Down

0 comments on commit b3512ec

Please sign in to comment.