From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 22 00:40:30 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 761C516A4CE for ; Fri, 22 Oct 2004 00:40:30 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5346743D4C for ; Fri, 22 Oct 2004 00:40:30 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9M0eUNB022725 for ; Fri, 22 Oct 2004 00:40:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9M0eUIH022724; Fri, 22 Oct 2004 00:40:30 GMT (envelope-from gnats) Resent-Date: Fri, 22 Oct 2004 00:40:30 GMT Resent-Message-Id: <200410220040.i9M0eUIH022724@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Engelhart Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A874D16A4CE for ; Fri, 22 Oct 2004 00:32:48 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A44243D2F for ; Fri, 22 Oct 2004 00:32:48 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9M0WmDW096217 for ; Fri, 22 Oct 2004 00:32:48 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i9M0WmRT096215; Fri, 22 Oct 2004 00:32:48 GMT (envelope-from nobody) Message-Id: <200410220032.i9M0WmRT096215@www.freebsd.org> Date: Fri, 22 Oct 2004 00:32:48 GMT From: John Engelhart To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/72987: ipfw/dummynet pipe/queue 'queue [BYTES]KBytes (red|gred) [FLOAT]/[BYTES]/[BYTES]/[FLOAT]' parameter problem X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Oct 2004 00:40:30 -0000 >Number: 72987 >Category: kern >Synopsis: ipfw/dummynet pipe/queue 'queue [BYTES]KBytes (red|gred) [FLOAT]/[BYTES]/[BYTES]/[FLOAT]' parameter problem >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 22 00:40:29 GMT 2004 >Closed-Date: >Last-Modified: >Originator: John Engelhart >Release: 5.3-BETA7 >Organization: >Environment: FreeBSD new.zang.com 5.3-BETA7 FreeBSD 5.3-BETA7 #0: Sun Oct 17 00:32:33 EDT 2004 johne@new.zang.com:/usr/src/sys/i386/compile/new i386 >Description: While testing some ipfw/dummynet configurations, I ran in to a problem with the "queue #KBytes" with either red or gred MIN and MAX specification parameter. I'm not sure if this is a display only bug, or if the display artifact is due to a more fundamental problem. In summary, there are four parameters passed to either red or gred, ie "red 1.0/2/3/4.0". Of concern is parameters 2 and 3. When the "queue" parameter is specified, it can be specified in one of two ways: in "slots" (packets), or in total number of bytes (#KBytes). The #2 and #3 RED parameters are either the min/max specified in number of slots, or the min/max specified in number of bytes. This only happens when the queue parameter is specified in KBytes. If you specify more than 2^15 as a value for red/gred MIN or MAX, no error is given that a parameter maximum has been exceeded. However, when checking the pipe configuration with an "ipfw pipe show", the value displayed is not the value specified. Thus, specifying a red/gred MIN or MAX > 32767 results in a "ipfw pipe show" as if the parameter were a signed 16 bit value, and not the value entered. I haven't dug in to the code, nor done any exhastive tests, but watching some of the results I got the impression that the values being used by the kernel to do at least the MAX calculations were the truncated values, and not the specified ones. >How-To-Repeat: # ipfw pipe 10 config bw 320Kbit/sec queue 512KBytes gred 0.1/4096/131072/0.1 # ipfw pipe 10 show 00010: 320.000 Kbit/s 0 ms 512 KB 1 queues (1 buckets) GRED w_q 0.099991 min_th 4096 max_th 0 max_p 0.099991 mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000 Note the "max_th 0" is not 131072. Wrapped value: # ipfw pipe 10 config bw 320Kbit/sec queue 512Kbytes gred 0.1/4096/32768/0.1 # ipfw pipe 10 show 00010: 320.000 Kbit/s 0 ms 512 KB 1 queues (1 buckets) GRED w_q 0.099991 min_th 4096 max_th -32768 max_p 0.099991 mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000 BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp "max_th" now at -32768. >Fix: Unknown. Not sure if this is display only, or a bigger problem. Wanted to get it logged first, and I figure an ipfw maintainer can make a faster pass at what the real problem is than I can since it's a pretty obvious bug. >Release-Note: >Audit-Trail: >Unformatted: