From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 22 17:29:39 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93130107; Mon, 22 Oct 2012 17:29:39 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5AADB8FC08; Mon, 22 Oct 2012 17:29:39 +0000 (UTC) Received: from JRE-MBP-2.local (c-50-143-149-146.hsd1.ca.comcast.net [50.143.149.146]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q9MHTXVA083302 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 22 Oct 2012 10:29:34 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5085827D.5090108@freebsd.org> Date: Mon, 22 Oct 2012 10:29:33 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: VIMAGE crashes on 9.x with hotplug net80211 devices References: <201210212322.48791.zec@fer.hr> <201210221208.37592.zec@fer.hr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Marko Zec , freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 17:29:39 -0000 On 10/22/12 7:12 AM, Adrian Chadd wrote: > On 22 October 2012 03:08, Marko Zec wrote: > >> The only option I can think of now is to update all of the hotunpluggable >> device_detach() handlers to do CURVNET_SET(ifp->if_vnet) before calling >> further down into the networking stack, because as you already observed, >> whatever triggers a device_detach() handler is not aware of the nature of >> the driver. > Right. Well, since most things are in theory hotpluggable these days > (or soon will be, with pcie hotplug), I think we need a slightly more > generic solution. > >>> (how the hell does this work for devices attached at probe time? What >>> vnet context do they have, and why doesn't the kernel panic there?) >> Because at boot / autoconfiguration time curvnet is implicitly set to vnet0 >> between SI_SUB_VNET and SI_SUB_VNET_DONE (i.e. before going SMP). >> >> Similarly, curvnet is set to vnet0 during kldload events. > .. like this. > > The trouble is going to be handling unplug and kldunload events too. > Does curvnet -> vnet0 during kldunload events? I think in unload events we probably need to cycle through all vnets and do individual shutdowns of anything that is set up on that vnet.. (but I'm not reading the code to say that, it's possible to ignore me safely) > > Thanks, > > > > Adrian > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >