From owner-freebsd-net@FreeBSD.ORG Sat Oct 22 10:15:07 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 E2F1916A41F; Sat, 22 Oct 2005 10:15:07 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E986B43D48; Sat, 22 Oct 2005 10:15:06 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.12.10/8.12.9) with ESMTP id j9MAY6aq026168; Sat, 22 Oct 2005 10:34:06 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.12.10/8.12.9/Submit) id j9MAY588026167; Sat, 22 Oct 2005 10:34:05 GMT (envelope-from dunstan) Date: Sat, 22 Oct 2005 10:34:05 +0000 From: "Wojciech A. Koszek" To: Andrew Thompson Message-ID: <20051022103404.GA26148@freebsd.czest.pl> References: <20051020202034.GA4556@freebsd.czest.pl> <20051020202327.GA53753@heff.fud.org.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051020202327.GA53753@heff.fud.org.nz> 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: Sat, 22 Oct 2005 10:15:08 -0000 On Fri, Oct 21, 2005 at 09:23:27AM +1300, Andrew Thompson wrote: > 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? > Thanks, it seems to work just fine. I've tested it with earlier versions. I'll probably have to play with EVENTHANDLER to fix ef(4). -- * Wojciech A. Koszek && dunstan@FreeBSD.czest.pl