freebsd-dev/cddl/lib/libdtrace
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
..
errno.d Correct the D definition for EINTEGRITY. 2020-09-01 15:15:22 +00:00
io.d Updates and enhancements to io.d to aid DTrace scripting 2018-02-24 17:13:15 +00:00
ip.d Add a dtrace provider for UDP-Lite. 2018-07-31 22:56:03 +00:00
libproc_compat.h Use tabs in io.d, fix alignment issues, remove extraneous newlines 2018-02-12 23:53:38 +00:00
Makefile libdtrace: Add kinst support 2022-10-11 18:19:08 -04:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
net.d
nfs.d
nfssrv.d
psinfo.d Use tabs in io.d, fix alignment issues, remove extraneous newlines 2018-02-12 23:53:38 +00:00
regs_x86.d libdtrace: Fix some CPU register number definitions to match the kernel 2022-10-12 16:06:37 -04:00
sched.d Use tabs in io.d, fix alignment issues, remove extraneous newlines 2018-02-12 23:53:38 +00:00
sctp.d Add support for send, receive and state-change DTrace providers for 2018-08-22 21:23:32 +00:00
siftr.d
signal.d Consistent casing for fallback SIGCHLD (s/Unknown/unknown/) 2018-02-26 00:04:21 +00:00
socket.d Add D definitions for the named values in socket.h 2017-09-07 03:05:16 +00:00
tcp.d tcp: embed inpcb into tcpcb 2022-12-07 09:00:48 -08:00
udp.d The IP, TCP, and UDP provider report IP addresses as strings. 2018-06-18 18:35:29 +00:00
udplite.d Add a dtrace provider for UDP-Lite. 2018-07-31 22:56:03 +00:00
unistd.d