From owner-freebsd-net@FreeBSD.ORG Sun Oct 21 19:50:22 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A17DCBC; Sun, 21 Oct 2012 19:50:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 44A428FC0A; Sun, 21 Oct 2012 19:50:22 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so1492586pad.13 for ; Sun, 21 Oct 2012 12:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8icWhKDQHJZo3nR717X8mO226QO0XOxuOhFYFv4NUXw=; b=bKELu/o9MBLt3z3wPDcEhBn/iLTZfVmP5IcAucLOfziF9SX+/f1pV+Uq505fz+7wk7 CuQM0VMw5KhUi14zEGj+v8fTOzJj03zSBr+lsBd2sMOraNoGlltr0P2csryaefiklaNe qVkaDzpx926wh4V5Zf4bZfZd/6nLYnSGPxoTJXc1w4HwHYJXhMnySMmAelA7EDd9R5D7 +si9YY0OABwxuXOlcMEuZ3X5XjZf2sMyuHIsxnfIqO/iKox660j+R1c9DN1hYa1ltxVB CpUCeiYL9cgVoJM6zi9djR4xHVtMtKN3RH3m+kmsf9lAM25IX6d9TshG0GdQ64fcBRmn 77kA== MIME-Version: 1.0 Received: by 10.68.223.37 with SMTP id qr5mr24128191pbc.101.1350849021773; Sun, 21 Oct 2012 12:50:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Sun, 21 Oct 2012 12:50:21 -0700 (PDT) In-Reply-To: <201210212136.12788.zec@fer.hr> References: <201210212136.12788.zec@fer.hr> Date: Sun, 21 Oct 2012 12:50:21 -0700 X-Google-Sender-Auth: aK8bDgxtAYk1X4HI0zO1NPKCO-I Message-ID: Subject: Re: VIMAGE crashes on 9.x with hotplug net80211 devices From: Adrian Chadd To: Marko Zec Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 19:50:22 -0000 On 21 October 2012 12:36, Marko Zec wrote: > The right approach would be to do a single CURVNET_SET(vnet0) / > CURVNET_RESTORE() somewhere near the root of the call graph being triggered > by the hotplug attach event. Not having any hotpluggable hardware at hand > I cannot be more specific where that place could be... Right; would that be at the net80211 side, or something higher up (eg at device_attach, which gets called from the cardbus/pci bridge enumeration code.) > But most certainly doing CURVNET_SET(vnet0) on detach events would be wrong: > since ifnets may be assignet to non-default vnets, > CURVNET_SET(ifp->if_vnet) should be more appropriate there. Thanks for that. I'll look at adding that in my next debug pass. > Another thing that may help could be turning on options VNET_DEBUG when, as > that should reveal excessive (and probably redundant) CURVNET_SET() > recursions. I've spotted a couple, however the crashing here is the important bit. :-) So - why is it that the V_* variables are NULL pointers at this stage? I thought the kernel would've been running with a default vnet context of vnet0? Why doesn't this impact other network device hotplugging? Or does it, and noone noticed? Adrian