From nobody@FreeBSD.org  Wed Jun 15 14:09:47 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2A46516A41C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Jun 2005 14:09:47 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1826743D55
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Jun 2005 14:09:47 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j5FE9kco071111
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Jun 2005 14:09:46 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j5FE9kdW071095;
	Wed, 15 Jun 2005 14:09:46 GMT
	(envelope-from nobody)
Message-Id: <200506151409.j5FE9kdW071095@www.freebsd.org>
Date: Wed, 15 Jun 2005 14:09:46 GMT
From: Sebastian Koehler <acex5@syncer.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cbq scheduler cause bad latency
X-Send-Pr-Version: www-2.3

>Number:         82271
>Category:       kern
>Synopsis:       [pf] cbq scheduler cause bad latency
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-pf
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 15 14:10:05 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Jul 23 03:28:35 GMT 2005
>Originator:     Sebastian Koehler
>Release:        5.4-STABLE
>Organization:
>Environment:
FreeBSD icecube.thrillkill.lan 5.4-STABLE FreeBSD 5.4-STABLE #10: Fri Jun 10 13:52:40 CEST 2005     acex5@icecube.thrillkill.lan:/usr/obj/usr/src/sys/ICECUBE  i386
>Description:
The following altq rule cause a bad latency from all internal clients using my router.

altq on $int_if cbq    bandwidth 2Mb queue { std_in, wow_in }
  queue std_in         bandwidth 128Kb priority 1 cbq(default)
  queue wow_in         bandwidth 1920Kb priority 4 { wow_std_in, wow_pri_in }
    queue wow_std_in   bandwidth 1792Kb priority 4 cbq(borrow)
    queue wow_pri_in   bandwidth 128Kb  priority 7 cbq(borrow)

This effect only occurs, when the internal interface is used. If I use priq on internal interface, latency looks good, too.

altq on $ext_if priq bandwidth 2Mb queue { std_out, wow_std_out, wow_pri_out }
  queue std_out priq(default)
  queue wow_std_out priority 5 priq(red)
  queue wow_pri_out priority 6

Without cbq rule on internal interface:
Antwort von 66.249.85.99: Bytes=32 Zeit=17ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=16ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=18ms TTL=247

With cbq rule on internal interface:
Antwort von 66.249.85.99: Bytes=32 Zeit=16ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=18ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=17ms TTL=247

With cbq rule on internal interface and traffic from an internal client (http, online stream etc.)
Antwort von 66.249.85.99: Bytes=32 Zeit=1619ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=4029ms TTL=247
Antwort von 66.249.85.99: Bytes=32 Zeit=1979ms TTL=247

The issue doesn't seems to be architecture related, cause the issue happen on FreeBSD 5.4-STABLE on Sparc64, too.
>How-To-Repeat:
Load the altq rule into pf. Create traffic from an internal client and check latency from same or other host.
>Fix:
n/a
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-pf 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Mon Jun 20 08:59:48 GMT 2005 
Responsible-Changed-Why:  
For pf gurus review. 

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