From 44280a2fdbd6b57013a5731c21e4528ab745388a Mon Sep 17 00:00:00 2001 From: oleg Date: Tue, 28 Dec 2010 12:18:46 +0000 Subject: [PATCH] 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) git-svn-id: svn://svn.freebsd.org/base/releng/8.2@216759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet/ipfw/ip_dn_io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ipfw/ip_dn_io.c b/sys/netinet/ipfw/ip_dn_io.c index eab9d9e0..2e9867eb 100644 --- a/sys/netinet/ipfw/ip_dn_io.c +++ b/sys/netinet/ipfw/ip_dn_io.c @@ -742,8 +742,11 @@ dummynet_io(struct mbuf **m0, int dir, struct ip_fw_args *fwa) } /* 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; -- 2.42.0