aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnmol Sarma <me@anmolsarma.in>2017-06-03 08:10:54 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-05 10:53:24 -0400
commit1e0ce2a1ee0d5fb334e82e80600f1e8e77df525c (patch)
tree58227cc33cc39d0b72bcbf0abcd76ec357d114b1
parent6dc06c08bef1c746ff8da33dab677cfbacdcad32 (diff)
net: Update TCP congestion control documentation
Update tcp.txt to fix mandatory congestion control ops and default CCA selection. Also, fix comment in tcp.h for undo_cwnd. Signed-off-by: Anmol Sarma <me@anmolsarma.in> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/tcp.txt31
-rw-r--r--include/net/tcp.h2
2 files changed, 14 insertions, 19 deletions
diff --git a/Documentation/networking/tcp.txt b/Documentation/networking/tcp.txt
index bdc4c0db51e1..9c7139d57e57 100644
--- a/Documentation/networking/tcp.txt
+++ b/Documentation/networking/tcp.txt
@@ -1,7 +1,7 @@
1TCP protocol 1TCP protocol
2============ 2============
3 3
4Last updated: 9 February 2008 4Last updated: 3 June 2017
5 5
6Contents 6Contents
7======== 7========
@@ -29,18 +29,19 @@ As of 2.6.13, Linux supports pluggable congestion control algorithms.
29A congestion control mechanism can be registered through functions in 29A congestion control mechanism can be registered through functions in
30tcp_cong.c. The functions used by the congestion control mechanism are 30tcp_cong.c. The functions used by the congestion control mechanism are
31registered via passing a tcp_congestion_ops struct to 31registered via passing a tcp_congestion_ops struct to
32tcp_register_congestion_control. As a minimum name, ssthresh, 32tcp_register_congestion_control. As a minimum, the congestion control
33cong_avoid must be valid. 33mechanism must provide a valid name and must implement either ssthresh,
34cong_avoid and undo_cwnd hooks or the "omnipotent" cong_control hook.
34 35
35Private data for a congestion control mechanism is stored in tp->ca_priv. 36Private data for a congestion control mechanism is stored in tp->ca_priv.
36tcp_ca(tp) returns a pointer to this space. This is preallocated space - it 37tcp_ca(tp) returns a pointer to this space. This is preallocated space - it
37is important to check the size of your private data will fit this space, or 38is important to check the size of your private data will fit this space, or
38alternatively space could be allocated elsewhere and a pointer to it could 39alternatively, space could be allocated elsewhere and a pointer to it could
39be stored here. 40be stored here.
40 41
41There are three kinds of congestion control algorithms currently: The 42There are three kinds of congestion control algorithms currently: The
42simplest ones are derived from TCP reno (highspeed, scalable) and just 43simplest ones are derived from TCP reno (highspeed, scalable) and just
43provide an alternative the congestion window calculation. More complex 44provide an alternative congestion window calculation. More complex
44ones like BIC try to look at other events to provide better 45ones like BIC try to look at other events to provide better
45heuristics. There are also round trip time based algorithms like 46heuristics. There are also round trip time based algorithms like
46Vegas and Westwood+. 47Vegas and Westwood+.
@@ -49,21 +50,15 @@ Good TCP congestion control is a complex problem because the algorithm
49needs to maintain fairness and performance. Please review current 50needs to maintain fairness and performance. Please review current
50research and RFC's before developing new modules. 51research and RFC's before developing new modules.
51 52
52The method that is used to determine which congestion control mechanism is 53The default congestion control mechanism is chosen based on the
53determined by the setting of the sysctl net.ipv4.tcp_congestion_control. 54DEFAULT_TCP_CONG Kconfig parameter. If you really want a particular default
54The default congestion control will be the last one registered (LIFO); 55value then you can set it using sysctl net.ipv4.tcp_congestion_control. The
55so if you built everything as modules, the default will be reno. If you 56module will be autoloaded if needed and you will get the expected protocol. If
56build with the defaults from Kconfig, then CUBIC will be builtin (not a 57you ask for an unknown congestion method, then the sysctl attempt will fail.
57module) and it will end up the default.
58 58
59If you really want a particular default value then you will need 59If you remove a TCP congestion control module, then you will get the next
60to set it with the sysctl. If you use a sysctl, the module will be autoloaded
61if needed and you will get the expected protocol. If you ask for an
62unknown congestion method, then the sysctl attempt will fail.
63
64If you remove a tcp congestion control module, then you will get the next
65available one. Since reno cannot be built as a module, and cannot be 60available one. Since reno cannot be built as a module, and cannot be
66deleted, it will always be available. 61removed, it will always be available.
67 62
68How the new TCP output machine [nyi] works. 63How the new TCP output machine [nyi] works.
69=========================================== 64===========================================
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 38a7427ae902..be6223c586fa 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -924,7 +924,7 @@ struct tcp_congestion_ops {
924 void (*cwnd_event)(struct sock *sk, enum tcp_ca_event ev); 924 void (*cwnd_event)(struct sock *sk, enum tcp_ca_event ev);
925 /* call when ack arrives (optional) */ 925 /* call when ack arrives (optional) */
926 void (*in_ack_event)(struct sock *sk, u32 flags); 926 void (*in_ack_event)(struct sock *sk, u32 flags);
927 /* new value of cwnd after loss (optional) */ 927 /* new value of cwnd after loss (required) */
928 u32 (*undo_cwnd)(struct sock *sk); 928 u32 (*undo_cwnd)(struct sock *sk);
929 /* hook for packet ack accounting (optional) */ 929 /* hook for packet ack accounting (optional) */
930 void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample); 930 void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample);