TODO.smpnet revision 1.13
11.13Sozaki$NetBSD: TODO.smpnet,v 1.13 2017/08/10 09:26:55 ozaki-r Exp $
21.1Sozaki
31.2SozakiMP-safe components
41.2Sozaki==================
51.1Sozaki
61.7Sozaki - Device drivers
71.7Sozaki   - vioif(4)
81.7Sozaki   - vmx(4)
91.7Sozaki   - wm(4)
101.8Sozaki   - ixg(4)
111.9Smsaitoh   - ixv(4)
121.7Sozaki - Layer 2
131.7Sozaki   - Ethernet (if_ethersubr.c)
141.7Sozaki   - bridge(4)
151.7Sozaki     - STP
161.7Sozaki   - Fast forward (ipflow)
171.7Sozaki - Layer 3
181.7Sozaki   - All except for items in the below section
191.7Sozaki - Interfaces
201.7Sozaki   - gif(4)
211.7Sozaki   - l2tp(4)
221.7Sozaki   - pppoe(4)
231.7Sozaki     - if_spppsubr.c
241.7Sozaki   - tun(4)
251.12Sozaki   - vlan(4)
261.7Sozaki - Packet filters
271.7Sozaki   - npf(7)
281.7Sozaki - Others
291.7Sozaki   - bpf(4)
301.12Sozaki   - ipsec(4)
311.12Sozaki   - opencrypto(9)
321.7Sozaki   - pfil(9)
331.2Sozaki
341.2SozakiNon MP-safe components and kernel options
351.2Sozaki=========================================
361.2Sozaki
371.7Sozaki - Device drivers
381.7Sozaki   - Most drivers other than ones listed in the above section
391.6Sozaki - Layer 2
401.6Sozaki   - ARCNET (if_arcsubr.c)
411.6Sozaki   - ATM (if_atmsubr.c)
421.6Sozaki   - BRIDGE_IPF
431.6Sozaki   - if_ecosubr.c
441.6Sozaki   - FDDI (if_fddisubr.c)
451.6Sozaki   - HIPPI (if_hippisubr.c)
461.6Sozaki   - IEEE 1394 (if_ieee1394subr.c)
471.6Sozaki   - IEEE 802.11 (ieee80211(4))
481.6Sozaki   - Token ring (if_tokensubr.c)
491.6Sozaki - Layer 3
501.6Sozaki   - IPSELSRC
511.6Sozaki   - MROUTING
521.6Sozaki   - PIM
531.6Sozaki   - MPLS (mpls(4))
541.2Sozaki - Layer 4
551.6Sozaki   - DCCP
561.6Sozaki   - SCTP
571.6Sozaki   - TCP
581.6Sozaki   - UDP
591.6Sozaki - Interfaces
601.6Sozaki   - agr(4)
611.6Sozaki   - carp(4)
621.6Sozaki   - etherip(4)
631.6Sozaki   - faith(4)
641.6Sozaki   - gre(4)
651.6Sozaki   - ppp(4)
661.6Sozaki   - sl(4)
671.6Sozaki   - stf(4)
681.6Sozaki   - strip(4)
691.6Sozaki   - if_srt
701.6Sozaki   - tap(4)
711.6Sozaki - Packet filters
721.6Sozaki   - ipf(4)
731.6Sozaki   - pf(4)
741.6Sozaki - Others
751.6Sozaki   - AppleTalk (sys/netatalk/)
761.6Sozaki   - ATM (sys/netnatm/)
771.6Sozaki   - Bluetooth (sys/netbt/)
781.6Sozaki   - altq(4)
791.6Sozaki   - CIFS (sys/netsmb/)
801.6Sozaki   - ISDN (sys/netisbn/)
811.6Sozaki   - kttcp(4)
821.6Sozaki   - NFS
831.2Sozaki
841.2SozakiKnow issues
851.2Sozaki===========
861.1Sozaki
871.1Sozakibpf
881.2Sozaki---
891.1Sozaki
901.1SozakiMP-ification of bpf requires all of bpf_mtap* are called in normal LWP context
911.1Sozakior softint context, i.e., not in hardware interrupt context.  For Tx, all
921.1Sozakibpf_mtap satisfy the requrement.  For Rx, most of bpf_mtap are called in softint.
931.1SozakiUnfortunately some bpf_mtap on Rx are still called in hardware interrupt context.
941.1Sozaki
951.1SozakiThis is the list of the functions that have such bpf_mtap:
961.1Sozaki
971.1Sozaki - sca_frame_process() @ sys/dev/ic/hd64570.c
981.1Sozaki - en_intr() @ sys/dev/ic/midway.c
991.1Sozaki - rxintr_cleanup() and txintr_cleanup() @ sys/dev/pci/if_lmc.c
1001.1Sozaki - ipr_rx_data_rdy() @ sys/netisdn/i4b_ipr.c
1011.1Sozaki
1021.1SozakiIdeally we should make the functions run in softint somehow, but we don't have
1031.1Sozakiactual devices, no time (or interest/love) to work on the task, so instead we
1041.1Sozakiprovide a deferred bpf_mtap mechanism that forcibly runs bpf_mtap in softint
1051.1Sozakicontext.  It's a workaround and once the functions run in softint, we should use
1061.1Sozakithe original bpf_mtap again.
1071.10Sozaki
1081.10SozakiLingering obsolete variables
1091.10Sozaki-----------------------------
1101.10Sozaki
1111.10SozakiSome obsolete global variables and member variables of structures remain to
1121.10Sozakiavoid breaking old userland programs which directly access such variables via
1131.10Sozakikvm(3).
1141.10Sozaki
1151.10SozakiThe following programs still use kvm(3) to get some information related to
1161.10Sozakithe network stack.
1171.10Sozaki
1181.10Sozaki - netstat(1)
1191.10Sozaki - vmstat(1)
1201.10Sozaki - fstat(1)
1211.10Sozaki
1221.10Sozakinetstat(1) accesses ifnet_list, the head of a list of interface objects
1231.10Sozaki(struct ifnet), and traverses each object through ifnet#if_list member variable.
1241.10Sozakiifnet_list and ifnet#if_list is obsoleted by ifnet_pslist and
1251.10Sozakiifnet#if_pslist_entry respectively. netstat also accesses the IP address list
1261.10Sozakiof an interface throught ifnet#if_addrlist. struct ifaddr, struct in_ifaddr
1271.10Sozakiand struct in6_ifaddr are accessed and the following obsolete member variables
1281.10Sozakiare stuck: ifaddr#ifa_list, in_ifaddr#ia_hash, in_ifaddr#ia_list,
1291.10Sozakiin6_ifaddr#ia_next and in6_ifaddr#_ia6_multiaddrs. Note that netstat already
1301.10Sozakiimplements alternative methods to fetch the above information via sysctl(3).
1311.10Sozaki
1321.10Sozakivmstat(1) shows statistics of hash tables created by hashinit(9) in the kernel.
1331.10SozakiThe statistic information is retrieved via kvm(3). The global variables
1341.10Sozakiin_ifaddrhash and in_ifaddrhashtbl, which are for a hash table of IPv4
1351.10Sozakiaddresses and obsoleted by in_ifaddrhash_pslist and in_ifaddrhashtbl_pslist,
1361.10Sozakiare kept for this purpose. We should provide a means to fetch statistics of
1371.10Sozakihash tables via sysctl(3).
1381.10Sozaki
1391.10Sozakifstat(1) shows information of bpf instances. Each bpf instance (struct bpf) is
1401.10Sozakiobtained via kvm(3). bpf_d#_bd_next, bpf_d#_bd_filter and bpf_d#_bd_list
1411.10Sozakimember variables are obsolete but remain. ifnet#if_xname is also accessed
1421.10Sozakivia struct bpf_if and obsolete ifnet#if_list is required to remain to not change
1431.11Sozakithe offset of ifnet#if_xname. The statistic counters (bpf#bd_rcount,
1441.11Sozakibpf#bd_dcount and bpf#bd_ccount) are also victims of this restriction; for
1451.11Sozakiscalability the statistic counters should be per-CPU and we should stop using
1461.11Sozakiatomic operations for them however we have to remain the counters and atomic
1471.11Sozakioperations.
1481.13Sozaki
1491.13SozakiScalability
1501.13Sozaki-----------
1511.13Sozaki
1521.13Sozaki - Per-CPU rtcaches (used in say IP forwarding) aren't scalable on multiple
1531.13Sozaki   flows per CPU
1541.13Sozaki - ipsec(4) isn't scalable on the number of SA/SP; the cost of a look-up
1551.13Sozaki   is O(n)
156