aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/cc/cc.h
Commit message (Collapse)AuthorAgeFilesLines
* tcp cc: re-organize newreno functions into parts that can be re-usedCheng Cui2024-09-171-0/+3
| | | | | Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D46046
* tcp cc: clean up some un-used cc_var flagsCheng Cui2024-08-151-4/+4
| | | | | Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D46299
* tcp cc: remove non-working sctp supportMichael Tuexen2024-07-281-10/+1
| | | | | | | | | | | | As suggested by lstewart, remove the non-working SCTP support in the TCP congestion control modules. SCTP has a similar functionality (although not using kernel loadable modules), on which the TCP stuff was built on, but the integration was never done. No functional change intended. Reviewed by: Peter Lei, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46142
* tcp: retain some CC signals outside of kernel scopeRichard Scheffenegger2024-02-241-1/+3
| | | | | | | | | | Summary: fix build error after f74352fbcf15341accaf5a92240871f98323215d Reviewers: #transport! Subscribers: imp, melifaro, glebius Differential Revision: https://reviews.freebsd.org/D44066
* tcp: use enum for all congestion control signalsRichard Scheffenegger2024-02-241-21/+21
| | | | | | | | | | | | | Facilitate easier troubleshooting by enumerating all congestion control signals. Typecast the enum to int, when a congestion control module uses private signals. No external change. Reviewed By: glebius, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43838
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* tcp: embed inpcb into tcpcbGleb Smirnoff2022-12-071-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* tcp: Make all references to CUBIC uppercaseRichard Scheffenegger2022-09-131-1/+1
| | | | | | | | | | | Consistently refer to the CUBIC congestion control mechanism in uppercase throughout all comments. No functional change. Reviewed By: #transport, tuexen, mav, guest-ccui, emaste Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D36547
* tcp: Congestion control move to using reference counting.Randall Stewart2022-02-211-0/+11
| | | | | | | | | | | | | | | | | | | | | | In the transport call on 12/3 Gleb asked to move the CC modules towards using reference counting to prevent folks from unloading a module in use. It was also agreed that Michael would do a user space utility like tcp_drop that could be used to move all connections that are using a specific CC to some other CC. This is the half I committed to doing, making it so that we maintain a refcount on a cc module every time a pcb refers to it and decrementing that every time a pcb no longer uses a cc module. This also helps us simplify the whole unloading process by getting rid of tcp_ccunload() which munged through all the tcb's. Instead we mark a module as being removed and prevent further references to it. We also make sure that if a module is marked as being removed it cannot be made as the default and also the opposite of that, if its a default it fails and does not mark it as being removed. Reviewed by: Michael Tuexen, Gleb Smirnoff Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D33249
* tcp: Add hystart++ to our cubic implementation.Randall Stewart2022-02-071-0/+12
| | | | | | | | | | | | As promised to the transport call on 11/4/22 here is an implementation of hystart++ for cubic. It also cleans up the tcp_congestion function to have a better name. Common variables are moved into the general cc.h structure so that both cubic and newreno can use them for hystart++ Reviewed by: Michael Tuexen, Richard Scheffenegger Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D33035
* tcp: Congestion control cleanup.Randall Stewart2021-11-111-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: HEADS UP read the note below if your kernel config is not including GENERIC!! This patch does a bit of cleanup on TCP congestion control modules. There were some rather interesting surprises that one could get i.e. where you use a socket option to change from one CC (say cc_cubic) to another CC (say cc_vegas) and you could in theory get a memory failure and end up on cc_newreno. This is not what one would expect. The new code fixes this by requiring a cc_data_sz() function so we can malloc with M_WAITOK and pass in to the init function preallocated memory. The CC init is expected in this case *not* to fail but if it does and a module does break the "no fail with memory given" contract we do fall back to the CC that was in place at the time. This also fixes up a set of common newreno utilities that can be shared amongst other CC modules instead of the other CC modules reaching into newreno and executing what they think is a "common and understood" function. Lets put these functions in cc.c and that way we have a common place that is easily findable by future developers or bug fixers. This also allows newreno to evolve and grow support for its features i.e. ABE and HYSTART++ without having to dance through hoops for other CC modules, instead both newreno and the other modules just call into the common functions if they desire that behavior or roll there own if that makes more sense. Note: This commit changes the kernel configuration!! If you are not using GENERIC in some form you must add a CC module option (one of CC_NEWRENO, CC_VEGAS, CC_CUBIC, CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than one defined as well if you desire. Note that if you create a kernel configuration that does not define a congestion control module and includes INET or INET6 the kernel compile will break. Also you need to define a default, generic adds 'options CC_DEFAULT=\"newreno\" but you can specify any string that represents the name of the CC module (same names that show up in the CC module list under net.inet.tcp.cc). If you fail to add the options CC_DEFAULT in your kernel configuration the kernel build will also break. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc. RELNOTES:YES Differential Revision: https://reviews.freebsd.org/D32693
* tcp: Add hystart-plus to cc_newreno and rack.Randall Stewart2021-10-221-0/+9
| | | | | | | | | | | | | | | TCP Hystart draft version -03: https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-hystartplusplus Is a new version of hystart that allows one to carefully exit slow start if the RTT spikes too much. The newer version has a slower-slow-start so to speak that then kicks in for five round trips. To see if you exited too early, if not into congestion avoidance. This commit will add that feature to our newreno CC and add the needed bits in rack to be able to enable it. Reviewed by: tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D32373
* This brings into sync FreeBSD with the netflix versions of rack and bbr.Randall Stewart2021-05-061-1/+6
| | | | | | | | | | | | This fixes several breakages (panics) since the tcp_lro code was committed that have been reported. Quite a few new features are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the largest). There is also support for ack-war prevention. Documents comming soon on rack.. Sponsored by: Netflix Reviewed by: rscheff, mtuexen Differential Revision: https://reviews.freebsd.org/D30036
* cc_mod: remove unused CCF_DELACK definitionRichard Scheffenegger2020-09-101-1/+1
| | | | | | | | | | | | | | | | | During the DCTCP improvements, use of CCF_DELACK was removed. This change is just to rename the unused flag bit to prevent use of it, without also re-implementing the tcp_input and tcp_output interfaces. No functional change. Reviewed by: chengc_netapp.com, tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26181 Notes: svn path=/head/; revision=365546
* Make use of the stats(3) framework in the TCP stack.Edward Tomasz Napierala2019-12-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to retrieve per-connection statistical information such as the receive window size, RTT, or goodput, using a newly added TCP_STATS getsockopt(3) option, and extract them using the stats_voistat_fetch(3) API. See the net/tcprtt port for an example consumer of this API. Compared to the existing TCP_INFO system, the main differences are that this mechanism is easy to extend without breaking ABI, and provides statistical information instead of raw "snapshots" of values at a given point in time. stats(3) is more generic and can be used in both userland and the kernel. Reviewed by: thj Tested by: thj Obtained from: Netflix Relnotes: yes Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D20655 Notes: svn path=/head/; revision=355304
* Revert r331567 CC Cubic: fix underflow for cubic_cwnd()Hiren Panchasara2018-12-151-2/+0
| | | | | | | | | | | | This change is causing TCP connections using cubic to hang. Need to dig more to find exact cause and fix it. Reported by: tj at mrsk dot me, Matt Garber (via twitter) Discussed with: sbruno (previously), allanjude, cperciva MFC after: 3 days Notes: svn path=/head/; revision=342127
* Limit option_len for the TCP_CCALGOOPT.Michael Tuexen2018-11-301-0/+2
| | | | | | | | | | | | | Limiting the length to 2048 bytes seems to be acceptable, since the values used right now are using 8 bytes. Reviewed by: glebius, bz, rrs MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18366 Notes: svn path=/head/; revision=341335
* CC Cubic: fix underflow for cubic_cwnd()Sean Bruno2018-03-261-0/+2
| | | | | | | | | | | | | Singed calculations in cubic_cwnd() can result in negative cwnd value which is then cast to an unsigned value. Values less than 1 mss are generally bad for other parts of the code, also fixed. Submitted by: Jason Eggleston <jason@eggnet.com> Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14141 Notes: svn path=/head/; revision=331567
* Add support for the experimental Internet-Draft "TCP Alternative Backoff withLawrence Stewart2018-03-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ECN (ABE)" proposal to the New Reno congestion control algorithm module. ABE reduces the amount of congestion window reduction in response to ECN-signalled congestion relative to the loss-inferred congestion response. More details about ABE can be found in the Internet-Draft: https://tools.ietf.org/html/draft-ietf-tcpm-alternativebackoff-ecn The implementation introduces four new sysctls: - net.inet.tcp.cc.abe defaults to 0 (disabled) and can be set to non-zero to enable ABE for ECN-enabled TCP connections. - net.inet.tcp.cc.newreno.beta and net.inet.tcp.cc.newreno.beta_ecn set the multiplicative window decrease factor, specified as a percentage, applied to the congestion window in response to a loss-based or ECN-based congestion signal respectively. They default to the values specified in the draft i.e. beta=50 and beta_ecn=80. - net.inet.tcp.cc.abe_frlossreduce defaults to 0 (disabled) and can be set to non-zero to enable the use of standard beta (50% by default) when repairing loss during an ECN-signalled congestion recovery episode. It enables a more conservative congestion response and is provided for the purposes of experimentation as a result of some discussion at IETF 100 in Singapore. The values of beta and beta_ecn can also be set per-connection by way of the TCP_CCALGOOPT TCP-level socket option and the new CC_NEWRENO_BETA or CC_NEWRENO_BETA_ECN CC algo sub-options. Submitted by: Tom Jones <tj@enoti.me> Tested by: Tom Jones <tj@enoti.me>, Grenville Armitage <garmitage@swin.edu.au> Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D11616 Notes: svn path=/head/; revision=331214
* Fix a variety of cosmetic typos and misspellingsConrad Meyer2017-01-151-1/+1
| | | | | | | | | | | No functional change. PR: 216096, 216097, 216098, 216101, 216102, 216106, 216109, 216110 Reported by: Bulat <bltsrc at mail.ru> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312235
* Pass the number of segments coalesced by LRO up the stack by repurposing theLawrence Stewart2016-08-251-0/+1
| | | | | | | | | | | | | tso_segsz pkthdr field during RX processing, and use the information in TCP for more correct accounting and as a congestion control input. This is only a start, and an audit of other uses for the data is left as future work. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D7564 Notes: svn path=/head/; revision=304803
* Rename netinet/tcp_cc.h to netinet/cc/cc.h.Gleb Smirnoff2016-01-271-0/+178
Discussed with: lstewart Notes: svn path=/head/; revision=294931