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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux