From owner-freebsd-net@FreeBSD.ORG Thu Oct 20 20:23:28 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 B994F16A41F for ; Thu, 20 Oct 2005 20:23:28 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: from heff.fud.org.nz (60-234-149-201.bitstream.orcon.net.nz [60.234.149.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 445C243D62 for ; Thu, 20 Oct 2005 20:23:28 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id 0D9611CCDD; Fri, 21 Oct 2005 09:23:27 +1300 (NZDT) Date: Fri, 21 Oct 2005 09:23:27 +1300 From: Andrew Thompson To: "Wojciech A. Koszek" Message-ID: <20051020202327.GA53753@heff.fud.org.nz> References: <20051020202034.GA4556@freebsd.czest.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051020202034.GA4556@freebsd.czest.pl> User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: Re: Dependency between interfaces 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: Thu, 20 Oct 2005 20:23:28 -0000 On Thu, Oct 20, 2005 at 08:20:34PM +0000, Wojciech A. Koszek wrote: > Hello, > > Is EVENTHANDLER(9) proper way of notification for standalone driver about > network interface attach/detach operations? I've met simple problem in > ef(4), which causes machine freeze in following situation: load NIC driver > -> load if_ef -> unload NIC driver -> some activity with interface. > Althought driver of network interface no longer exists, if_ef does not know > about it and continues it's operation. > > I've seen similar situation for example in ng_fec(4): piece of code needs to > call some cleanup routines in order to keep pointers in valid state. I think > this situation is almost the same like this current in if_bridge(4). Just > repeat situation described above for ef(4), but with if_bridge(4). > if_bridge(4) now hooks into ether_detach to get notified of a vanishing interface, as of r1.26 (and now in RELENG_6*) Use bridge_ifdetach() to notify the bridge that a member has been detached. The bridge can then remove it from its interface list and not try to send out via a dead pointer. Is it still a problem or did you test on a pre r1.26 kernel? Andrew