Date: Wed, 29 Sep 2010 09:22:12 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r213265 - head/sys/netinet/ipfw Message-ID: <201009290922.o8T9MCuJ002871@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Wed Sep 29 09:22:12 2010 New Revision: 213265 URL: http://svn.freebsd.org/changeset/base/213265 Log: 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 Modified: head/sys/netinet/ipfw/ip_dn_io.c Modified: head/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netinet/ipfw/ip_dn_io.c Wed Sep 29 09:20:18 2010 (r213264) +++ head/sys/netinet/ipfw/ip_dn_io.c Wed Sep 29 09:22:12 2010 (r213265) @@ -752,8 +752,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009290922.o8T9MCuJ002871>