From owner-freebsd-stable@FreeBSD.ORG Tue Jan 11 16:27:49 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8F2D16A4CE for ; Tue, 11 Jan 2005 16:27:49 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CD3043D48 for ; Tue, 11 Jan 2005 16:27:49 +0000 (GMT) (envelope-from jsimola@gmail.com) Received: by wproxy.gmail.com with SMTP id 58so343663wri for ; Tue, 11 Jan 2005 08:27:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=n/YzQrqwEjrF9VAvMVIAoAtPI3hW10o+vrh2EzqfUN6/gKoLjHMvhsWLE33tU+exMFeG19CeWHHwdsXyuLjom2DwfomWftf6tiULThqLCqwYVLf7kFyj4nTwqDDd/nJrYuEKThZFT1GZBJkaAJ/qX3I2wLakV354aQ5O7hWy1xc= Received: by 10.54.45.51 with SMTP id s51mr533678wrs; Tue, 11 Jan 2005 08:27:48 -0800 (PST) Received: by 10.54.39.34 with HTTP; Tue, 11 Jan 2005 08:27:48 -0800 (PST) Message-ID: <8eea0408050111082762f6791a@mail.gmail.com> Date: Tue, 11 Jan 2005 08:27:48 -0800 From: Jon Simola To: freebsd-stable@freebsd.org, Brooks Davis In-Reply-To: <20050105205156.GB16655@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <8eea040805010512321bf5b953@mail.gmail.com> <20050105205156.GB16655@odin.ac.hmc.edu> Subject: Re: ALTQ patch for if_vlan.c X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jon@abccomm.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2005 16:27:49 -0000 On Wed, 5 Jan 2005 12:51:56 -0800, Brooks Davis wrote: > ALTQ makes no sense of virtual interfaces. ALTQ works by providing > fine-grained control of the dequeueing of packets on to the wire. It's > too early to do this when you're still in the virtual interface. PF does not have any access to traffic on the vlan parent interface. By my reading of the source, outbound traffic -> PF -> vlan -> ether_output on the parent This seems accurate as there are no packets leaving on the vlan parent (em1 in my case): bash-3.00# pfctl -vvs rules @0 pass in quick on em1 all [ Evaluations: 749738 Packets: 0 Bytes: 0 States: 0 ] @1 pass out quick on em1 all [ Evaluations: 0 Packets: 0 Bytes: 0 States: 0 ] I've had this patch running for a few hours now and it certainly seems to accomplish what I was looking to do (throttle DSL customers at my router): # pfctl -vs rules pass out quick on vlan130 from any to keep state queue throttle_130 [ Evaluations: 249230 Packets: 6552 Bytes: 2443357 States: 554 ] # pfctl -vs queue queue throttle_130 bandwidth 64Kb cbq( red ) [ pkts: 1062 bytes: 348272 dropped pkts: 1588 bytes: 870884 ] [ qlength: 18/ 50 borrows: 0 suspends: 105 ] [ measured: 23.2 packets/s, 55.08Kb/s ] > You can tag packets appropiratly at this point, but the actual ALTQ queue > needs to be on a physical interface. I don't see any way to accomplish this, and my experimenting has been in vain until I patched ALTQ into if_vlan. > FYI, spl*() funtions are all no-ops now. We just have them around to > remind us that we need to lock certain functions and to document what > was protected before. Thanks, good to know. I'm learning a lot about the kernel as I go.