From nobody@FreeBSD.org  Wed Jul  7 15:22:38 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 809481065675
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Jul 2010 15:22:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 702278FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Jul 2010 15:22:38 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o67FMcwx008497
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 7 Jul 2010 15:22:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o67FMbm6008496;
	Wed, 7 Jul 2010 15:22:37 GMT
	(envelope-from nobody)
Message-Id: <201007071522.o67FMbm6008496@www.freebsd.org>
Date: Wed, 7 Jul 2010 15:22:37 GMT
From: Paul-Andrew Joseph Miseiko <Paul_Miseiko@rapid7.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net.inet.ip.dummynet.io_fast broken or documentation incomplete.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         148429
>Category:       kern
>Synopsis:       net.inet.ip.dummynet.io_fast broken or documentation incomplete.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    luigi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 07 15:30:03 UTC 2010
>Closed-Date:    Tue Dec 28 12:23:37 UTC 2010
>Last-Modified:  Tue Dec 28 12:23:37 UTC 2010
>Originator:     Paul-Andrew Joseph Miseiko
>Release:        8.0-STABLE
>Organization:
>Environment:
FreeBSD teardrop.ca 8.0-STABLE FreeBSD 8.0-STABLE #0: Tue Apr 27 10:28:56 EDT 2010     esoteric@teardrop.ca:/usr/obj/usr/src/sys/TEARDROP  i386
>Description:
The IPFW manual page TRAFFIC SHAPER (DUMMYNET) CONFIGURATION section stated The ``fast'' mode allows certain packets to bypass the dummynet scheduler (if packet flow does not exceed pipe's bandwidth).

The statement is false when a queue is used and multiple flows are present.  The combined bandwidth of each flow can exceed the pipe bandwidth.

The statement is true when a queue is used and a single flow is present.
>How-To-Repeat:
sysctl net.inet.ip.dummynet.io_fast=1

ipfw pipe 1 config bw 4096kbit/s
ipfw queue 1 config pipe 1 mask dst-ip 0xffffffff

ipfw add queue 1 pass all from any to any

--- transmit data with multiple flows (connections) ---

The destination IP address used to reproduce this issue was the same.  Different destination IP addresses have not been used to reproduce this issue at this time but might exhibit the same behavior.
>Fix:
sysctl net.inet.ip.dummynet.io_fast=0

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-ipfw 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Jul 8 06:04:14 UTC 2010 
Responsible-Changed-Why:  
reassign to ipfw team 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148429 
Responsible-Changed-From-To: freebsd-ipfw->oleg 
Responsible-Changed-By: oleg 
Responsible-Changed-When: Tue Aug 17 17:06:28 UTC 2010 
Responsible-Changed-Why:  
i'll look at it. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=148429 
Responsible-Changed-From-To: oleg->luigi 
Responsible-Changed-By: oleg 
Responsible-Changed-When: Mon Sep 13 15:06:36 UTC 2010 
Responsible-Changed-Why:  
It seems this is same bug as in kern/147245. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=148429 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148429: commit references a PR
Date: Wed, 29 Sep 2010 09:22:23 +0000 (UTC)

 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;
 _______________________________________________
 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-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148429: commit references a PR
Date: Tue, 28 Dec 2010 11:35:14 +0000 (UTC)

 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-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148429: commit references a PR
Date: Tue, 28 Dec 2010 12:18:55 +0000 (UTC)

 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;
 _______________________________________________
 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-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: oleg 
State-Changed-When: Tue Dec 28 12:23:20 UTC 2010 
State-Changed-Why:  
Patch commited to RELENG_8 & RELENG_8_2. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=148429 
>Unformatted:
