svn commit: r216759 - releng/8.2/sys/netinet/ipfw

Oleg Bulyzhin oleg at FreeBSD.org
Tue Dec 28 12:18:47 UTC 2010


Author: oleg
Date: Tue Dec 28 12:18:46 2010
New Revision: 216759
URL: http://svn.freebsd.org/changeset/base/216759

Log:
  MFC r213265:
  
  Fix handling of initial credit for an idle pipe.  This fixes the bug where
  setting bw > 1 MTU/tick resulted in infinite bandwidth if io_fast=1
  
  PR:		kern/147245, kern/148429
  Obtained from:	Riccardo Panicucci
  Approved by:	re (bz)

Modified:
  releng/8.2/sys/netinet/ipfw/ip_dn_io.c
Directory Properties:
  releng/8.2/sys/   (props changed)
  releng/8.2/sys/amd64/include/xen/   (props changed)
  releng/8.2/sys/cddl/contrib/opensolaris/   (props changed)
  releng/8.2/sys/contrib/dev/acpica/   (props changed)
  releng/8.2/sys/contrib/pf/   (props changed)

Modified: releng/8.2/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- releng/8.2/sys/netinet/ipfw/ip_dn_io.c	Tue Dec 28 12:13:30 2010	(r216758)
+++ releng/8.2/sys/netinet/ipfw/ip_dn_io.c	Tue Dec 28 12:18:46 2010	(r216759)
@@ -742,8 +742,11 @@ dummynet_io(struct mbuf **m0, int dir, s
 	}
 
 	/* compute the initial allowance */
-	{
+	if (si->idle_time < dn_cfg.curr_time) {
+	    /* Do this only on the first packet on an idle pipe */
 	    struct dn_link *p = &fs->sched->link;
+
+	    si->sched_time = dn_cfg.curr_time;
 	    si->credit = dn_cfg.io_fast ? p->bandwidth : 0;
 	    if (p->burst) {
 		uint64_t burst = (dn_cfg.curr_time - si->idle_time) * p->bandwidth;


More information about the svn-src-all mailing list