Add in_pcbinfo_init() to encapsulate basic structural setup (right now just
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 7 Jun 2004 02:36:28 +0000 (02:36 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 7 Jun 2004 02:36:28 +0000 (02:36 +0000)
commitd2e9e54c805e784f073aab41a3f9d6f571e1510a
tree3c1713d0e76e5afa182e898c5db5cacb3357d558
parent9e4465af34c2113830ff87922c9ef16d6899caec
Add in_pcbinfo_init() to encapsulate basic structural setup (right now just
the LIST_INIT).  Rename inpcbinfo->listhead to inpcbinfo->pcblisthead due
to changes in the API (addition of markers).

Add support for markers in the inpcbinfo->pcblisthead lists of INPCB
structures.  Use markers in sysctl output code to iterate through these lists
without losing its place or having to worry about structures being ripped out
from under it.  Scrap the original two-pass code.

Redo the sysctl INPCB output code for tcp, udp, and other protocols so we
always output the correct number of structures (as specified in xig_count).

Generate output for all cpus (for TCP).  This is accomplished by using
lwkt_setcpu_self() to migrate the kernel thread to each cpu, which allows us
to iterate the list(s) managed by that cpu without having to deal with mutexes
or other forms of locks.  Iterations always wind up on the same cpu they began
on.

Redo netstat to properly iterate across as many cpu chunks as the inpcb
sysctl's return, rather then just the first one.

Work-by: Hiten Pandya and Matthew Dillon
sys/netinet/in.c
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/ip_divert.c
sys/netinet/raw_ip.c
sys/netinet/tcp_subr.c
sys/netinet/udp_usrreq.c
usr.bin/netstat/inet.c