On Thu, Apr 24, 2008 at 3:27 PM, Andrew Gallatin <[EMAIL PROTECTED]> wrote: > > Garrett D'Amore writes: > > Andrew Gallatin wrote: > > > If I move a device (NIC) around in a Solaris machine, it takes > > > on a new name (foo0 becomes foo1 becomes foo2, for example) > > > each time I move it. > > > > > > Can somebody tell me where / how the numbers are assigned? How do I > > > reset them back to zero? > > > > > > > Instance numbers are monotonically increasing and persistent. Once a > > unit is seen, the same driver at the same hardware location will always > > have that number. (Its tied to the device path in /devices, or in the > > kernel tree.) > > > > > It doesn't seem to be a userspace (device alias) thing, as the > > > different instances are reflected in my driver via ddi_get_instance(), > > > and in the NIC instance as reported by ifconfig, dladm, etc. I'm > > > really curious how the kernel maps devices to instances. > > > > > > > I believe there is logic in the kernel to synchronize this with > > /etc/path_to_inst, which is the initial database that is loaded on boot. > > Likely devfsadm also plays a role in this. > > > > To clear the instance numbers, you may need to boot to alternate media, > > remove the entries from /etc/path_to_inst (after mounting the node), and > > then reboot. I've not tested that, but it *should* work. > > Thanks! I'd forgotten about /etc/path_to_inst. Simply rem_drv'ing the > driver in question, editing /etc/path_to_inst, rebooting, and add_drv'ing > worked. > > > > But then again, why would you care about instance numbers changing? The > > reason they are persistent is to ensure that device names don't change > > e.g. when booting with slightly different hardware configs, or after > > performing dynamic reconfiguration, etc. > > Various things use the instance name (like /etc/hostname.foo0, for one > thing). They should arguably use the mac address instead. Or the > instance name should be derived from the mac address rather than the > path (like it is in MacOSX)...
If you are using a somewhat recent build of Nevada, you can use vanity naming and assign a more useful name for the device using the dladm rename-link command. _______________________________________________ driver-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/driver-discuss
