diff --git a/package/plugin-gargoyle-i18n-English-EN/files/www/i18n/English-EN/qos.js b/package/plugin-gargoyle-i18n-English-EN/files/www/i18n/English-EN/qos.js index f41067562..c3300c44f 100644 --- a/package/plugin-gargoyle-i18n-English-EN/files/www/i18n/English-EN/qos.js +++ b/package/plugin-gargoyle-i18n-English-EN/files/www/i18n/English-EN/qos.js @@ -113,3 +113,14 @@ qosStr.DBSect="QoS Download Bandwidth Distribution"; qosStr.uTFrm="Upload Time Frame"; qosStr.dTFrm="Download Time Frame"; +//known device groups +qosStr.DevGroup="Device Group"; + +qosStr.CakeMode="Use Simple Mode (CAKE) instead of Advanced (HFSC)"; +qosStr.CakeAbout="Simple mode uses CAKE, a modern queuing algorithm that automatically prevents bufferbloat and fairly shares bandwidth between all devices and flows. No manual class configuration is needed -- just set your bandwidth and enable. CAKE is recommended for most users."; +qosStr.CakeOverhead="Link overhead compensation"; +qosStr.CakeOHNone="None (direct Ethernet)"; +qosStr.CakeTins="CAKE automatically prioritises traffic into four tiers: Voice (VoIP, gaming), Video (streaming), Best Effort (web), and Bulk (downloads, torrents). Apps that mark their own traffic are classified automatically."; +qosStr.CakeStatus="CAKE status"; +qosStr.CakeActive="Active"; +qosStr.CakeInactive="Inactive (restart QoS to apply)"; diff --git a/package/plugin-gargoyle-qos/files/www/js/qos.js b/package/plugin-gargoyle-qos/files/www/js/qos.js index 06fb97b9c..277b3c552 100644 --- a/package/plugin-gargoyle-qos/files/www/js/qos.js +++ b/package/plugin-gargoyle-qos/files/www/js/qos.js @@ -21,6 +21,21 @@ function saveChanges() var bwmonCleanCommand = bwmonCleanCommand + "if [ -d /tmp/data/bwmon/ ] ; then rm /tmp/data/bwmon/qos-" + direction + "-* >/dev/null 2>&1 ; fi ;\n"; + var isCake = document.getElementById("cake_enabled").checked; + uci.set("qos_gargoyle", direction, "cake_enabled", isCake ? "1" : "0"); + if(isCake) + { + var overhead = document.getElementById("cake_overhead").value; + if(overhead != "none") + { + uci.set("qos_gargoyle", direction, "cake_overhead", overhead); + } + else + { + uci.remove("qos_gargoyle", direction, "cake_overhead"); + } + } + //Save the setting of the qos_monenable flag if (direction == "download") { @@ -54,7 +69,7 @@ function saveChanges() var switchingFullQosEnabled = (fullQosWillBeEnabled != qosEnabled); //Is the user requesting disable of this direction of QoS? - if(disabled) + if(disabled && !isCake) { //If this page was enabled before and the other was not then stop and disable QoS if(qosEnabled && alternateBandwidth == "" ) @@ -83,6 +98,21 @@ function saveChanges() { errors=qosStr.TotErr; } + else if(isCake) + { + qosEnabled = true; + uci.set("gargoyle", "status", "qos", "300"); + uci.set("qos_gargoyle", direction, "total_bandwidth", document.getElementById("total_bandwidth").value); + if(switchingFullQosEnabled && qosQuotasExist()) + { + commands = uci.getScriptCommands(uciOriginal) + "\n/etc/init.d/qos_gargoyle enable ;\nsh /usr/lib/gargoyle/restart_firewall.sh ;\n"; + } + else + { + commands = "\n/etc/init.d/qos_gargoyle start ;\n/etc/init.d/qos_gargoyle enable ;\n"; + commands = uci.getScriptCommands(uciOriginal) + "\n" + commands + stopbwmon + bwmonCleanCommand + startbwmon; + } + } else { qosEnabled = true; @@ -560,6 +590,10 @@ function resetData() } + document.getElementById("cake_enabled").checked = cakeEnabled; + document.getElementById("cake_overhead").value = cakeOverhead; + setCakeMode(); + setQosEnabled(); //Startup the dynamic screen updates. @@ -642,6 +676,29 @@ function setQosEnabled() resetServiceClassControls(); } +function setCakeMode() +{ + var isCake = document.getElementById("cake_enabled").checked; + var hfscPanels = ["qos_class_table_container", "qos_rule_table_container", + "add_class_container", "add_rule_container", + "default_class_label", "default_class", + "qos_monitor_container", "acc_panel"]; + for(var i = 0; i < hfscPanels.length; i++) + { + var el = document.getElementById(hfscPanels[i]); + if(el) { el.style.display = isCake ? "none" : ""; } + } + var cakePanel = document.getElementById("cake_options_panel"); + if(cakePanel) { cakePanel.style.display = isCake ? "" : "none"; } + var cakeStatusPanel = document.getElementById("cake_status_panel"); + if(cakeStatusPanel) { cakeStatusPanel.style.display = isCake ? "" : "none"; } + // Bandwidth field must always be editable in CAKE mode (used for shaper bandwidth) + if(isCake) + { + setElementEnabled(document.getElementById("total_bandwidth"), true, ""); + } +} + function addClassificationRule() { errors = proofreadClassificationRule(); @@ -651,6 +708,7 @@ function addClassificationRule() } else { + syncGroupIpFields(); addRuleMatchControls = ["ip_family", "source_ip", "source_port", "dest_ip", "dest_port", "max_pktsize", "min_pktsize", "transport_protocol", "connbytes_kb", "app_protocol"]; displayList = [UI.IPFam+": $", qosStr.Src+": $", qosStr.SrcP+": $", qosStr.Dst+": $", qosStr.DstP+": $", qosStr.MaxPktLen+": $ "+UI.byt, qosStr.MinPktLen+": $ "+UI.byt, qosStr.TrProto+": $", qosStr.Connb+": $ "+UI.KBy, qosStr.APro+": $"]; @@ -695,6 +753,7 @@ function proofreadClassificationRule() alwaysValid = function(text){return 0;}; validateQOSIPRangeAndFamily = function(ipstr) { + if(ipstr.indexOf("GROUP:") === 0) { return 0; } var retVal = 0; var ipfam = getIPFamily(ipstr); var selfam = document.getElementById("ip_family").value; @@ -748,6 +807,16 @@ function resetRuleControls() checkbox.checked =false; enableAssociatedField( checkbox, ruleControlIds[ruleControlIndex], ""); } + + ["source", "dest"].forEach(function(w) + { + var typeEl = document.getElementById(w + "_ip_type"); + typeEl.value = "ip"; + typeEl.disabled = true; + document.getElementById(w + "_group_select").disabled = true; + document.getElementById(w + "_ip_text_container").style.display = ""; + document.getElementById(w + "_group_container").style.display = "none"; + }); } function addServiceClass() @@ -906,6 +975,7 @@ function editRuleTableRow(editRuleWindowRow) } else { + syncGroupIpFields(); addRuleMatchControls = ["ip_family", "source_ip", "source_port", "dest_ip", "dest_port", "max_pktsize", "min_pktsize", "transport_protocol", "connbytes_kb", "app_protocol"]; displayList = [UI.IPFam+": $", qosStr.Src+": $", qosStr.SrcP+": $", qosStr.Dst+": $", qosStr.DstP+": $", qosStr.MaxPktLen+": $ "+UI.byt, qosStr.MinPktLen+": $ "+UI.byt, qosStr.TrProto+": $", qosStr.Connb+": $ "+UI.KBy, qosStr.APro+": $"]; ruleText = "" @@ -1098,19 +1168,17 @@ function updatetc() { updateInProgress = true; - var commands="tc -s class show dev "; + var cakeActive = document.getElementById("cake_enabled") && document.getElementById("cake_enabled").checked; + var tcDev = direction == "download" ? "ifb0" : currentWanName; + var commands; - if (direction == "download") + if(cakeActive) { - commands = commands + "ifb0"; + commands = "tc qdisc show dev " + tcDev; } else { - /* - * NOTE: This NEEDS to be "currentWanName" variable NOT "currentWanIf" Variable!!! - * If this doesn't work the problem is in gargoyle_header_footer utility, not here - */ - commands = commands + currentWanName; + commands = "tc -s class show dev " + tcDev; } var param = getParameterDefinition("commands", commands) + "&" + getParameterDefinition("hash", document.cookie.replace(/^.*hash=/,"").replace(/[\t ;]+.*$/, "")); @@ -1119,6 +1187,24 @@ function updatetc() { if(req.readyState == 4) { + if(cakeActive) + { + var statusEl = document.getElementById("cake_active_status"); + if(statusEl) + { + if(req.responseText.indexOf("cake") >= 0) + { + statusEl.innerHTML = "Active"; + } + else + { + statusEl.innerHTML = "Inactive — restart QoS to apply"; + } + } + updateInProgress = false; + return; + } + /*Only match leaf classes and class with 2 digit class numbers since on the upload side class 1:127 is only for qosmon*/ var lines = req.responseText.match(/hfsc\s1:[0-9]{1,2}\s.+leaf.+\n.+Sent\s[0-9]+/g); var d=new Date(); @@ -1240,8 +1326,54 @@ function resetFairLinkLimit() runAjax("POST", "utility/run_commands.sh", param, stateChangeFunction); } +function populateQosGroupSelects() +{ + ["source_group_select", "dest_group_select"].forEach(function(selId) + { + var sel = document.getElementById(selId); + if(!sel) { return; } + while(sel.firstChild) { sel.removeChild(sel.firstChild); } + var gi; + for(gi = 0; gi < knownDeviceGroups.length; gi++) + { + var opt = document.createElement("option"); + opt.value = knownDeviceGroups[gi]; + opt.textContent = knownDeviceGroups[gi]; + sel.appendChild(opt); + } + }); +} + +function syncGroupIpFields() +{ + ["source", "dest"].forEach(function(w) + { + var typeEl = document.getElementById(w + "_ip_type"); + if(!typeEl.disabled && typeEl.value == "group") + { + var sel = document.getElementById(w + "_group_select"); + document.getElementById(w + "_ip").value = sel.options.length > 0 ? "GROUP:" + sel.value : ""; + } + }); +} + +function updateRuleIpMode(which) +{ + var checkEl = document.getElementById("use_" + which + "_ip"); + var enabled = checkEl.checked && !checkEl.disabled; + var typeEl = document.getElementById(which + "_ip_type"); + typeEl.disabled = !enabled; + var mode = typeEl.value; + var ipField = document.getElementById(which + "_ip"); + ipField.disabled = !(enabled && mode == "ip"); + document.getElementById(which + "_group_select").disabled = !(enabled && mode == "group"); + document.getElementById(which + "_ip_text_container").style.display = (enabled && mode == "ip") ? "" : "none"; + document.getElementById(which + "_group_container").style.display = (enabled && mode == "group") ? "" : "none"; +} + function addRuleModal() { + populateQosGroupSelects(); modalButtons = [ {"title" : UI.Add, "classes" : "btn btn-primary", "function" : addClassificationRule}, "defaultDismiss" @@ -1256,6 +1388,7 @@ function addRuleModal() function editRuleModal(triggerEl) { + populateQosGroupSelects(); editRow=triggerEl.parentNode.parentNode; modalButtons = [ {"title" : UI.CApplyChanges, "classes" : "btn btn-primary", "function" : function(){editRuleTableRow(editRow);}}, @@ -1312,6 +1445,23 @@ function editRuleModal(triggerEl) enableAssociatedField(ruleControlCheckbox, ruleControlId, "", document); } } + + // Restore group mode for source/dest if criteria contains GROUP: prefix + ["source", "dest"].forEach(function(w) + { + var ipField = document.getElementById(w + "_ip"); + if(ipField.value.indexOf("GROUP:") === 0) + { + var groupName = ipField.value.substring(6); + ipField.value = ""; + ipField.disabled = true; + var typeEl = document.getElementById(w + "_ip_type"); + typeEl.value = "group"; + setSelectedValue(w + "_group_select", groupName, document); + updateRuleIpMode(w); + } + }); + setSelectedText("classification", editRow.childNodes[1].firstChild.data, document); updateIPControls(document.getElementById("ip_family")); @@ -1418,6 +1568,8 @@ function updateIPControls(triggerEl) } enableAssociatedField(checkEl,elArr[x], ''); } + updateRuleIpMode('source'); + updateRuleIpMode('dest'); } function proofreadQOSIPRange(triggerEl) diff --git a/package/plugin-gargoyle-qos/files/www/qos_download.sh b/package/plugin-gargoyle-qos/files/www/qos_download.sh index 72edf91b7..e1bbaaf63 100755 --- a/package/plugin-gargoyle-qos/files/www/qos_download.sh +++ b/package/plugin-gargoyle-qos/files/www/qos_download.sh @@ -22,6 +22,18 @@ else echo "var qosEnabled = false;" fi + + echo "var knownDeviceGroups = [];" + uci show dhcp 2>/dev/null | grep '^dhcp\.[^.]*\.group=' | sed "s/^[^=]*=//; s/'//g" | sort -u | grep -v '^$' | while read grp ; do + escaped=$(printf '%s' "$grp" | sed 's/\\/\\\\/g; s/"/\\"/g') + printf 'knownDeviceGroups.push("%s");\n' "$escaped" + done + + cake_enabled=$(uci get qos_gargoyle.download.cake_enabled 2>/dev/null) + echo "var cakeEnabled = $([ "$cake_enabled" = "1" ] && echo "true" || echo "false");" + cake_overhead=$(uci get qos_gargoyle.download.cake_overhead 2>/dev/null) + echo "var cakeOverhead = \"${cake_overhead:-none}\";" + cake_active=$(tc qdisc show dev ifb0 2>/dev/null | grep -c "^qdisc cake" || echo 0) %> //--> @@ -49,6 +61,30 @@
+
+ + + + +
+ +
+ + + + +
+ +
> + + <% if [ "${cake_active:-0}" -gt 0 ] 2>/dev/null; then printf 'Active'; else printf 'Configured — restart QoS to activate'; fi %> +
+
@@ -126,7 +162,7 @@
-
+

<%~ DACCSect %>

diff --git a/package/plugin-gargoyle-qos/files/www/qos_upload.sh b/package/plugin-gargoyle-qos/files/www/qos_upload.sh index 8893ed9d4..36b2e8b7a 100755 --- a/package/plugin-gargoyle-qos/files/www/qos_upload.sh +++ b/package/plugin-gargoyle-qos/files/www/qos_upload.sh @@ -21,6 +21,19 @@ else echo "var qosEnabled = false;" fi + + echo "var knownDeviceGroups = [];" + uci show dhcp 2>/dev/null | grep '^dhcp\.[^.]*\.group=' | sed "s/^[^=]*=//; s/'//g" | sort -u | grep -v '^$' | while read grp ; do + escaped=$(printf '%s' "$grp" | sed 's/\\/\\\\/g; s/"/\\"/g') + printf 'knownDeviceGroups.push("%s");\n' "$escaped" + done + + cake_enabled=$(uci get qos_gargoyle.upload.cake_enabled 2>/dev/null) + echo "var cakeEnabled = $([ "$cake_enabled" = "1" ] && echo "true" || echo "false");" + cake_overhead=$(uci get qos_gargoyle.upload.cake_overhead 2>/dev/null) + echo "var cakeOverhead = \"${cake_overhead:-none}\";" + wan_if=$(uci get network.wan.device 2>/dev/null || uci get network.wan.ifname 2>/dev/null) + cake_active=$(tc qdisc show dev "${wan_if:-eth1}" 2>/dev/null | grep -c "^qdisc cake" || echo 0) %> //--> @@ -46,6 +59,30 @@
+
+ + + + +
+ +
+ + + + +
+ +
> + + <% if [ "${cake_active:-0}" -gt 0 ] 2>/dev/null; then printf 'Active'; else printf 'Configured — restart QoS to activate'; fi %> +
+
diff --git a/package/qos-gargoyle/Makefile b/package/qos-gargoyle/Makefile index b9199fc22..fca22a5bd 100644 --- a/package/qos-gargoyle/Makefile +++ b/package/qos-gargoyle/Makefile @@ -16,7 +16,7 @@ define Package/qos-gargoyle SECTION:=net CATEGORY:=Network TITLE:=A set of QoS scripts designed for use with Gargoyle Web Interface - DEPENDS:=+tc +ip +kmod-ifb +kmod-sched +kmod-sched-connmark +kmod-sched-prio +gargoyle-firewall-util + DEPENDS:=+tc +ip +kmod-ifb +kmod-sched +kmod-sched-connmark +kmod-sched-prio +kmod-sched-cake +gargoyle-firewall-util MAINTAINER:=Eric Bishop endef diff --git a/package/qos-gargoyle/files/qos_gargoyle.init b/package/qos-gargoyle/files/qos_gargoyle.init index 883bf30dc..952ed5994 100755 --- a/package/qos-gargoyle/files/qos_gargoyle.init +++ b/package/qos-gargoyle/files/qos_gargoyle.init @@ -389,6 +389,19 @@ initialize_qos() $echo_off if [ $total_upload_bandwidth -ge 0 ] ; then + cake_enabled_ul=$(uci get qos_gargoyle.upload.cake_enabled 2>/dev/null) + if [ "$cake_enabled_ul" = "1" ] ; then + ul_overhead=$(uci get qos_gargoyle.upload.cake_overhead 2>/dev/null) + cake_ul_opts="bandwidth ${total_upload_bandwidth}kbit diffserv4 nat" + [ "$ul_overhead" = "pppoe" ] && cake_ul_opts="$cake_ul_opts pppoe-ptm" + [ "$ul_overhead" = "vdsl" ] && cake_ul_opts="$cake_ul_opts atm overhead 32" + [ "$ul_overhead" = "ethernet" ] && cake_ul_opts="$cake_ul_opts overhead 18" + tc qdisc del dev $qos_interface root 2>/dev/null + $echo_on + tc qdisc add dev $qos_interface root cake $cake_ul_opts + $echo_off + fi + if [ "$cake_enabled_ul" != "1" ] ; then #load upload classes upload_class_list=$(load_all_config_sections "$config_file_name" "upload_class") for uclass_name in $upload_class_list ; do @@ -479,7 +492,7 @@ initialize_qos() #of the bandwidth allocated to this class. To impliment per IP sharing of the class we use the flow classifier #and the 'nfct-src' on the upload side and 'dst' on the download side. I found a nice man page here #https://arndtroide.homelinux.org/cgi-bin/man/man2html?tc-sfq+8 - + #Add the leaf class tc class add dev $qos_interface parent 1:1 classid 1:$next_class_index hfsc ls m2 ${m2}Mbit $ll_str $ul_str #Add the qdisc to the leaf class, assuming average packet at 250 bytes. @@ -537,19 +550,36 @@ initialize_qos() # save current mark to connmark at end of chain nft add rule inet fw4 mangle_qos_egress ct mark set ct mark \& $upload_mask_inv \| mark \& $upload_mask + fi fi #Only if both upload and download QoS are enabled can we enable Gargoyle active QoS monitor if [ $total_download_bandwidth -eq 0 ] || [ $total_upload_bandwidth -eq 0 ] ; then - qos_monenabled = "false" ; + qos_monenabled="false" fi if [ $total_download_bandwidth -ge 0 ] ; then # Set up the Intermediate Functional block (IFB0) for ingress ip link set $qos_ifb up + cake_enabled_dl=$(uci get qos_gargoyle.download.cake_enabled 2>/dev/null) + if [ "$cake_enabled_dl" = "1" ] ; then + dl_overhead=$(uci get qos_gargoyle.download.cake_overhead 2>/dev/null) + cake_dl_opts="bandwidth ${total_download_bandwidth}kbit diffserv4 nat ingress" + [ "$dl_overhead" = "pppoe" ] && cake_dl_opts="$cake_dl_opts pppoe-ptm" + [ "$dl_overhead" = "vdsl" ] && cake_dl_opts="$cake_dl_opts atm overhead 32" + [ "$dl_overhead" = "ethernet" ] && cake_dl_opts="$cake_dl_opts overhead 18" + tc qdisc del dev $qos_ifb root 2>/dev/null + $echo_on + tc qdisc add dev $qos_ifb root cake $cake_dl_opts + tc qdisc add dev $qos_interface handle ffff: ingress 2>/dev/null + tc filter add dev $qos_interface parent ffff: protocol ip u32 match u8 0 0 action mirred egress redirect dev $qos_ifb flowid ffff:1 + tc filter add dev $qos_interface parent ffff: protocol ipv6 u32 match u8 0 0 action mirred egress redirect dev $qos_ifb flowid ffff:1 + $echo_off + fi + if [ "$cake_enabled_dl" != "1" ] ; then # Attach ingress queuing discipline to IFB0 with temporary default tc qdisc add dev $qos_ifb root handle 1:0 hfsc default 1 @@ -575,7 +605,7 @@ initialize_qos() if [ -z "$max_bandwidth" ] ; then max_bandwidth="-1" fi - + classdef="$percent_bandwidth $max_bandwidth $min_bandwidth $minRTT" eval $dclass_name=\"\$classdef\" #"#comment quote here so formatting in editor isn't FUBAR done @@ -600,8 +630,8 @@ initialize_qos() #The Gargoyle ACC switches from optimum WAN utilization mode to minimum RTT mode #when it detects a class has become active that includes a two part service curve. - #So to trigger this behaviour we create two parts curves when minRTT is set. - + #So to trigger this behaviour we create two parts curves when minRTT is set. + #Calculations for the delay parameter. Assuming PKT is the packet size the best we #could possibly do is PKT/total_download_bandwidth. If we do nothing we get the #worst delay of PKT/$m2 (the class bandwidth). Since this class has minRTT set we @@ -645,7 +675,7 @@ initialize_qos() tc class add dev $qos_ifb parent 1:1 classid 1:$next_class_index hfsc $rt_str $ll_str $ul_str #Assume average download packet size is 250 bytes. - tc qdisc add dev $qos_ifb parent 1:$next_class_index handle $next_class_index:1 sfq headdrop limit $(($tbw/250)) $sfq_depth divisor 256 + tc qdisc add dev $qos_ifb parent 1:$next_class_index handle $next_class_index:1 sfq headdrop limit $(($tbw/250)) $sfq_depth divisor 256 tc filter add dev $qos_ifb parent 1:0 prio $next_class_prio protocol ip handle $next_classid/$download_mask fw flowid 1:$next_class_index tc filter add dev $qos_ifb parent 1:0 prio $(($next_class_prio+1)) protocol ipv6 handle $next_classid/$download_mask fw flowid 1:$next_class_index tc filter add dev $qos_ifb parent $next_class_index: handle 1 flow divisor 256 map key dst and 0xff @@ -698,10 +728,11 @@ initialize_qos() nft add rule inet fw4 mangle_qos_ingress ct mark set ct mark \& $download_mask_inv \| mark \& $download_mask $echo_off + fi fi #Enable Gargoyle active QoS monitor - if [ $total_upload_bandwidth -ge 0 ] && [ $total_download_bandwidth -ge 0 ] && [ "$qos_monenabled" = "true" ] ; then + if [ $total_upload_bandwidth -ge 0 ] && [ $total_download_bandwidth -ge 0 ] && [ "$qos_monenabled" = "true" ] && [ "$(uci get qos_gargoyle.download.cake_enabled 2>/dev/null)" != "1" ] ; then $echo_on #if the user specified a ping target then use that otherwise use the gateway. @@ -714,27 +745,27 @@ initialize_qos() if [ -z "$ptarget_ip" ] ; then #ip of potential gateway target=$(echo "$t" | awk '{ print $1 ; }') - target_is_local=$(echo "$target" | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|0\.0\.0\.0|127\.|255\.)') + target_is_local=$(echo "$target" | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|0\.0\.0\.0|127\.|255\.)') # round or rather ceil() time up to nearest millisecond since bash doesn't like working with decimals time=$(echo "$t" | awk ' { print $3 ; }' | sed 's/\..*$//g') time=$(( $time + 1 )) - + if [ -z "$target_is_local" ] || [ "$time" -gt 5 ] ; then ptarget_ip="$target" fi fi done IFS="$old_ifs" - + #in case ping target is still not defined use default gateway if [ -z "$ptarget_ip" ] ; then ptarget_ip=$(gargoyle_header_footer -i gargoyle | sed -n 's/.*currentWanGateway.*"\(.*\)".*/\1/p') fi fi - + #Ping responses from the ping target never go to ingress QoS (so their MARK isn't overwritten). if [ "$(ip_family $ptarget_ip)" == "ipv4" ] ; then nft insert rule inet fw4 mangle_qos_ingress icmp type echo-reply ip saddr $ptarget_ip return @@ -834,9 +865,9 @@ define_interface() get_current_qosmon_state() { # If we are coming from hotplug, we may be in the middle of an ifupdate where we could - # skip the initial unloading and measurement of the link. This saves us a 15s dropout if we + # skip the initial unloading and measurement of the link. This saves us a 15s dropout if we # don't need one - + # Find the current qosmon target ping IP qmoncurrenttarget="$(ps | grep [q]osmon | awk ' { @@ -880,8 +911,8 @@ stop() [ -e $bwmonscript ] && $bwmonscript "stop" $echo_on - #Delete the qdiscs we hung on the devices - for iface in $(tc qdisc show | grep hfsc | awk '{print $5}'); do + #Delete the qdiscs we hung on the devices (hfsc or cake) + for iface in $(tc qdisc show | grep -E 'hfsc|cake' | awk '{print $5}'); do tc qdisc del dev "$iface" root 2>/dev/null tc qdisc del dev "$iface" ingress 2>/dev/null done @@ -908,7 +939,7 @@ start() #This script is called by a hotplug event. If the WAN comes #up fast we could end up trying to run qos_gargoyle while the #boot is still in progress which causes issues in low memory - #routers. To avoid this we check to see if rcS is still running + #routers. To avoid this we check to see if rcS is still running #or not. If it is we wait until it completes or 60 seconds. cnt=0 while ps | grep '[//]rcS S boot' >/dev/null diff --git a/targets/mediatek/profiles/filogic/config b/targets/mediatek/profiles/filogic/config index 4d33114a2..d1a20094a 100644 --- a/targets/mediatek/profiles/filogic/config +++ b/targets/mediatek/profiles/filogic/config @@ -3770,7 +3770,7 @@ CONFIG_PACKAGE_kmod-sched=m # CONFIG_PACKAGE_kmod-sched-act-sample is not set # CONFIG_PACKAGE_kmod-sched-act-vlan is not set # CONFIG_PACKAGE_kmod-sched-bpf is not set -# CONFIG_PACKAGE_kmod-sched-cake is not set +CONFIG_PACKAGE_kmod-sched-cake=m CONFIG_PACKAGE_kmod-sched-connmark=m CONFIG_PACKAGE_kmod-sched-core=m # CONFIG_PACKAGE_kmod-sched-ctinfo is not set