From owner-freebsd-ipfw@FreeBSD.ORG Mon Aug 23 18:42:54 2004 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7D6216A4CE; Mon, 23 Aug 2004 18:42:54 +0000 (GMT) Received: from shellma.zin.lublin.pl (shellma.zin.lublin.pl [212.182.126.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 283BA43D2D; Mon, 23 Aug 2004 18:42:54 +0000 (GMT) (envelope-from pawmal-posting@freebsd.lublin.pl) Received: by shellma.zin.lublin.pl (Postfix, from userid 1018) id 3EFFF347BA8; Mon, 23 Aug 2004 20:40:51 +0200 (CEST) Date: Mon, 23 Aug 2004 20:40:51 +0200 From: Pawel Malachowski To: Pawel Jakub Dawidek Message-ID: <20040823184051.GC42452@shellma.zin.lublin.pl> References: <20040811163426.E06283474C2@shellma.zin.lublin.pl> <20040823165718.GQ30151@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040823165718.GQ30151@darkness.comp.waw.pl> User-Agent: Mutt/1.4.2i cc: freebsd-ipfw@freebsd.org cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/70311: ipfw(8) pipe/queue show N displays data not only for N X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2004 18:42:54 -0000 On Mon, Aug 23, 2004 at 06:57:18PM +0200, Pawel Jakub Dawidek wrote: > This patch doesn't work for me as expected. It shows all pipes and queues > with parentpipe=N. > Could you check this patch (it is against -CURRENT, but it should be easy > to apply it to 4.x): Weird. For me, Your patch gives on my working RELENG_4 shaper setup: % ipfw pipe show 1 00001: unlimited 0 ms 12 KB 0 queues (1 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000 q00110: weight 1 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 q00120: weight 99 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 // expected, show pipe 1 and every queue with parent=1 % ipfw queue show 1 00001: unlimited 0 ms 12 KB 0 queues (1 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000 // not expected, there is no queue 1, but it shows pipe 1 here. // if I want pipe 1, I would type ipfw pipe show 1 % ipfw pipe show 110 // expected, there is no pipe 110 % ipfw queue show 110 q00110: weight 1 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 // expected, there is queue 110. > Index: ipfw2.c > =================================================================== > RCS file: /private/FreeBSD/src/sbin/ipfw/ipfw2.c,v > retrieving revision 1.54 > diff -u -p -r1.54 ipfw2.c > --- ipfw2.c 12 Aug 2004 22:06:55 -0000 1.54 > +++ ipfw2.c 23 Aug 2004 16:51:26 -0000 > @@ -1564,6 +1564,12 @@ list_pipes(void *data, uint nbytes, int > l = sizeof(*fs) + fs->rq_elements * sizeof(*q); > next = (char *)fs + l; > nbytes -= l; > + > + if (rulenum != 0 && ((rulenum != fs->fs_nr && do_pipe == 2) || > + (rulenum != fs->parent_nr && do_pipe == 1))) { > + continue; > + } > + > q = (struct dn_flow_queue *)(fs+1); > sprintf(prefix, "q%05d: weight %d pipe %d ", > fs->fs_nr, fs->weight, fs->parent_nr); > > Basically, it looks that first addition of 'do_pipe==2' is bogus. Well, with this first 'do_pipe==2' check it works here like this: % ipfw pipe show 1 00001: unlimited 0 ms 12 KB 0 queues (1 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000 q00110: weight 1 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 q00120: weight 99 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 // expected, shows pipe 1 and every queue with parent=1 % ipfw queue show 1 // expected, there is no queue 1 % ipfw pipe show 110 // expected, there is no pipe 110 % ipfw queue show 110 q00110: weight 1 pipe 1 8 KB 0 queues (512 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0xffffffff/0x0000 // expected, there is queue 110 So, for me it is not bogus. :) cheers, -- Paweł Małachowski