]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PKT_SCHED] RED: Fix overflow in calculation of queue average
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Thu, 18 Oct 2007 15:56:27 +0000 (17:56 +0200)
committerAdrian Bunk <bunk@kernel.org>
Thu, 18 Oct 2007 15:56:27 +0000 (17:56 +0200)
commitc94861ff9759f5f73b49fb4f0fe0c000b82c703a
tree66a4ad3facf0e7918e712f9182b110cbad1dfa5a
parent06f529d5fa3b8ea0b84d327b6fdda988d4b63a62
[PKT_SCHED] RED: Fix overflow in calculation of queue average

Overflow can occur very easily with 32 bits, e.g., with 1 second
us_idle is approx. 2^20, which leaves only 11-Wlog bits for queue
length. Since the EWMA exponent is typically around 9, queue
lengths larger than 2^2 cause overflow. Whether the affected
branch is taken when us_idle is as high as 1 second, depends on
Scell_log, but with rather reasonable configuration Scell_log is
large enough to cause p->Stab to have zero index, which always
results zero shift (typically also few other small indices result
in zero shift).

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
include/net/red.h