freebsd-dev/cddl/lib
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
..
drti pkgbase: Put dtrace in its own package 2021-06-19 17:49:31 +02:00
libavl pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libctf Remove -I flag for include path that doesn't exist 2020-09-10 15:37:07 +00:00
libdtrace tcp: embed inpcb into tcpcb 2022-12-07 09:00:48 -08:00
libicp libicp: Link with -z noexecstack for ld.bfd. 2022-11-22 08:37:12 -08:00
libicp_rescue libicp: Link with -z noexecstack for ld.bfd. 2022-11-22 08:37:12 -08:00
libnvpair pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libspl pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libtpool pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libumem pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libuutil pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libzfs pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libzfs_core pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libzfsbootenv pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libzpool pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
libzutil pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
pam_zfs_key pkgbase: Put zfs utilities and lib in their own package 2022-10-26 19:46:30 +02:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
Makefile cddl/*: add a WITH(OUT)_DTRACE option 2022-07-06 14:03:48 +01:00
Makefile.inc Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00