diff options
author | David S. Miller <davem@davemloft.net> | 2015-07-10 00:22:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-10 00:22:53 +0300 |
commit | 986ca37eaedc9bc3045a91cc32e6e7427bd87b5d (patch) | |
tree | db19bf4b5ef34ff71a94b9b50ac58875734fedd1 /include/net/tcp.h | |
parent | 1007f59dce53a22cba164f854d7bdc171c85dc79 (diff) | |
parent | b20a3fa30a281b52b2576b509efbe5cd47a5a79b (diff) | |
download | linux-986ca37eaedc9bc3045a91cc32e6e7427bd87b5d.tar.xz |
Merge branch 'tcp-in-slow-start'
Yuchung Cheng says:
====================
tcp: fixes some congestion control corner cases
This patch series fixes corner cases of TCP congestion control.
First issue is to avoid continuing slow start when cwnd reaches ssthresh.
Second issue is incorrectly processing order of congestion state and
cwnd update when entering fast recovery or undoing cwnd.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 950cfecaad3c..364426a2be5a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -989,6 +989,11 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) #define TCP_INFINITE_SSTHRESH 0x7fffffff +static inline bool tcp_in_slow_start(const struct tcp_sock *tp) +{ + return tp->snd_cwnd < tp->snd_ssthresh; +} + static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) { return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; @@ -1065,7 +1070,7 @@ static inline bool tcp_is_cwnd_limited(const struct sock *sk) const struct tcp_sock *tp = tcp_sk(sk); /* If in slow start, ensure cwnd grows to twice what was ACKed. */ - if (tp->snd_cwnd <= tp->snd_ssthresh) + if (tcp_in_slow_start(tp)) return tp->snd_cwnd < 2 * tp->max_packets_out; return tp->is_cwnd_limited; |