Date: Fri, 31 Oct 2008 12:58:12 +0000 (UTC) From: Oleg Bulyzhin <oleg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r184504 - stable/7/sys/netinet Message-ID: <200810311258.m9VCwCb8081154@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oleg Date: Fri Oct 31 12:58:12 2008 New Revision: 184504 URL: http://svn.freebsd.org/changeset/base/184504 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: stable/7/sys/netinet/ip_dummynet.c Modified: stable/7/sys/netinet/ip_dummynet.c ============================================================================== --- stable/7/sys/netinet/ip_dummynet.c Fri Oct 31 11:47:51 2008 (r184503) +++ stable/7/sys/netinet/ip_dummynet.c Fri Oct 31 12:58:12 2008 (r184504) @@ -1155,7 +1155,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; @@ -1350,7 +1351,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810311258.m9VCwCb8081154>