freebsd-nq/sys/netipsec
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
..
ah_var.h
ah.h
esp_var.h
esp.h
ipcomp_var.h
ipcomp.h
ipsec6.h netipsec: move specific ipsecmethods declarations to ipsec_support.h 2022-10-03 20:53:04 -07:00
ipsec_input.c tcp: embed inpcb into tcpcb 2022-12-07 09:00:48 -08:00
ipsec_mbuf.c Fix unused variable warning in ipsec_mbuf.c 2022-07-21 22:12:01 +02:00
ipsec_mod.c ipsec: Handle ICMP NEEDFRAG message. 2021-08-09 12:01:46 +02:00
ipsec_output.c tcp: embed inpcb into tcpcb 2022-12-07 09:00:48 -08:00
ipsec_pcb.c
ipsec_support.h Fix kernel build after fcb3f813f3 . 2022-10-04 15:42:51 +02:00
ipsec.c ipsec: add key_havesp_any 2022-11-22 12:23:08 +00:00
ipsec.h netipsec: move specific ipsecmethods declarations to ipsec_support.h 2022-10-03 20:53:04 -07:00
key_debug.c Fix unused variable warning in netipsec's key_debug.c 2022-07-26 21:25:09 +02:00
key_debug.h
key_var.h
key.c ipsec: add key_havesp_any 2022-11-22 12:23:08 +00:00
key.h ipsec: add key_havesp_any 2022-11-22 12:23:08 +00:00
keydb.h ipsec: add support for CHACHA20POLY1305 2022-11-02 14:19:04 +01:00
keysock.c protosw: refactor protosw and domain static declaration and load 2022-08-17 11:50:32 -07:00
keysock.h keysock: do not use raw socket code 2022-08-11 09:19:36 -07:00
subr_ipsec.c ipsec: add key_havesp_any 2022-11-22 12:23:08 +00:00
udpencap.c
xform_ah.c ipsec: add support for CHACHA20POLY1305 2022-11-02 14:19:04 +01:00
xform_esp.c ipsec: add support for CHACHA20POLY1305 2022-11-02 14:19:04 +01:00
xform_ipcomp.c ipsec: replace SECASVAR mtx by rmlock 2022-07-19 05:27:20 +02:00
xform_tcp.c tcp: remove INP_TIMEWAIT flag 2022-10-06 19:24:37 -07:00
xform.h