Author: oleg
Date: Tue Dec 28 11:34:59 2010
New Revision: 216757
URL: http://svn.freebsd.org/changeset/base/216757

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

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

Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_dn_io.c        Tue Dec 28 10:08:50 2010        
(r216756)
+++ stable/8/sys/netinet/ipfw/ip_dn_io.c        Tue Dec 28 11:34:59 2010        
(r216757)
@@ -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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to