mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-26 05:07:46 +00:00
red: give a hint about burst value
Check for burst values that are too small. Reported-by: Dave Taht <dave.taht@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
This commit is contained in:
parent
7b8179c780
commit
0cf67ead7b
@ -56,8 +56,11 @@ int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt)
|
||||
double W = 0.5;
|
||||
double a = (double)burst + 1 - (double)qmin/avpkt;
|
||||
|
||||
if (a < 1.0)
|
||||
if (a < 1.0) {
|
||||
fprintf(stderr, "tc_red_eval_ewma() burst %u is too small ?"
|
||||
" Try burst %u\n", burst, 1 + qmin/avpkt);
|
||||
return -1;
|
||||
}
|
||||
for (wlog=1; wlog<32; wlog++, W /= 2) {
|
||||
if (a <= (1 - pow(1-W, burst))/W)
|
||||
return wlog;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user