diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-26 16:02:09 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-26 16:02:09 -0700 |
commit | 0bcbf666c95a80a3cf8d68bd3d741046e9664a67 (patch) | |
tree | ddc2dc962959828066b4838ead0047eb562558c9 /lib/Vyatta/Qos/RandomDetect.pm | |
parent | 119828760cf90f13f4f2a61b936221158f9badc6 (diff) | |
parent | a2bd5ff56304e11e7be738735287511bab84e929 (diff) | |
download | vyatta-cfg-qos-0bcbf666c95a80a3cf8d68bd3d741046e9664a67.tar.gz vyatta-cfg-qos-0bcbf666c95a80a3cf8d68bd3d741046e9664a67.zip |
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg-qos into jenner
Diffstat (limited to 'lib/Vyatta/Qos/RandomDetect.pm')
-rw-r--r-- | lib/Vyatta/Qos/RandomDetect.pm | 23 |
1 files changed, 16 insertions, 7 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; } } |