tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]



On Wed, Nov 26, 2014 at 5:07 PM, matthew green <mrg%eterna.com.au@localhost> wrote:
>
>> > Good point.  There must be a way for drivers to declare if
>> > CALLOUT_MPSAFE or not.  Need to extend if_flags.
>>
>> Hmm, if_flags.
>>
>> http://mail-index.netbsd.org/tech-net/2009/01/27/msg000985.html
>>
>> Do we have to care about kvm(3) users (i.e., netstat) as well as
>> the callout_t issue?
> [ .. ]
>> > Yes, netstat(1) uses sysctl(3) to fetch statistics numbers.  But
>> > netstat(1) needs to know struct type information (by building if.c) to
>> > read kernel cores via kvm(3).  Maybe making kvm(3) to understand DWARF
>> > type information helps?
>>
>> I don't understand how kvm(3) works though, if we don't change existing
>> members of struct ifnet, can old netstat(1) run on a new kernel that
>> adds a value hidden in _KERNEL to struct ifnet?
>
> you don't have to worry about making old kvm users work on new
> kernels.  that has never been a useful goal, and why we have
> switched most run-time usage to sysctl().  the real benefit of
> kvm programs is running against a core file.  if crash(8) was
> extended to handle these cases, or perhaps some gdb scripts,
> then we could obsolete the kvm usage entirely.  (of course,
> netstat still has a non trivial amount of sysctl work to go,
> at least last time i looked.)

Good news :) If so, we can simply migrate to int if_flags
(with some tweaks in the kernel).

  ozaki-r

>
> thanks.
>
>
> .mrg.


Home | Main Index | Thread Index | Old Index