[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <67E2BF19E6D6A749A7680AEF496EB37C39D9204067@GVW0547EXC.americas.hpqcorp.net>
Date: Thu, 5 Jan 2012 19:30:56 +0000
From: "Yalagandula, Praveen" <praveen.yalagandula@...com>
To: Alexey Kuznetsov <kuznet@....inr.ac.ru>
CC: "Yalagandula, Praveen" <praveen.yalagandula@...com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: bug in qavg calculation in include/net/red.h (resending as
plain-text email)
(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.
Thanks,
Praveen Yalagandula
Senior Researcher, HP Labs, Palo Alto, CA
-------------------------------------
static inline unsigned long red_calc_qavg_no_idle_time(struct red_parms *p, unsigned int backlog)
{
/*
* NOTE: p->qavg is fixed point number with point at Wlog.
* The formula below is equvalent to floating point
* version:
*
* qavg = qavg*(1-W) + backlog*W;
*
* --ANK (980924)
*/
return p->qavg + (backlog - (p->qavg >> p->Wlog));
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists