VIMAGE crashes on 9.x with hotplug net80211 devices

Adrian Chadd adrian at freebsd.org
Mon Oct 22 14:12:58 UTC 2012


On 22 October 2012 03:08, Marko Zec <zec at fer.hr> 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?

Thanks,



Adrian


More information about the freebsd-hackers mailing list