Thread (4 messages) flat view 4 messages, 2 authors, 2012-01-05

Re: bug in qavg calculation in include/net/red.h (resending as plain-text email)

From: Eric Dumazet <hidden>
Date: 2012-01-05 20:13:26

Le jeudi 05 janvier 2012 à 19:30 +0000, Yalagandula, Praveen a écrit :
(Resending as plain text)

Dear Alexey,

The code (see below) for computing the queue average for RED
implementation in Linux kernel has a bug. The return line should be
"return p->qavg + ((backlog - p->qavg) >> p->Wlog);". 

qavg = qavg*(1-W) + backlog*W

     = qavg + (backlog-qavg)*W

The current buggy code applies right shift to only the previous qavg,
where as it should be applied to (backlog - qavg). Hope you can get
this bug corrected.
Code is correct.

Please read the comment, it really explains the thing.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help