svn commit: r184506 - releng/6.4/sys/netinet
Oleg Bulyzhin
oleg at FreeBSD.org
Fri Oct 31 06:01:32 PDT 2008
Author: oleg
Date: Fri Oct 31 13:01:31 2008
New Revision: 184506
URL: http://svn.freebsd.org/changeset/base/184506
Log:
Direct commit (r184414 is not applicable to stable due to ABI change):
Workaround possible q_time overflow (will happen after 2^32/(86400*hz)
days of uptime (~50days for hz = 1000)), which may lead to:
- broken shaping in 'fast' io mode.
- incorrect average queue length calculation in RED/GRED algorithm.
PR: kern/128401
Approved by: re (kensmith)
Modified:
releng/6.4/sys/netinet/ip_dummynet.c
Modified: releng/6.4/sys/netinet/ip_dummynet.c
==============================================================================
--- releng/6.4/sys/netinet/ip_dummynet.c Fri Oct 31 13:00:34 2008 (r184505)
+++ releng/6.4/sys/netinet/ip_dummynet.c Fri Oct 31 13:01:31 2008 (r184506)
@@ -1186,7 +1186,8 @@ red_drops(struct dn_flow_set *fs, struct
* XXX check wraps...
*/
if (q->avg) {
- u_int t = (curr_time - q->q_time) / fs->lookup_step;
+ u_int t = ((uint32_t)curr_time - q->q_time) /
+ fs->lookup_step;
q->avg = (t < fs->lookup_depth) ?
SCALE_MUL(q->avg, fs->w_q_lookup[t]) : 0;
@@ -1382,7 +1383,7 @@ dummynet_io(struct mbuf **m0, int dir, s
if (q->head != m) /* Flow was not idle, we are done. */
goto done;
- if (q->q_time < curr_time)
+ if (q->q_time < (uint32_t)curr_time)
q->numbytes = io_fast ? fs->pipe->bandwidth : 0;
q->q_time = curr_time;
More information about the svn-src-all
mailing list