From owner-freebsd-net@FreeBSD.ORG Sun Oct 28 18:47:27 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 53E5C9AC; Sun, 28 Oct 2012 18:47:27 +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 0C5808FC08; Sun, 28 Oct 2012 18:47:26 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so3048602pad.13 for ; Sun, 28 Oct 2012 11:47:20 -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=Uyu1GfMmsLFdHsUeepQuWFMxIMEaPlhKJe3xCbvoO/0=; b=NeBVJUdrVroRgG8R9oeJCGPPSojOMtVuny/gnU7yf+9gpcbQc8me6BK4kn5hWeU6pH /ipXsyiQwQxEHpPV1cS2pCnm5e690avJNfgPN0PyPol677KDqlIaOnzjXIVu0OpiHzoo 9Vd62e+yjjruIKU4OLO//FPry2CASvj+rbEv4CO5PqLla8ssl6CPNB7Itg82GSMU5Mfg xneFGSZSuknK6EI84Aj2WblaGHIkxTVZkUT9jNQe9YXwf6QXS/cqqOZtsXt9NUTZOten XMoLKd9EDXJyE5OoNN6sz/RNYX9LdDFBQxjZ+l/GF1BukJgTeRcAlHefH5AthQ30liYi i1kg== MIME-Version: 1.0 Received: by 10.66.74.65 with SMTP id r1mr77519338pav.75.1351450040374; Sun, 28 Oct 2012 11:47:20 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.146.233 with HTTP; Sun, 28 Oct 2012 11:47:20 -0700 (PDT) In-Reply-To: References: <201210222317.00457.zec@fer.hr> <201210230916.11513.zec@fer.hr> Date: Sun, 28 Oct 2012 11:47:20 -0700 X-Google-Sender-Auth: LkNEQCp-lyJMnxLbuq-53mUk1wo Message-ID: Subject: Re: VIMAGE crashes on 9.x with hotplug net80211 devices From: Adrian Chadd To: Marko Zec , Hans Petter Selasky 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, 28 Oct 2012 18:47:27 -0000 ping? Marko - would you be willing to add the if_free() vnet context setup into -HEAD? Hans, what do you think about USB device attach? detach will be covered by the above (I hope!) but we still need to do a CURVNET_SET(vnet0); during hotplug attach. Thanks, Adrian On 23 October 2012 10:37, Adrian Chadd wrote: > On 23 October 2012 00:16, Marko Zec wrote: > >> As already mentioned earlier, I don't terribly object if you'd place >> CURVNET_SET(ifp->if_vnet) inside if_free() and a limited number of similar >> functions, but I don't quite believe this is will enough to solve the >> device_detach() issue without having to touch any of the drivers... > > That's why I'm asking for more/better ideas. > > So far my ideas are: > > * for hotplug insert - do the same as what you're doing during the > kldload and boot device enumeration pass - call CURVNET_SET(vnet0) > * for device unload (hotplug or otherwise) - if vnet isn't set, > implicitly set it to vnet0 > * for the net80211 vaps, they get destroyed in a few places (ioctl > path, device detach path, I'm sure I saw one more) so I have to use > CURVNET_SET(ifp->if_vnet) on those. > > Now, that _should_ fix it for ath(4) and net80211, and it should fix > it for all the other non-USB wireless devices out there. > > Now as for USB - Hans, what do you think? Should we do something > similar? How does VIMAGE work right now with USB wireless and USB > ethernet devices? > > Marko - thanks for persisting with this. I'd like to try and make this > work for 10.0. > > > > Adrian