From owner-freebsd-net@FreeBSD.ORG Sat Jul 30 19:38:37 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4C7C16A41F; Sat, 30 Jul 2005 19:38:37 +0000 (GMT) (envelope-from julian@elischer.org) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 733BE43D46; Sat, 30 Jul 2005 19:38:37 +0000 (GMT) (envelope-from julian@elischer.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id E85C6209188; Sat, 30 Jul 2005 12:38:36 -0700 (PDT) Received: from [192.168.2.3] (home.elischer.org [216.240.48.38]) by idiom.com (8.12.11/8.12.11) with ESMTP id j6UJcZ7i001018; Sat, 30 Jul 2005 12:38:36 -0700 (PDT) (envelope-from julian@elischer.org) Message-ID: <42EBD738.2010105@elischer.org> Date: Sat, 30 Jul 2005 12:38:32 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050424 X-Accept-Language: en, hu MIME-Version: 1.0 To: "Daniel O'Connor" References: <200507290834.10268.doconnor@gsoft.com.au> <42E99CFD.6070803@elischer.org> <200507301900.32660.doconnor@gsoft.com.au> <200507310056.21857.doconnor@gsoft.com.au> In-Reply-To: <200507310056.21857.doconnor@gsoft.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: AltQ + ng_iface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2005 19:38:37 -0000 Daniel O'Connor wrote: > On Saturday 30 July 2005 19:00, Daniel O'Connor wrote: > >>I'll try my hand at the ng_iface ALTQ patch. > > > Here's what I have so far.. > > http://www.dons.net.au/~darius/ng_iface-altq.diff > > Haven't done much testing yet though. small comments so far.. mbuf tags have "families" so that differetn modules can use the same ID numbers and not clash. here is a netgraph family for tags, using the netgraph cookies. It's been a while since I looked at it but if you are using mbuf tags in netgraph you should check out the netgraph tag facilities. If you queue data to be send over a hook you must have the data hold a reference on the hook to ensure that the hook is not removed while your packet is in teh queue. Similarly either the packet holds a reference on teh node as well, or the node must lock it's queue and remove all packets when shut down. I see that you don't actually decid eon what hook will be used until later so teh reference to teh hook needn't be done, but you haven't added any code to either hold a reference on the node, or to clean the queue on shutdown. (or is that done automatically by some iface base code that is called during shutdown). The calling code must always have a reference on the node to ensure that it is not removed while it is running in it. This is sometimes done automatically. This is why there is an ng_callout facility to ensure that the locking andreferences are done automatically and correctly. I would also want to have the altq optional.. in other words I'd want a control message to ng_iface that could make it act as before. >