On 22 October 2012 03:08, Marko Zec <z...@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
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to