sowmini.varadhan at sun.com wrote:
> On (05/25/07 00:20), Garrett D'Amore wrote:
>
>> The alternative is for drivers to do _both_ kstats on their own, and
>> support Nemo mac_stat() entry points. Entirely inelegant. (Btw, the
>> old GLDv2 suffered this flaw.) This also means that mac_stat
>>
>
> ... I think the paragraph above got truncated?..
>
Ooops. I think the message still conveyed what I meant in general, anyway.
>
>> The second problem is simply API growth. One can view stats as natural
>> properties. Many drivers even explicitly export ndd tunables in their
>> own kstat. Having a separate kind of API for drivers to have to
>> implement kstats _in addition_ to the API they will already be doing for
>> Brussels seems wasteful. Brussels should reduce, not increase, code
>> sizes in device drivers.
>>
>
> Another aspect to consider is that, like the ndd props themselves,
> kstats have become a catch-all for all sorts of information. Some kstats
> like link speed, would qualify as a property, but there are others
> like ipackets/opackets are closer to a "statistic" than a "property".
>
> Extracting the kstats that would qualify unambiguosly as properties
> into Brussels would certainly be a good idea.
>
All kstats in drivers (at least all the "integer" ones) probably qualify
as "properties", its just that they might not be modifiable. (I am
assuming that it makes sense to have read-only properties... ndd
certainly has these today.)
Note also that I'm talking about internal implementation. I certainly
think it would be a bad idea for system administrators to have to learn
that some properties are in ndd, and some are in kstat, and have to
figure out the rules. While to us there may be or may not be a certain
logic involved, to administrators the choices are likely to appear
arbitrary.
So, my proposal is again not to cherry pick a few kstats and move them
to Brussels properties, but to provide Brussels support for kstats
wholesale...
In my ideal world, no driver would be implementing kstats or mac_stat,
but would instead be supplying Brussels property entry points. Brussels
can figure out (perhaps with some hints from the driver... see my
earlier discussion about registration) which should/should not be
exposed as kstats, ndd, etc.
-- Garrett