Re: Devd event from GEOM?

From: Warner Losh <imp_at_harmony.village.org>
Date: Tue, 25 Jan 2005 09:55:36 -0700 (MST)
> > Since we added /dev/net/* we have sort of collapsed the split we
> > previously had where some devices did not appear in /dev. 
> 
> The net device nodes were added for one purpose: to allow Kqueue to attach
> to a network interface, as kqueue requires a file descriptor.  And most of
> the network developers I've talked to think this was probably a design
> error.  Note that the network stack has a fairly complex event system
> already -- routing sockets, which express a spectrum of network-related
> events including, but not limited to, interfaces appearing and
> disappearing.  Adding /dev/net entries added multiple paths to the same
> ioctl() mechanism, complicated the network interface allocation path
> substantially (introducing more races), etc.  I'd much prefer we got rid
> of them, if we can.

And for the network case there's a lot more interesting than 'the
device is there'.  I want to only run dhclient on interfaces that have
carrier, are in this ssid, etc.  This information is presented via the
routing sockets, but not via the device.

> We have all the information in the kernel ("I found a device", "it was a
> SCSI disk", "and we can store bytes on it!", "and it has partitions!") --
> that we're not exposing it to user space means that we're doing far too
> good a job of hiding quite accessible information.  If the information is
> bundled up neatly for delivery so that the layer relationships are clear
> -- fine, although I don't think that will be possible in every case (i.e.,
> da0 arriving in newbus and GEOM may be simultaenous, but we might not have
> finished probing da0s1a.foobar for quite a bit later).

I's suspect that da0 would arrive in GEOM before newbus.  newbus
generates its arriveal events after the device has completed its
attachment.  Part of the attachment is to add it to GEOM.  This may or
may not be done asynchronously to the newbus addition.  Network
adapters are done synchronously in our present implementation, so by
the time the newbus attach finishes, the network interfaces in the
network namespace are necessarily available (assuming they haven't
just disappeared).

The problem I see with exporting GEOM events is that you still need
some kind of smarts on the receiving end to know if you are dealing
with an interesting GEOM thing, or an uninteresting one...

Warner
Received on Tue Jan 25 2005 - 15:56:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC