aboutsummaryrefslogtreecommitdiffstats
path: root/package/qos-scripts/files/usr/bin
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-02-21 01:33:27 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-02-21 01:33:27 +0000
commitfca74c3a44ec734916a39e979e8f0286accbe7d0 (patch)
treebd4867ccb249f3ed7a604e4249f07124c05bd7fd /package/qos-scripts/files/usr/bin
parentc0f0316109911b01fff6e4acf82c38bb3d6d4081 (diff)
downloadupstream-fca74c3a44ec734916a39e979e8f0286accbe7d0.tar.gz
upstream-fca74c3a44ec734916a39e979e8f0286accbe7d0.tar.bz2
upstream-fca74c3a44ec734916a39e979e8f0286accbe7d0.zip
qos-scripts: drop the use of IMQ, use ifb and act_connmark instead
SVN-Revision: 25640
Diffstat (limited to 'package/qos-scripts/files/usr/bin')
-rwxr-xr-xpackage/qos-scripts/files/usr/bin/qos-stat18
-rwxr-xr-xpackage/qos-scripts/files/usr/bin/qos-stop5
2 files changed, 16 insertions, 7 deletions
diff --git a/package/qos-scripts/files/usr/bin/qos-stat b/package/qos-scripts/files/usr/bin/qos-stat
index d7858d7a11..8a39df0847 100755
--- a/package/qos-scripts/files/usr/bin/qos-stat
+++ b/package/qos-scripts/files/usr/bin/qos-stat
@@ -33,26 +33,34 @@ print_comments() {
echo ''
}
+get_device() {
+ ( config_load network; scan_interfaces; config_get "$1" ifname )
+}
+
interface_stats() {
local interface="$1"
local device
- config_get device "$interface" device
+ device="$(get_device "$interface")"
+ [ -z "$device" ] && config_get device "$interface" device
config_get_bool enabled "$interface" enabled 1
[ -z "$device" -o 1 -ne "$enabled" ] && {
return 1
}
- config_get_bool halfduplex "$interface" halfduplex
+ config_get_bool halfduplex "$interface" halfduplex 0
- [ 1 -ne "$halfduplex" ] && {
+ if [ 1 -ne "$halfduplex" ]; then
unset halfduplex
print_comments "$interface" "Egress" "Start"
tc -s class show dev "$device"
print_comments "$interface" "Egress" "End"
- }
+ id="root"
+ else
+ id=""
+ fi
print_comments "$interface" "Ingress${halfduplex:+/Egress}" "Start"
- tc -s class show dev "$(iptables -v -L PREROUTING -t mangle | awk '/IMQ: todev .*$/ && $6 ~ /'$device'/ {print "imq"$12}')"
+ tc -s class show dev "$(tc filter show dev $device $id | grep mirred | sed -e 's,.*\(ifb.*\)).*,\1,')"
print_comments "$interface" "Ingress${halfduplex:+/Egress}" "End"
}
diff --git a/package/qos-scripts/files/usr/bin/qos-stop b/package/qos-scripts/files/usr/bin/qos-stop
index 2275ea12dc..d0243bea13 100755
--- a/package/qos-scripts/files/usr/bin/qos-stop
+++ b/package/qos-scripts/files/usr/bin/qos-stop
@@ -1,6 +1,7 @@
#!/bin/sh
-for iface in $(tc qdisc show | grep hfsc | awk '{print $5}'); do
- tc qdisc del dev "$iface" root
+for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do
+ tc qdisc del dev "$iface" ingress 2>&- >&-
+ tc qdisc del dev "$iface" root 2>&- >&-
done
iptables -t mangle -F
iptables -t mangle -X