| #
5fb4b091
|
| 26-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: allow specifying a MSL for local communications
When setting the sysctl-variable net.inet.tcp.nolocaltimewait to 1, which is the default, a TCP endpoint does not enter the TIME-WAIT state, when
tcp: allow specifying a MSL for local communications
When setting the sysctl-variable net.inet.tcp.nolocaltimewait to 1, which is the default, a TCP endpoint does not enter the TIME-WAIT state, when the communication is local. This can result in sending RST-segments without any error situation. By setting the sysctl-variable net.inet.tcp.nolocaltimewait to 0, this does not occur, and the behavior is compliant with the TCP specification. But there is no reason to stay in the TIME-WAIT state for two times the value of the sysctl-variable net.inet.tcp.msl, if the communication is local. Therefore provide a separate sysctl-variable net.inet.tcp.msl_local, which controls how long an TCP end-point stays in the TIME-WAIT state, if the communication is local. The default value is 10 ms.
Reviewed by: glebius, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50637
show more ...
|
| #
0b33b25b
|
| 26-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: cleanup timer initialisations
Use MSEC_2_TICKS() to make clearer, which values are used and to ensure that the value stored is at least one tick. This also avoids the need of some protection co
tcp: cleanup timer initialisations
Use MSEC_2_TICKS() to make clearer, which values are used and to ensure that the value stored is at least one tick. This also avoids the need of some protection code.
Reviewed by: glebius, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50840
show more ...
|
| #
89f6eb0a
|
| 26-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: restrict the contents of tcp_timer.h to the kernel context
The header file contains only stuff relevant in the kernel context.
Reviewed by: glebius, rscheff, Peter Lei, imp Sponsored by: Net
tcp: restrict the contents of tcp_timer.h to the kernel context
The header file contains only stuff relevant in the kernel context.
Reviewed by: glebius, rscheff, Peter Lei, imp Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50912
show more ...
|
| #
552d1780
|
| 17-Jun-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
tcp: provide sysctl for the maximum retransmission timeout
Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D50891
|
| #
124120d4
|
| 17-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: remove TCPTV_TWTRUNC
It is not used anymore...
Reviewed by: rscheff, Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50900
|
| #
d8496725
|
| 16-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
Revert "tcp: cleanup timer initialisations"
This reverts commit c13f4b1574da77f89ab57cfcc87fe8ad80f25263. Using MSEC_2_TICKS() breaks compiling contrib/bsnmp/snmp_mibII/mibII_tcp.c since it includes
Revert "tcp: cleanup timer initialisations"
This reverts commit c13f4b1574da77f89ab57cfcc87fe8ad80f25263. Using MSEC_2_TICKS() breaks compiling contrib/bsnmp/snmp_mibII/mibII_tcp.c since it includes tcp_timer.h in userland and MSEC_2_TICKS() is only defined for kernel land.
show more ...
|
| #
c13f4b15
|
| 16-Jun-2025 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: cleanup timer initialisations
Use MSEC_2_TICKS() to make clearer, which values are used and to ensure that the value stored is at least one tick. This also avoids the need of some protection co
tcp: cleanup timer initialisations
Use MSEC_2_TICKS() to make clearer, which values are used and to ensure that the value stored is at least one tick. This also avoids the need of some protection code.
Reviewed by: cc, glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50840
show more ...
|
| #
29363fb4
|
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
| #
2ff63af9
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
|
| #
6b802933
|
| 21-Feb-2023 |
Michael Tuexen <tuexen@FreeBSD.org> |
tcp: rearrange enum and remove unused variable
Rearrange the enum tt_which such that TT_REXMIT is 0. This allows an extension of the BBLog event RTO in a backwards compatible way. Remove tcptimers,
tcp: rearrange enum and remove unused variable
Rearrange the enum tt_which such that TT_REXMIT is 0. This allows an extension of the BBLog event RTO in a backwards compatible way. Remove tcptimers, which was only used in trpt, a utility removed from the source tree recently.
Reviewed by: glebius@, guest-ccui@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38547
show more ...
|
| #
446ccdd0
|
| 07-Dec-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
tcp: use single locked callout per tcpcb for the TCP timers
Use only one callout structure per tcpcb that is responsible for handling all five TCP timeouts. Use locked version of callout, of course
tcp: use single locked callout per tcpcb for the TCP timers
Use only one callout structure per tcpcb that is responsible for handling all five TCP timeouts. Use locked version of callout, of course. The callout function tcp_timer_enter() chooses soonest timer and executes it with lock held. Unless the timer reports that the tcpcb has been freed, the callout is rescheduled for next soonest timer, if there is any.
With single callout per tcpcb on connection teardown we should be able to fully stop the callout and immediately free it, avoiding use of callout_async_drain(). There is one gotcha here: callout_stop() can actually touch our memory when a rare race condition happens. See comment above tcp_timer_stop(). Synchronous stop of the callout makes tcp_discardcb() the single entry point for tcpcb destructor, merging the tcp_freecb() to the end of the function.
While here, also remove lots of lingering checks in the beginning of TCP timer functions. With a locked callout they are unnecessary.
While here, clean unused parts of timer KPI for the pluggable TCP stacks.
While here, remove TCPDEBUG from tcp_timer.c, as this allows for more simplification of TCP timers. The TCPDEBUG is scheduled for removal.
Move the DTrace probes in timers to the beginning of a function, where a tcpcb is always existing.
Discussed with: rrs, tuexen, rscheff (the TCP part of the diff) Reviewed by: hselasky, kib, mav (the callout part) Differential revision: https://reviews.freebsd.org/D37321
show more ...
|
| #
918fa422
|
| 07-Dec-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
tcp: remove tcp_timer_suspend()
It was a temporary code added together with RACK to fight against TCP timer races.
|
| #
e68b3792
|
| 07-Dec-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
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 struct
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
show more ...
|
| #
0d744519
|
| 07-Oct-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
tcp: remove tcptw, the compressed timewait state structure
The memory savings the tcptw brought back in 2003 (see 340c35de6a2) no longer justify the complexity required to maintain it. For longer e
tcp: remove tcptw, the compressed timewait state structure
The memory savings the tcptw brought back in 2003 (see 340c35de6a2) no longer justify the complexity required to maintain it. For longer explanation please check out the email [1].
Surpisingly through almost 20 years the TCP stack functionality of handling the TIME_WAIT state with a normal tcpcb did not bitrot. The existing tcp_input() properly handles a tcpcb in TCPS_TIME_WAIT state, which is confirmed by the packetdrill tcp-testsuite [2].
This change just removes tcptw and leaves INP_TIMEWAIT. The flag will be removed in a separate commit. This makes it easier to review and possibly debug the changes.
[1] https://lists.freebsd.org/archives/freebsd-net/2022-January/001206.html [2] https://github.com/freebsd-net/tcp-testsuite
Differential revision: https://reviews.freebsd.org/D36398
show more ...
|
| #
77198a94
|
| 04-Oct-2022 |
Gleb Smirnoff <glebius@FreeBSD.org> |
tcp_timers: provide tcp_timer_drop() and tcp_timer_close()
Two functions to call tcp_drop() and tcp_close() from a callout context. Garbage collect tcp_inpinfo_lock_del(), it has a single use now.
tcp_timers: provide tcp_timer_drop() and tcp_timer_close()
Two functions to call tcp_drop() and tcp_close() from a callout context. Garbage collect tcp_inpinfo_lock_del(), it has a single use now.
Differential revision: https://reviews.freebsd.org/D36397
show more ...
|
| #
08af8aac
|
| 27-Sep-2022 |
Randall Stewart <rrs@FreeBSD.org> |
Tcp progress timeout
Rack has had the ability to timeout connections that just sit idle automatically. This feature of course is off by default and requires the user set it on (though the socket opt
Tcp progress timeout
Rack has had the ability to timeout connections that just sit idle automatically. This feature of course is off by default and requires the user set it on (though the socket option has been missing in tcp_usrreq.c). Lets get the progress timeout fully supported in the base stack as well as rack.
Reviewed by: tuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D36716
show more ...
|
| #
c2c8e360
|
| 04-Dec-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
tcp: virtualise net.inet.tcp.msl sysctl.
VNET teardown waits 2*MSL (60 seconds by default) before expiring tcp PCBs. These PCBs holds references to nexthops, which, in turn, reference ifnets. This
tcp: virtualise net.inet.tcp.msl sysctl.
VNET teardown waits 2*MSL (60 seconds by default) before expiring tcp PCBs. These PCBs holds references to nexthops, which, in turn, reference ifnets. This chain results in VNET interfaces being destroyed and moved to default VNET only after 60 seconds. Allow tcp_msl to be set in jail by virtualising net.inet.tcp.msl sysctl, permitting more predictable VNET tests outcomes.
MFC after: 1 week Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D33270
show more ...
|
| #
ff945008
|
| 19-Nov-2021 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Add tcp_freecb() - single place to free tcpcb.
Until this change there were two places where we would free tcpcb - tcp_discardcb() in case if all timers are drained and tcp_timer_discard() otherwise
Add tcp_freecb() - single place to free tcpcb.
Until this change there were two places where we would free tcpcb - tcp_discardcb() in case if all timers are drained and tcp_timer_discard() otherwise. They were pretty much copy-n-paste, except that in the default case we would run tcp_hc_update(). Merge this into single function tcp_freecb() and move new short version of tcp_timer_discard() to tcp_timer.c and make it static.
Reviewed by: rrs, hselasky Differential revision: https://reviews.freebsd.org/D32965
show more ...
|
| #
4c0bef07
|
| 21-Jan-2021 |
Kyle Evans <kevans@FreeBSD.org> |
kern: net: remove TCP_LINGERTIME
TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be
kern: net: remove TCP_LINGERTIME
TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be the case that there was a single pr_usrreq method with requests dispatched to it; these exact two lines appeared in tcp_usrreq's PRU_ATTACH handling.
The only purpose of this that I can find is to cause surprising behavior on accepted connections. Newly-created sockets will never hit these paths as one cannot set SO_LINGER prior to socket(2). If SO_LINGER is set on a listening socket and inherited, one would expect the timeout to be inherited rather than changed arbitrarily like this -- noting that SO_LINGER is nonsense on a listening socket beyond inheritance, since they cannot be 'connected' by definition.
Neither Illumos nor Linux reset the timer like this based on testing and inspection of Illumos, and testing of Linux.
Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D28265
show more ...
|
| #
d7ca3f78
|
| 16-Apr-2020 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
Reduce default TCP delayed ACK timeout to 40ms.
Reviewed by: kbowling, tuexen Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebs
Reduce default TCP delayed ACK timeout to 40ms.
Reviewed by: kbowling, tuexen Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23281
show more ...
|
| #
44e86fbd
|
| 13-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357662 through r357854.
|
| #
481be5de
|
| 12-Feb-2020 |
Randall Stewart <rrs@FreeBSD.org> |
White space cleanup -- remove trailing tab's or spaces from any line.
Sponsored by: Netflix Inc.
|
| #
334fc582
|
| 08-Jan-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
vnet: virtualise more network stack sysctls.
Virtualise tcp_always_keepalive, TCP and UDP log_in_vain. All three are set in the netoptions startup script, which we would love to run for VNETs as we
vnet: virtualise more network stack sysctls.
Virtualise tcp_always_keepalive, TCP and UDP log_in_vain. All three are set in the netoptions startup script, which we would love to run for VNETs as well [1].
While virtualising the log_in_vain sysctls seems pointles at first for as long as the kernel message buffer is not virtualised, it at least allows an administrator to debug the base system or an individual jail if needed without turning the logging on for all jails running on a system.
PR: 243193 [1] MFC after: 2 weeks
show more ...
|
| #
415e34c4
|
| 29-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345677
|
| #
0999766d
|
| 23-Mar-2019 |
Michael Tuexen <tuexen@FreeBSD.org> |
Add sysctl variable net.inet.tcp.rexmit_initial for setting RTO.Initial used by TCP.
Reviewed by: rrs@, 0mp@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19355
|