diff options
author | luigi <luigi@FreeBSD.org> | 2010-09-29 09:22:12 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2010-09-29 09:22:12 +0000 |
commit | 27b07fc73139e6943e19da7f4f40142d140074ee (patch) | |
tree | 715863a15fedabc47f98bd3a535223f2d2e19dec /sys/netinet | |
parent | bcef52d3bf9cd91b2bbfb0c4ba9bcb140e15bb59 (diff) | |
download | FreeBSD-src-27b07fc73139e6943e19da7f4f40142d140074ee.zip FreeBSD-src-27b07fc73139e6943e19da7f4f40142d140074ee.tar.gz |
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: 147245 148429
Obtained from: Riccardo Panicucci
MFC after: 3 days
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ipfw/ip_dn_io.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/ipfw/ip_dn_io.c b/sys/netinet/ipfw/ip_dn_io.c index 152010e..162240d 100644 --- a/sys/netinet/ipfw/ip_dn_io.c +++ b/sys/netinet/ipfw/ip_dn_io.c @@ -752,8 +752,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; |