summaryrefslogtreecommitdiffstats
path: root/package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-07-17 12:02:06 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-07-17 12:02:06 +0000
commit4ef8d2e014e377895e55ad1bd2e5eb2cef092e66 (patch)
treec2cc92cc78000eb3b50bcce59fadd47c53186007 /package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk
parentf44d3f99803be7ba5c38b26a2d8cbda1c301e893 (diff)
downloadmaster-31e0f0ae-4ef8d2e014e377895e55ad1bd2e5eb2cef092e66.tar.gz
master-31e0f0ae-4ef8d2e014e377895e55ad1bd2e5eb2cef092e66.tar.bz2
master-31e0f0ae-4ef8d2e014e377895e55ad1bd2e5eb2cef092e66.zip
qos-scripts: fix ingress packet marking with ifb
Split connection mark into two parts: The lower nibble contains the confirmed conntrack mark which is not generated by default/reclassify rules. The upper nibble contains the current value specified by default/reclassify rules. For egress, the default/reclassify value is preferred For ingress, the connection mark is preferred Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41682
Diffstat (limited to 'package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk')
-rw-r--r--package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk17
1 files changed, 14 insertions, 3 deletions
diff --git a/package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk b/package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk
index 2a8871495e..8f8eefd938 100644
--- a/package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk
+++ b/package/network/config/qos-scripts/files/usr/lib/qos/tcrules.awk
@@ -32,7 +32,7 @@ END {
sum_rtprio += prio[i]
}
}
-
+
# allocation of m1 in rt classes:
# sum(d * m1) must not exceed dmax * (linespeed - allocated)
dmax = 0
@@ -46,7 +46,7 @@ END {
if (d[i] > dmax) dmax = d[i]
}
}
- }
+ }
ds_avail = dmax * (linespeed - allocated)
for (i = 1; i <= n; i++) {
@@ -84,7 +84,18 @@ END {
# filter rule
for (i = 1; i <= n; i++) {
- print "tc filter add dev "device" parent 1: prio "class[i]" protocol ip handle "class[i]"/0xff fw flowid 1:"class[i] "0"
+ filter_cmd = "tc filter add dev "device" parent 1: prio %d protocol ip handle %s fw flowid 1:%d0\n";
+ if (direction == "up") {
+ filter_1 = sprintf("0x%x0/0xf0", class[i])
+ filter_2 = sprintf("0x0%x/0x0f", class[i])
+ } else {
+ filter_1 = sprintf("0x0%x/0x0f", class[i])
+ filter_2 = sprintf("0x%x0/0xf0", class[i])
+ }
+
+ printf filter_cmd, class[i] * 2, filter_1, class[i]
+ printf filter_cmd, class[i] * 2 + 1, filter_2, class[i]
+
filterc=1
if (filter[i] != "") {
print " tc filter add dev "device" parent "class[i]"00: handle "filterc"0 "filter[i]