summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-26 16:02:09 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-26 16:02:09 -0700
commit0bcbf666c95a80a3cf8d68bd3d741046e9664a67 (patch)
treeddc2dc962959828066b4838ead0047eb562558c9
parent119828760cf90f13f4f2a61b936221158f9badc6 (diff)
parenta2bd5ff56304e11e7be738735287511bab84e929 (diff)
downloadvyatta-cfg-qos-0bcbf666c95a80a3cf8d68bd3d741046e9664a67.tar.gz
vyatta-cfg-qos-0bcbf666c95a80a3cf8d68bd3d741046e9664a67.zip
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg-qos into jenner
-rw-r--r--lib/Vyatta/Qos/RandomDetect.pm23
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm13
-rw-r--r--templates/qos-policy/round-robin/node.tag/class/node.tag/queue-type/node.def3
3 files changed, 22 insertions, 17 deletions
diff --git a/lib/Vyatta/Qos/RandomDetect.pm b/lib/Vyatta/Qos/RandomDetect.pm
index 155b669..67bbd73 100644
--- a/lib/Vyatta/Qos/RandomDetect.pm
+++ b/lib/Vyatta/Qos/RandomDetect.pm
@@ -94,13 +94,22 @@ sub commands {
my $rate = getAutoRate( $self->{_rate}, $dev );
# 1. setup DSMARK to convert DSCP to tc_index
- print "qdisc add dev eth0 root handle $root: dsmark indices 1 set_tc_index\n";
+ printf "qdisc add dev %s root handle %x:0 dsmark indices 8 set_tc_index\n",
+ $dev, $root;
# 2. use tcindex filter to convert tc_index to precedence
- print
- "filter add dev $dev parent $root: protocol ip prio 1 tcindex mask 0xe0 shift 5\n";
+ #
+ # Precedence Field: the three leftmost bits in the TOS octet of an IPv4
+ # header.
- print "qdisc add dev $dev parent $root: gred setup DPs 8 default 7\n";
+ printf "filter add dev %s parent %x:0 protocol ip prio 1 ",
+ $dev, $root;
+ print " tcindex mask 0xe0 shift 5\n";
+
+ # 3. Define GRED with unmatched traffic going to index 0
+ printf "qdisc add dev %s parent %x:0 handle %x:0 gred ",
+ $dev, $root, $root+1;
+ print " setup DPs 8 default 0 grio\n";
# set VQ parameters
for ( my $i = 0 ; $i <= 7 ; $i++ ) {
@@ -109,10 +118,10 @@ sub commands {
my $qmax = $param->{'max-threshold'};
my $prob = $param->{'mark-probability'};
- print "qdisc change dev $dev parent $root:$i gred";
+ printf "qdisc change dev %s parent %x:%x", $dev, $root+1, $i;
printf " limit %dK min %dK max %dK avpkt 1K", 4 * $qmax, $qmin, $qmax;
- printf " burst %d bandwidth %d DP %d probability %f\n",
- ( 2 * $qmin + $qmax ) / 3, $rate, $i, $prob;
+ printf " burst %d bandwidth %d probability %f DP %d prio %d\n",
+ ( 2 * $qmin + $qmax ) / 3, $rate, $prob, $i, $i;
}
}
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index 4e0ada1..3a25233 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -156,7 +156,7 @@ sub fifoQdisc {
#
# Bandwidth (bits/sec) * Latency (ms)
# Maximum Threshold = --------------------------------------
-# (bytes) 8 bits/byte * 1000000 us/sec
+# (bytes) 8 bits/byte * 1000 ms/sec
#
# Minimum Threshold = Maximum Threshold / 3
# Avpkt = Average Packet Length
@@ -168,12 +168,10 @@ sub fifoQdisc {
#
sub redQdisc {
my ( $self, $dev, $rate ) = @_;
- my $avg = 1000;
- my $latency = 100000;
- my $qmax = ( $rate * $latency ) / 8000000;
+ my $qmax = ( $rate * 100 ) / 8000;
my $qmin = $qmax / 3;
- my $burst = ( 2 * $qmin + $qmax ) / ( 3 * $avg );
- my $maxp = 0.1;
+ my $avg = 1024;
+ my $burst = ( 2 * $qmin + $qmax ) / (3*$avg);
my $limit = $self->{_limit};
my $qlimit;
@@ -184,8 +182,7 @@ sub redQdisc {
}
printf "red limit %d min %d max %d avpkt %d", $qlimit, $qmin, $qmax, $avg;
- printf " burst %d probability %f bandwidth %d ecn\n",
- $burst, $maxp, $rate / 1000;
+ printf " burst %d probability 0.1 bandwidth %s ecn\n", $burst, $rate;
}
my %qdiscOptions = (
diff --git a/templates/qos-policy/round-robin/node.tag/class/node.tag/queue-type/node.def b/templates/qos-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
index 295c04c..61f9506 100644
--- a/templates/qos-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
+++ b/templates/qos-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
@@ -1,10 +1,9 @@
type: txt
default: "fair-queue"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect"; "Unknown queue-type"
+syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail"; "Unknown queue-type"
help: Set the queue type for this class
comp_help:Possible completions
fair-queue\tStochastic Fair Queue (SFQ)
drop-tail\tFirst-In-First-Out (FIFO)
priority\tPriority queueing based on DSCP
- random-detect\tRandom Early Detection (RED)