Source-Changes-HG archive

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

[src/trunk]: src/doc Write about lingering obsolete variables due to kvm(3)



details:   https://anonhg.NetBSD.org/src/rev/a8d835bb20ee
branches:  trunk
changeset: 822639:a8d835bb20ee
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Mar 30 04:37:58 2017 +0000

description:
Write about lingering obsolete variables due to kvm(3)

diffstat:

 doc/TODO.smpnet |  39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 2953dc070a05 -r a8d835bb20ee doc/TODO.smpnet
--- a/doc/TODO.smpnet   Thu Mar 30 02:17:38 2017 +0000
+++ b/doc/TODO.smpnet   Thu Mar 30 04:37:58 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.9 2017/03/11 07:23:13 msaitoh Exp $
+$NetBSD: TODO.smpnet,v 1.10 2017/03/30 04:37:58 ozaki-r Exp $
 
 MP-safe components
 ==================
@@ -104,3 +104,40 @@
 provide a deferred bpf_mtap mechanism that forcibly runs bpf_mtap in softint
 context.  It's a workaround and once the functions run in softint, we should use
 the original bpf_mtap again.
+
+Lingering obsolete variables
+-----------------------------
+
+Some obsolete global variables and member variables of structures remain to
+avoid breaking old userland programs which directly access such variables via
+kvm(3).
+
+The following programs still use kvm(3) to get some information related to
+the network stack.
+
+ - netstat(1)
+ - vmstat(1)
+ - fstat(1)
+
+netstat(1) accesses ifnet_list, the head of a list of interface objects
+(struct ifnet), and traverses each object through ifnet#if_list member variable.
+ifnet_list and ifnet#if_list is obsoleted by ifnet_pslist and
+ifnet#if_pslist_entry respectively. netstat also accesses the IP address list
+of an interface throught ifnet#if_addrlist. struct ifaddr, struct in_ifaddr
+and struct in6_ifaddr are accessed and the following obsolete member variables
+are stuck: ifaddr#ifa_list, in_ifaddr#ia_hash, in_ifaddr#ia_list,
+in6_ifaddr#ia_next and in6_ifaddr#_ia6_multiaddrs. Note that netstat already
+implements alternative methods to fetch the above information via sysctl(3).
+
+vmstat(1) shows statistics of hash tables created by hashinit(9) in the kernel.
+The statistic information is retrieved via kvm(3). The global variables
+in_ifaddrhash and in_ifaddrhashtbl, which are for a hash table of IPv4
+addresses and obsoleted by in_ifaddrhash_pslist and in_ifaddrhashtbl_pslist,
+are kept for this purpose. We should provide a means to fetch statistics of
+hash tables via sysctl(3).
+
+fstat(1) shows information of bpf instances. Each bpf instance (struct bpf) is
+obtained via kvm(3). bpf_d#_bd_next, bpf_d#_bd_filter and bpf_d#_bd_list
+member variables are obsolete but remain. ifnet#if_xname is also accessed
+via struct bpf_if and obsolete ifnet#if_list is required to remain to not change
+the offset of ifnet#if_xname.



Home | Main Index | Thread Index | Old Index