aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2016-03-30 17:54:20 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-02 20:11:43 -0400
commit2349262397b89a421adfd142aad2a7dd33710f26 (patch)
tree0c580661c15c642185b5d3205f7507fe77051a34 /net/ipv4/tcp_input.c
parent05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf (diff)
tcp: remove cwnd moderation after recovery
For non-SACK connections, cwnd is lowered to inflight plus 3 packets when the recovery ends. This is an optional feature in the NewReno RFC 2582 to reduce the potential burst when cwnd is "re-opened" after recovery and inflight is low. This feature is questionably effective because of PRR: when the recovery ends (i.e., snd_una == high_seq) NewReno holds the CA_Recovery state for another round trip to prevent false fast retransmits. But if the inflight is low, PRR will overwrite the moderated cwnd in tcp_cwnd_reduction() later regardlessly. So if a receiver responds bogus ACKs (i.e., acking future data) to speed up transfer after recovery, it can only induce a burst up to a window worth of data packets by acking up to SND.NXT. A restart from (short) idle or receiving streched ACKs can both cause such bursts as well. On the other hand, if the recovery ends because the sender detects the losses were spurious (e.g., reordering). This feature unconditionally lowers a reverted cwnd even though nothing was lost. By principle loss recovery module should not update cwnd. Further pacing is much more effective to reduce burst. Hence this patch removes the cwnd moderation feature. v2 changes: revised commit message on bogus ACKs and burst, and missing signature Signed-off-by: Matt Mathis <mattmathis@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e6e65f79ade8..f87b84a75691 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2252,16 +2252,6 @@ static void tcp_update_scoreboard(struct sock *sk, int fast_rexmit)
2252 } 2252 }
2253} 2253}
2254 2254
2255/* CWND moderation, preventing bursts due to too big ACKs
2256 * in dubious situations.
2257 */
2258static inline void tcp_moderate_cwnd(struct tcp_sock *tp)
2259{
2260 tp->snd_cwnd = min(tp->snd_cwnd,
2261 tcp_packets_in_flight(tp) + tcp_max_burst(tp));
2262 tp->snd_cwnd_stamp = tcp_time_stamp;
2263}
2264
2265static bool tcp_tsopt_ecr_before(const struct tcp_sock *tp, u32 when) 2255static bool tcp_tsopt_ecr_before(const struct tcp_sock *tp, u32 when)
2266{ 2256{
2267 return tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && 2257 return tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
@@ -2410,7 +2400,6 @@ static bool tcp_try_undo_recovery(struct sock *sk)
2410 /* Hold old state until something *above* high_seq 2400 /* Hold old state until something *above* high_seq
2411 * is ACKed. For Reno it is MUST to prevent false 2401 * is ACKed. For Reno it is MUST to prevent false
2412 * fast retransmits (RFC2582). SACK TCP is safe. */ 2402 * fast retransmits (RFC2582). SACK TCP is safe. */
2413 tcp_moderate_cwnd(tp);
2414 if (!tcp_any_retrans_done(sk)) 2403 if (!tcp_any_retrans_done(sk))
2415 tp->retrans_stamp = 0; 2404 tp->retrans_stamp = 0;
2416 return true; 2405 return true;