diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-20 12:40:27 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-20 12:40:27 -0700 |
commit | 182cda3d11cc48437b25022bf2b08b2fa329da1f (patch) | |
tree | bc30bc84d95bdca7d014c0514d3ce63b3ef535dc /lib/Vyatta | |
parent | 03a533be3b4323e5fcd93c0c3b92ed7233819af8 (diff) | |
download | vyatta-cfg-qos-182cda3d11cc48437b25022bf2b08b2fa329da1f.tar.gz vyatta-cfg-qos-182cda3d11cc48437b25022bf2b08b2fa329da1f.zip |
Fix RED calculation
One extra division by 8 was bein done (bandwidth already in bits/sec).
Diffstat (limited to 'lib/Vyatta')
-rw-r--r-- | lib/Vyatta/Qos/Util.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Vyatta/Qos/Util.pm b/lib/Vyatta/Qos/Util.pm index 1d12bb3..2e0eec9 100644 --- a/lib/Vyatta/Qos/Util.pm +++ b/lib/Vyatta/Qos/Util.pm @@ -321,18 +321,18 @@ sub ethtoolRate { # Compute parameters for RED algorithim based on bandwidth and latency # -# 0.01 * Bandwidth Share * Desired Latency * Network Bandwidth -# Maximum Threshold = ------------------------------------------------------------------- -# 8 bits/byte* 1000 ms/sec +# Bandwidth (bits/sec) * Latency (ms) +# Maximum Threshold = -------------------------------------- +# 1000 ms/sec # -# Minimum Threshold = 1/2 * Maximum Threshold +# Minimum Threshold = Maximum Threshold / 3 # Avpkt = Average Packet Length # Burst = ( 2 * MinThreshold + MaxThreshold) / ( 3 * Avpkt ) # Limit = 4 * MaxThreshold sub RedParam { my ($bandwidth, $latency, $avgpkt) = @_; - my $qmax = ($bandwidth * $latency) / 8000; - my $qmin = $qmax / 2; + my $qmax = ($bandwidth * $latency) / 1000; + my $qmin = $qmax / 3; my $burst = ( 2 * $qmin + $qmax ) / ( 3 * $avgpkt ); return ($qmin, $qmax, $burst); |