aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/cc/cc.c
Commit message (Collapse)AuthorAgeFilesLines
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-4/+6
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Add support for the experimental Internet-Draft "TCP Alternative Backoff withLawrence Stewart2018-03-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326272
* Fix the case for some sysctl descriptions.Brad Davis2016-07-261-3/+3
| | | | | | | Reviewed by: gnn Notes: svn path=/head/; revision=303343
* Rename netinet/tcp_cc.h to netinet/cc/cc.h.Gleb Smirnoff2016-01-271-1/+1
| | | | | | | Discussed with: lstewart Notes: svn path=/head/; revision=294931
* - Rename cc.h to more meaningful tcp_cc.h.Gleb Smirnoff2016-01-211-1/+2
| | | | | | | | - Declare it a kernel only include, which it already is. - Don't include tcp.h implicitly from tcp_cc.h Notes: svn path=/head/; revision=294535
* Cleanup TCP files from unnecessary interface related includes.Gleb Smirnoff2016-01-211-2/+1
| | | | Notes: svn path=/head/; revision=294534
* Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed.Gleb Smirnoff2014-11-071-1/+2
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=274225
* The SYSCTL data pointers can come from userspace and must not beHans Petter Selasky2014-10-281-28/+25
| | | | | | | | | | | | | directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273773
* Preserve limitation of "TCP_CA_NAME_MAX" when matching the algorithmHans Petter Selasky2014-10-271-1/+2
| | | | | | | | | | name. MFC after: 3 days Suggested by: gnn @ Notes: svn path=/head/; revision=273740
* Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a badHans Petter Selasky2014-10-271-5/+7
| | | | | | | | | | | string comparison. MFC after: 3 days Reported by: Jukka Ukkonen <jau789@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273733
* Fix string length argument passed to "sysctl_handle_string()" so thatHans Petter Selasky2014-08-101-2/+2
| | | | | | | | | | | the complete string is returned by the function and not just only one byte. PR: 192544 MFC after: 2 weeks Notes: svn path=/head/; revision=269777
* Use the full and proper company name for Swinburne University of TechnologyLawrence Stewart2011-04-121-7/+8
| | | | | | | | | | | throughout the source tree. Requested by: Grenville Armitage, Director of CAIA at Swinburne University of Technology MFC after: 3 days Notes: svn path=/head/; revision=220560
* An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK when aLawrence Stewart2011-01-231-4/+21
| | | | | | | | | | | | | | | | | | | | | | | write to the buffer causes it to overflow. We therefore can't hold the CC list rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_AUTOEXTEND. Switch to a fixed length sbuf which should be of sufficient size except in the very unlikely event that the sysctl is being processed as one or more new algorithms are loaded. If that happens, we accept the race and may fail the sysctl gracefully if there is insufficient room to print the names of all the algorithms. This should address a WITNESS warning and the potential panic that would occur if the sbuf call to malloc did sleep whilst holding the CC list rwlock. Sponsored by: FreeBSD Foundation Reported by: Nick Hibma Reviewed by: bz MFC after: 3 weeks X-MFC with: r215166 Notes: svn path=/head/; revision=217748
* Make the CC framework more VIMAGE friendly by adding the machinery to allowLawrence Stewart2010-11-161-30/+28
| | | | | | | | | | | | | | vnets to select their own default CC algorithm independent of each other and the base system. If the base system or a vnet has set a default which gets unloaded, we reset that netstack's default to NewReno. Sponsored by: FreeBSD Foundation Tested by: Mikolaj Golub <to.my.trociny at gmail com> Reviewed by: bz (briefly) MFC after: 3 months Notes: svn path=/head/; revision=215395
* - Querying the default CC algo is more common than setting it and the functionLawrence Stewart2010-11-161-3/+2
| | | | | | | | | | | | | is small, so there is no good reason not to declare the buffer at the top. - Fix a whitespace nit. Sponsored by: FreeBSD Foundation MFC after: 11 weeks X-MFC with: r215166 Notes: svn path=/head/; revision=215393
* Move protocol specific implementation detail out of the core CC framework.Lawrence Stewart2010-11-161-48/+6
| | | | | | | | | | Sponsored by: FreeBSD Foundation Tested by: Mikolaj Golub <to.my.trociny at gmail com> MFC after: 11 weeks X-MFC with: r215166 Notes: svn path=/head/; revision=215392
* On CC algorithm module unload, we walk the list of active TCP control blocks.Lawrence Stewart2010-11-161-24/+35
| | | | | | | | | | | | | | | | | | Any found to be using the algorithm that is about to go away are switched back to NewReno to avoid leaving dangling pointers which would trigger a panic. For VIMAGE kernels, there is a list per vnet to walk, yet the implementation was only examining one of the vnet lists. Fix the implementation of the above feature for VIMAGE kernels by looping through all active TCP control blocks across all vnets. Sponsored by: FreeBSD Foundation Tested by: Mikolaj Golub <to.my.trociny at gmail com> Reviewed by: bz (briefly) MFC after: 11 weeks Notes: svn path=/head/; revision=215391
* cc_init() should only be run once on system boot, but with VIMAGE kernels itLawrence Stewart2010-11-161-2/+4
| | | | | | | | | | | | | | | | | | | runs on boot and each time a vnet jail is created. Running cc_init() multiple times results in a panic when attempting to initialise the cc_list lock again, and so r215166 effectively broke the use of vnet jails. Switch to using a SYSINIT to run cc_init() on boot. CC algorithm modules loaded on boot register in the same SI_SUB_PROTO_IFATTACHDOMAIN category as is used in this patch, so cc_init() is run at SI_ORDER_FIRST to ensure the framework is initialised before module registration is attempted. Sponsored by: FreeBSD Foundation Reported and tested by: Mikolaj Golub <to.my.trociny at gmail com> MFC after: 11 weeks X-MFC with: r215166 Notes: svn path=/head/; revision=215377
* This commit marks the first formal contribution of the "Five New TCP CongestionLawrence Stewart2010-11-121-0/+340
Control Algorithms for FreeBSD" FreeBSD Foundation funded project. More details about the project are available at: http://caia.swin.edu.au/freebsd/5cc/ - Add a KPI and supporting infrastructure to allow modular congestion control algorithms to be used in the net stack. Algorithms can maintain per-connection state if required, and connections maintain their own algorithm pointer, which allows different connections to concurrently use different algorithms. The TCP_CONGESTION socket option can be used with getsockopt()/setsockopt() to programmatically query or change the congestion control algorithm respectively from within an application at runtime. - Integrate the framework with the TCP stack in as least intrusive a manner as possible. Care was also taken to develop the framework in a way that should allow integration with other congestion aware transport protocols (e.g. SCTP) in the future. The hope is that we will one day be able to share a single set of congestion control algorithm modules between all congestion aware transport protocols. - Introduce a new congestion recovery (TF_CONGRECOVERY) state into the TCP stack and use it to decouple the meaning of recovery from a congestion event and recovery from packet loss (TF_FASTRECOVERY) a la RFC2581. ECN and delay based congestion control protocols don't generally need to recover from packet loss and need a different way to note a congestion recovery episode within the stack. - Remove the net.inet.tcp.newreno sysctl, which simplifies some portions of code and ensures the stack always uses the appropriate mechanisms for recovering from packet loss during a congestion recovery episode. - Extract the NewReno congestion control algorithm from the TCP stack and massage it into module form. NewReno is always built into the kernel and will remain the default algorithm for the forseeable future. Implementations of additional different algorithms will become available in the near future. - Bump __FreeBSD_version to 900025 and note in UPDATING that rebuilding code that relies on the size of "struct tcpcb" is required. Many thanks go to the Cisco University Research Program Fund at Community Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work at the Centre for Advanced Internet Architectures, Swinburne University of Technology is greatly appreciated. In collaboration with: David Hayes <dahayes at swin edu au> and Grenville Armitage <garmitage at swin edu au> Sponsored by: Cisco URP, FreeBSD Foundation Reviewed by: rpaulo Tested by: David Hayes (and many others over the years) MFC after: 3 months Notes: svn path=/head/; revision=215166