diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-11-10 18:12:54 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-11-10 18:12:54 -0800 |
commit | 1f3727b1c665c5a22e6d461b052f0c2ffc76d810 (patch) | |
tree | 8d7998603c93e3c8fe5c5a3640be6795db6ca79b /scripts | |
parent | eacbdd4f0b986b9598cf7f5b38dcac01aabbdab3 (diff) | |
download | vyatta-cfg-qos-1f3727b1c665c5a22e6d461b052f0c2ffc76d810.tar.gz vyatta-cfg-qos-1f3727b1c665c5a22e6d461b052f0c2ffc76d810.zip |
Change input rate limiting to use token bucket
There are two ways to input rate limit. One uses the generic rate estimator
which is supposed to measure average rate, the other is to use a token bucket
based packet counter. Well the generic rate estimator doesn't work correctly
in current kernels (no effect), so switch to using rate and burst.
Bugfix 3881
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/VyattaQosTrafficLimiter.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/VyattaQosTrafficLimiter.pm b/scripts/VyattaQosTrafficLimiter.pm index 2907590..649fb17 100644 --- a/scripts/VyattaQosTrafficLimiter.pm +++ b/scripts/VyattaQosTrafficLimiter.pm @@ -26,6 +26,7 @@ my %fields = ( id => undef, priority => undef, + burst => undef, rate => undef, _match => undef, ); @@ -51,7 +52,8 @@ defined $rate or die "bandwidth must be defined for $level\n"; $self->{rate} = VyattaQosUtil::getRate($rate); - + $self->{burst} = $config->returnValue("burst"); + defined $self->{burst} or die "burst must be defined for $level\n"; $self->{priority} = $config->returnValue("priority"); foreach my $match ( $config->listNodes("match") ) { @@ -134,13 +136,10 @@ sub commands { printf {$out} "qdisc add dev %s handle %x: ingress\n", $dev, $parent; foreach my $class (@$classes) { - my $id = $class->{id}; - my $rate = $class->{rate}; - my $priority = $class->{priority}; - foreach my $match ( $class->matchRules() ) { - $match->filter( $out, $dev, $parent, $priority ); - printf {$out} " police avrate %s drop flowid :%x\n", $rate, $id; + $match->filter( $out, $dev, $parent, $class->{priority} ); + printf {$out} " police rate %s burst %s drop flowid :%x\n", + $class->{rate}, $class->{burst}, $class->{id}; } } } |