aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_stacks
Commit message (Collapse)AuthorAgeFilesLines
* tcp: use time instead of slots in the HPTS APINick Banks6 hours2-185/+184
| | | | | | | This makes slots an internal concept of HPTS. Reviewed by: tuexen Sponsored by: Netflix, Inc.
* tcp: remove notion of ticks from HPTSNick Banks7 hours2-6/+0
| | | | | | | | To improve consistency of the code, don't use slots and ticks, just use slots. Reviewed by: tuexen Sponsored by: Netflix, Inc.
* tcp: simplify tcp_hpts_insert signatureNick Banks7 hours2-18/+10
| | | | | Reviewed by: tuexen Sponsored by: Netflix, Inc.
* tcp: remove now unneeded icmp includesGleb Smirnoff2025-08-255-10/+0
|
* tcp: retire rstreasonMichael Tuexen2025-08-124-33/+33
| | | | | | | | | | | | | With the latest changes, this variable and parameter for tcp_dropwithreset() is not needed anymore. It also makes it harder to introduce the usage of multiple counters for TCP again, which might open side channel attacks. No funtional changes intended. Reviewed by: rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51872
* tcp: rate limit the sending of all RST segmentsMichael Tuexen2025-08-072-4/+4
| | | | | | | | | | | | | | | | | | Also rate limit the sending of RST segments in the following cases: * when receiving data on a closed socket. * when a socket can not be created at the end of the handshake and the sysctl-variable net.inet.tcp.syncache.rst_on_sock_fail is 1. * when an ACK segment is received in SYN SENT state and it does not acknowledge the SYN segment. After this change, there is no need anymore to provide a rstreason to tcp_dropwithreset(), since it is always BANDLIM_TCP_RST. This will be a follow-up commit, since it will change the code in a couple of places, but will not change the functionality. Reviewed by: rrs, Nick Banks, Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51815
* rack, bbr: minor cleanupMichael Tuexen2025-08-061-4/+2
| | | | | | | | | No functional change intended. Reviewed by: Nick Banks MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51734
* tcp: improve variable and constant namesNick Banks2025-07-312-16/+16
| | | | | | | | | | Don't use ticks in variable names or constant when they don't have a relation to ticks. Use slots or usecs. No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp: improve function namesNick Banks2025-07-313-65/+65
| | | | | | | | | | tcp_tv_to_usectick(), tcp_tv_to_mssectick(), and tcp_tv_to_lusectick() are not related to ticks. Therefore remove the trailing 'tick'. No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp: remove trailing whitespacesNick Banks2025-07-245-17/+17
| | | | | | Reviewed by: cc, tuexen, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51437
* tcp rack,bbr: cleanupMichael Tuexen2025-07-242-13/+2
| | | | | | | | | Remove code that can't be enabled in FreeBSD anyway. Reviewed by: glebius, rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51423
* tcp rack: fix clearing of app limited periodsPeter Lei2025-07-211-1/+1
| | | | | | | | | | | Use the correct variable in the correct way. The app limited period is cleared when gp_seq is greater than or equal to cleared_app_ack_seq. Reviewed by: rrs, tuexen, Nick Banks MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51441
* tcp: use a single counter for limiting the RST rateMichael Tuexen2025-07-213-23/+23
| | | | | | | | | | Using two counters does not provide any benefit, but it provides an externally observable signal whether there is a listening port. Reviewed by: Nick Banks, Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51440
* tcp rack: remove duplicate header includePeter Lei2025-07-211-1/+0
| | | | | | Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp rack: fix sendmap app limited count trackingPeter Lei2025-07-211-3/+6
| | | | | | | | | | | | | | | rc_app_limited_cnt is an internal counter on the rack structure that tracks the number of sendmap entries that have the RACK_APP_LIMITED flag set. These entries gate goodput measurements. The counter is reported in a number of blackbox logging events. When a sendmap entry which has the RACK_APP_LIMITED flag set is cloned, the counter was not being maintained properly. While here, cleanup the counter check when a sendmap entry with the flag set is freed which previously hid this issue. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp rack: fix typos and whitespace changesPeter Lei2025-07-211-15/+14
| | | | | | | | No functional changes intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp rack: simplify expressionPeter Lei2025-06-261-1/+1
| | | | | | Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp: remove references to Lock(b)Peter Lei2025-06-262-4/+0
| | | | | | Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp rack: move unused field from struct tcp_rackPeter Lei2025-06-261-1/+0
| | | | | | Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* Fix a warning in the rack stack.Randall Stewart2025-06-181-11/+17
| | | | | | There is an initialization warning where error may not be set when logging extended BBlogs. Lets fix this so error is init'd to zero so we won't have a warning.
* tcp: provide sysctl for the maximum retransmission timeoutGleb Smirnoff2025-06-172-2/+2
| | | | | Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D50891
* TCP without LRO doing static pacing does not always pace as expected.Randall Stewart2025-06-151-20/+36
| | | | | | | | cause a surprise extra packet i.e. the burst limit being overstepped and another one where the burst limit is under stepped. This patch fixes those errors. Reported by: tuexen Reviewed by: tuexen Differential Revision: <https://reviews.freebsd.org/D50858>
* tcp: clear blackbox logging unionPeter Lei2025-04-042-34/+34
| | | | | | | | | | | Clear the black box logging containing union rather than the u_bbr structure for clarity and consistency. Currently u_bbr, u_raw, and u64_raw are the same size. No functional change intended. Reviewed by: tuexen MFC after: 3 days Sponsored by: Netflix, Inc.
* tcp rack: cleanup storing values for beta and beta_ecnMichael Tuexen2025-03-312-28/+24
| | | | | | | | | | | | | | | | | | | beta and beta_ecn were stored using a variable of type struct newreno in struct rack_control. Later, struct newreno was extended and now contains several more fields. This results in a memory inefficiency and also in copying around uninitialized memory. This patch fixes this by storing beta and beta_ecn individually in struct rack_control. Please note that the newreno_flags field was only stored and never used. Therefore, this is not stored anymore in struct rack_control. No functional change intended. CID: 1523796 Reviewed by: rrs MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D49578
* tcp rack: cleanup accounting conditional checksPeter Lei2025-02-251-30/+0
| | | | | | | | No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* tcp rack: remove dead codePeter Lei2025-02-252-56/+1
| | | | | | Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc.
* TCP BBR: remove dead codeMichael Tuexen2025-01-091-4/+0
| | | | | | | | | | No functional change intended. Reviewed by: Peter Lei, rrs (earlier version) CID: 1523802 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48341
* TCP RACK: don't log an uninitialized valueMichael Tuexen2025-01-081-2/+3
| | | | | | | | | | | reduce is uninitialized, if the code path for logging is reached via goto old_method;. Reviewed by: rrs, Peter Lei CID: 1557359 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48346
* TCP RACK: fix TCP_RACK_PACING_BETA socket optionMichael Tuexen2025-01-061-8/+22
| | | | | | | | | | | | Bring back the code, which was accidentally removed. While there, indent a comment correctly. Reviewed by: rrs CID: 1540026 Fixes: e18b97bd63a8 ("Update to bring the rack stack with all its fixes in.") MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48340
* TCP BBR: remove dead codeMichael Tuexen2025-01-061-8/+0
| | | | | | | | | | No functional change intended. Reviewed by: rrs CID: 1523808 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48338
* TCP BBR: remove dead codeMichael Tuexen2025-01-061-3/+0
| | | | | | | | | | | bw is unsigned and not zero. So it cannot be smaller than 1. No functional change intended. Reviewed by: rrs, cc CID: 1523791 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48323
* TCP RACK: fix TCP fast openMichael Tuexen2025-01-061-4/+5
| | | | | | | | | | | | | | | | | Do not jump to a place in the code, which requires several variables to be set (segsize, minseg, idle, len, sb_offset), which is not true. To avoid using these variables, start the HPTS timer explicitly. This fix only applies to the client side using TCP fast open. Approved by: rrs CID: 1523766 CID: 1523770 CID: 1523786 CID: 1523801 CID: 1523809 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48322
* TCP RACK: remove variable with is only initialized and not changedMichael Tuexen2025-01-041-6/+0
| | | | | | | | | | | | | minslot is initialized to 0 and never changed. It is not clear to me under which condition minslot should be set to which value. Therefore, remove it and the code checking that it is not zero. No functional change intended. Reviewed by: rrs CID: 1523812 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48321
* TCP BBR: remove code which is not neededMichael Tuexen2025-01-041-4/+0
| | | | | | | | | | | | rc_bbr_substate is a 3-bit unsigned int, so it can't be larger than or equal to 8. The wrap around already happens. No functional change intended. Reviewed by: rrs CID: 1523795 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48320
* TCP BBR: simplify expressionMichael Tuexen2025-01-041-1/+1
| | | | | | | | | | | | There is no need to check partially for bbr->r_ctl.crte being NULL, since this can't be true in this path. No functional change intended. Reviewed by: rrs CID: 1523810 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48312
* TCP RACK: remove code that cannot be reachedMichael Tuexen2025-01-041-6/+0
| | | | | | | | | | No functional change intended. Reviewed by: rrs CID: 1523797 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48301
* TCP BBR: fix integer overflowMichael Tuexen2025-01-031-1/+1
| | | | | | | | | | Use 64-bit arithmetic. Reviewed by: rrs CID: 1523806 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48302
* TCP BBR: simplify expressionMichael Tuexen2025-01-031-1/+1
| | | | | | | | | | | rsm cannot be NULL, when calling bbr_update_bbr_info(). So no need to check partially for it. No functional change intended. Reviewed by: rrs CID: 1523803 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48293
* TCP RACK: remove un-needed assignmentMichael Tuexen2025-01-031-1/+0
| | | | | | | | | | No functional change intended. Reviewed by: rrs CID: 1523768 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48292
* TCP RACK: simplify conditionMichael Tuexen2025-01-021-1/+1
| | | | | | | | | | It is already known that rsm != NULL, so no need to check for it. Reviewed by: rrs CID: 1523815 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48282
* TCP BBR: do not log an uninitialized valueMichael Tuexen2025-01-021-1/+1
| | | | | | | | Reviewed by: rrs CID: 1523789 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48281
* TCP RACK: avoid using uninitialized tot_idle variableMichael Tuexen2025-01-011-1/+2
| | | | | | | | Reviewed by: rrs CID: 1540027 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48277
* TCP BBR: remove code which is never executedMichael Tuexen2025-01-011-2/+0
| | | | | | | | | | USEC_2_TICKS() returns at least 1. Reviewed by: rrs CID: 1523775 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D4827
* TCP BBR: fix condition when sending a tail loss probeMichael Tuexen2024-12-311-1/+1
| | | | | | | | Reviewed by: rrs CID: 1523793 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48274
* TCP RACK: add commentMichael Tuexen2024-12-311-0/+1
| | | | | | | | | | Indicate that the missing of the break is intentionally. Reviewed by: rrs CID: 1523782 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48273
* TCP BBR: fix getsockopt() for TCP_BBR_USEDEL_RATEMichael Tuexen2024-12-311-2/+6
| | | | | | | | | | | | Actually implement the IPPROTO_TCP-level socket option TCP_BBR_USEDEL_RATE. Reviewed by: rrs CID: 1523813 CID: 1523814 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48261
* TCP RACK: don't use an uninitialized variableMichael Tuexen2024-12-311-0/+1
| | | | | | | | | | | | | | When storing the old beta values in rack_swap_beta_values(), ensure that the newreno_flags field is initialized appropriately instead of using an uninitialized value. Since the stored newreno_flags aren't actually used, this fix should not have any functional change. Reviewed by: rrs CID: 1523796 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48260
* TCP RACK, BBR: cleanup of ctf_process_inbound_raw()Michael Tuexen2024-12-311-22/+7
| | | | | | | | | | | | Instead of dealing with ifp == NULL, which should never happen, assume that this is not true. Use KASSERT to make this clear. No functional change intended. Reviewed by: glebius, rrs CID: 1523767 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48258
* TCP RACK, BBR: ensure return value is always ininitializedMichael Tuexen2024-12-301-1/+1
| | | | | | | | | | | Do not return an uninitialized value from ctf_do_queued_segments() in case no packets are actually processed (all are skipped). Reviewed by: rrs CID: 1523774 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48217
* TCP RACK: remove redundant checkMichael Tuexen2024-12-301-1/+1
| | | | | | | | | | No functional change intended. Reviewed by: rrs CID: 1523811 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48216