Darren Reed wrote: > Cathy, > > In the "kstats after vanity naming" thread from November last year, > there was > some discussion about how vanity naming would impact kstats... > > I have a concern or two... > > Today, if I'm using kstat(3kstat), i can derive the instance number and the > name from the interface name. So if someone passes "bge2" into my program, > I know that I need to call kstat_lookup like this: > kstat_lookup(kc, "bge", 2, "bge2") > > In the new world of vanity naming, how does one call kstat_lookup()? > Specifically, how do i know if I should be calling it like this: > kstat_lookup(kc, "link", 0, "net0") > I would think that one should only call kstat_lookup(kc, NULL, NULL, <linkname>, 0).
Please be noted that the kstat lookup does not usually work as we expect even today, for example, one would hope to successfully lookup the link_state kstat for VLANs the same way as for normal links, but it does not usually work (see 6512267). I think one should always look up the kstat using the kstat name (not the module name and instance number) even today. > Is the way forward to always do the kstat_lookup() call for the 'link' > first > and follow that up with the old style if that fails? > > Or will kstat_lookup() be changing internally so that code that expects > interface names (in the old style) and presents vanity name interfaces > through it continues to work? > I don't want to do that trick unless it proves really necessary. > What will happen to old applications that get a vanity name network > interface given to them, such as "net0", but try to call kstat like this: > kstat_lookup(kc, "net", 0, "net0") > > ...because the only way to derive the instance# is from the name and > they expect the name to match the old naming convention.... > Will old programs fail to work with kstats after UV? > Note that vanity naming is not turned on by default, the old applications should just work if there is no vanity naming on the system (as we kept the old kstat syntax, also, be noted the old application might not work as it expects as 6512267 suggests). In the future, I'd hope that applications can be changed based on the new syntax. Thanks - Cathy
