opnsense-src/usr.bin/systat
Gleb Smirnoff e68b379244 tcp: embed inpcb into tcpcb
For the TCP protocol inpcb storage specify allocation size that would
provide space to most of the data a TCP connection needs, embedding
into struct tcpcb several structures, that previously were allocated
separately.

The most import one is the inpcb itself.  With embedding we can provide
strong guarantee that with a valid TCP inpcb the tcpcb is always valid
and vice versa.  Also we reduce number of allocs/frees per connection.
The embedded inpcb is placed in the beginning of the struct tcpcb,
since in_pcballoc() requires that.  However, later we may want to move
it around for cache line efficiency, and this can be done with a little
effort.  The new intotcpcb() macro is ready for such move.

The congestion algorithm data, the TCP timers and osd(9) data are
also embedded into tcpcb, and temprorary struct tcpcb_mem goes away.
There was no extra allocation here, but we went through extra pointer
every time we accessed this data.

One interesting side effect is that now TCP data is allocated from
SMR-protected zone.  Potentially this allows the TCP stacks or other
TCP related modules to utilize that for their own synchronization.

Large part of the change was done with sed script:

s/tp->ccv->/tp->t_ccv./g
s/tp->ccv/\&tp->t_ccv/g
s/tp->cc_algo/tp->t_cc/g
s/tp->t_timers->tt_/tp->tt_/g
s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g

Dependency side effect is that code that needs to know struct tcpcb
should also know struct inpcb, that added several <netinet/in_pcb.h>.

Differential revision:	https://reviews.freebsd.org/D37127
2022-12-07 09:00:48 -08:00
..
cmds.c Don't leak tmpstr. 2018-06-21 07:42:28 +00:00
cmdtab.c Report I/O stats from the CAM_IOSCHED_DYNAMIC extension 2022-02-28 10:44:47 -07:00
convtbl.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
convtbl.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
devs.c systat: mostly clean up warns 2021-11-01 23:11:16 +00:00
devs.h systat: Handle SIGWINCH to properly window resizing and adjust 2021-04-21 20:31:58 +02:00
extern.h Report I/O stats from the CAM_IOSCHED_DYNAMIC extension 2022-02-28 10:44:47 -07:00
fetch.c Introduce sysputpage() to display large page size with human readable format. 2020-05-15 17:37:08 +00:00
icmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
icmp6.c Fix printing of 64-bit counters on 32-bit ppc platforms. 2018-11-12 13:26:13 +00:00
ifcmds.c Handle device removal and removal+add cases to fix infinity rate. 2020-07-11 13:56:36 +00:00
ifstat.c systat: Fix a bunch of use after frees in fetch_ifstat(). 2022-11-22 11:11:42 -08:00
iolat.c Report I/O stats from the CAM_IOSCHED_DYNAMIC extension 2022-02-28 10:44:47 -07:00
iostat.c systat/iostat: Use bools for numbers and kbpt 2022-02-07 14:51:45 -07:00
ip.c Fix printing of 64-bit counters on 32-bit ppc platforms. 2018-11-12 13:26:13 +00:00
ip6.c Add stat counter for ipv6 atomic fragments 2019-04-19 17:06:43 +00:00
keyboard.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
main.c Report I/O stats from the CAM_IOSCHED_DYNAMIC extension 2022-02-28 10:44:47 -07:00
Makefile Report I/O stats from the CAM_IOSCHED_DYNAMIC extension 2022-02-28 10:44:47 -07:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mode.c Fix whitespace inconsistencies in systat(1). 2011-10-15 13:20:36 +00:00
mode.h Fix whitespace inconsistencies in systat(1). 2011-10-15 13:20:36 +00:00
netcmds.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
netstat.c tcp: embed inpcb into tcpcb 2022-12-07 09:00:48 -08:00
pigs.c systat: Avoid incorrect reallocation in pigs.c 2021-04-21 20:09:21 +02:00
proc.c systat: mostly clean up warns 2021-11-01 23:11:16 +00:00
sctp.c Don't show the number of currently established SCTP associations, 2018-04-10 08:19:14 +00:00
swap.c Augment systat(1) -swap to display large swap space processes 2021-10-26 15:50:29 +03:00
sysput.c systat: Eliminate write-only unit variable 2022-02-07 14:51:45 -07:00
systat.1 systat.1: Fix lists 2022-04-02 00:49:53 +02:00
systat.h Augment systat(1) -swap to display large swap space processes 2021-10-26 15:50:29 +03:00
tcp.c Tcp progress timeout 2022-09-27 13:38:20 -04:00
vmstat.c systat: Display seconds in vmstat mode 2022-01-29 20:41:19 +11:00
zarc.c Clean up copyright messages. 2021-05-10 23:14:35 -07:00