On Tue, Feb 3, 2009 at 11:03 AM, Kacheong Poon <kacheong.poon at sun.com> wrote: > Peter Tribble wrote: > >> OK, two problems crop up. The first is that 'global' isn't a terribly >> useful >> name. What's wrong with naming this 'statistics'? > > > Not sure if naming a kstat "statistics" is more meaningful.
Well, it is sort of implied by it being a kstat in the first place I suppose. >> The second is that if you were to follow the naming scheme below then you >> can't >> have a rule called 'global'. There's going to be the possibility of a >> name collision >> with any name you choose. > > > Yes, that is true. But I guess it is OK to reserve "global" > or another name for a rule name. Actually, I had another thought. Why do the rule statistics have to use ilb as the module? Why not use 'ilb_rule'? That completely avoids any possibility of naming conflicts, and also has the advantage that you can safely number rules from 0. >> No, I wouldn't do it like this. I would have a kstat something like >> >> module: ilb instance: 1 >> name: rule class: rulestat >> rulename > > > The kstat instance field normally has the following meaning, as > described in kstat_create(9F) > > ks_instance The provider's instance number, as from > ddi_get_instance(9F). Modules which do not > have a meaningful instance number should use > 0. > > And there is only one instance of ILB in an IP stack. > There is really no meaningful instance number. Are you > suggesting to have a different instance number for each > rule? That's exactly what I'm suggesting. As you say, instance number isn't really meaningful, so that I don't feel too guilty about appropriating it. One other possibility would be ilb:0:rule77 but that's just horrible - you have to go parsing the names into their constituent parts. > And I guess you also imply that it is not that > useful for an admin to be able to filter out kstats by name. I would normally want to be able to get at all the rule statistics easily, and would hen simply display the lot or do additional processing based on content. So I would want the kstat names and classes to be fixed strings known in advance. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/