From owner-freebsd-net@FreeBSD.ORG Tue Jul 4 18:47:59 2006 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 C223016A4DE; Tue, 4 Jul 2006 18:47:59 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9F7143D7E; Tue, 4 Jul 2006 18:47:52 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [192.168.2.4]) ([10.251.60.37]) by a50.ironport.com with ESMTP; 04 Jul 2006 11:47:51 -0700 Message-ID: <44AAB7D5.5010609@elischer.org> Date: Tue, 04 Jul 2006 11:47:49 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <44A40C25.904@elischer.org> <20060630115749.G3964@fledge.watson.org> <20060703202803.GA22556@odin.ac.hmc.edu> <20060704.102539.-494099438.imp@bsdimp.com> In-Reply-To: <20060704.102539.-494099438.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: yar@comp.chem.msu.su, src-committers@freebsd.org, rwatson@freebsd.org, freebsd-net@freebsd.org Subject: Re: cvs commit: src/sys/net if_vlan.c 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: Tue, 04 Jul 2006 18:47:59 -0000 M. Warner Losh wrote: >In message: <20060703202803.GA22556@odin.ac.hmc.edu> > Brooks Davis writes: >: and act as though the interface is not there. We could then consider >: either holding the interface for a configurable or computed length >: of time or adding some sort of refcounting (probably impractical). > >Refcounting would be good for the 'macro' things (coming and going) >that are infrequent, but we might have mulitple people doing. You are >right it likely is too inefficient to do with mbugs. One other option >might be to have a configurable time after the last time that it was >accessed via the 'safe' routines that were setup. This way we'd tie >the removal of the interface to a period of time after it was last >used, rather than after it was removed. I don't know if such a >difference would matter much in practice. > >The only other 'issue' that I see with this approach is if I remove a >card, and then insert it again before the timeout happens. Does that >card get a new interface name? And would people care or not... > > As I mentionned earlier, the mbuf references are not always used. They are mainly used for ipfw and friends but are not always used (from memory) on every packet in the receive path. In this case it may be as well to have an indirect reference tha can be checked for validity each time.. e.g. ifnum. it wouldn't be too much to keep the ifnum slots around for a period after the interfaces are destroyed. (and marked invalid), or in tha case of a hash, failure to find it would suggest that is is invalid. >Warner > >