Skip to content

Commit 2349262

Browse files
yuchungchengdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 05cf807 commit 2349262

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

include/net/tcp.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,17 +1039,6 @@ static inline __u32 tcp_max_tso_deferred_mss(const struct tcp_sock *tp)
10391039
return 3;
10401040
}
10411041

1042-
/* Slow start with delack produces 3 packets of burst, so that
1043-
* it is safe "de facto". This will be the default - same as
1044-
* the default reordering threshold - but if reordering increases,
1045-
* we must be able to allow cwnd to burst at least this much in order
1046-
* to not pull it back when holes are filled.
1047-
*/
1048-
static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp)
1049-
{
1050-
return tp->reordering;
1051-
}
1052-
10531042
/* Returns end sequence number of the receiver's advertised window */
10541043
static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
10551044
{

net/ipv4/tcp_input.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,16 +2252,6 @@ static void tcp_update_scoreboard(struct sock *sk, int fast_rexmit)
22522252
}
22532253
}
22542254

2255-
/* CWND moderation, preventing bursts due to too big ACKs
2256-
* in dubious situations.
2257-
*/
2258-
static 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-
22652255
static bool tcp_tsopt_ecr_before(const struct tcp_sock *tp, u32 when)
22662256
{
22672257
return tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
@@ -2410,7 +2400,6 @@ static bool tcp_try_undo_recovery(struct sock *sk)
24102400
/* Hold old state until something *above* high_seq
24112401
* is ACKed. For Reno it is MUST to prevent false
24122402
* fast retransmits (RFC2582). SACK TCP is safe. */
2413-
tcp_moderate_cwnd(tp);
24142403
if (!tcp_any_retrans_done(sk))
24152404
tp->retrans_stamp = 0;
24162405
return true;

0 commit comments

Comments
 (0)