提交 67d4120a 编写于 作者: Y Yuchung Cheng 提交者: David S. Miller

tcp: avoid cwnd moderation in undo

In the current undo logic, cwnd is moderated after it was restored
to the value prior entering fast-recovery. It was moderated first
in tcp_try_undo_recovery then again in tcp_complete_cwr.

Since the undo indicates recovery was false, these moderations
are not necessary. If the undo is triggered when most of the
outstanding data have been acknowledged, the (restored) cwnd is
falsely pulled down to a small value.

This patch removes these cwnd moderations if cwnd is undone
  a) during fast-recovery
	b) by receiving DSACKs past fast-recovery
Signed-off-by: NYuchung Cheng <ycheng@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a7bff75b
...@@ -2659,7 +2659,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) ...@@ -2659,7 +2659,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
#define DBGUNDO(x...) do { } while (0) #define DBGUNDO(x...) do { } while (0)
#endif #endif
static void tcp_undo_cwr(struct sock *sk, const int undo) static void tcp_undo_cwr(struct sock *sk, const int undo_ssthresh)
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
...@@ -2671,14 +2671,13 @@ static void tcp_undo_cwr(struct sock *sk, const int undo) ...@@ -2671,14 +2671,13 @@ static void tcp_undo_cwr(struct sock *sk, const int undo)
else else
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1); tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1);
if (undo && tp->prior_ssthresh > tp->snd_ssthresh) { if (undo_ssthresh && tp->prior_ssthresh > tp->snd_ssthresh) {
tp->snd_ssthresh = tp->prior_ssthresh; tp->snd_ssthresh = tp->prior_ssthresh;
TCP_ECN_withdraw_cwr(tp); TCP_ECN_withdraw_cwr(tp);
} }
} else { } else {
tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh); tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh);
} }
tcp_moderate_cwnd(tp);
tp->snd_cwnd_stamp = tcp_time_stamp; tp->snd_cwnd_stamp = tcp_time_stamp;
} }
...@@ -2822,8 +2821,11 @@ static int tcp_try_undo_loss(struct sock *sk) ...@@ -2822,8 +2821,11 @@ static int tcp_try_undo_loss(struct sock *sk)
static inline void tcp_complete_cwr(struct sock *sk) static inline void tcp_complete_cwr(struct sock *sk)
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); /* Do not moderate cwnd if it's already undone in cwr or recovery */
tp->snd_cwnd_stamp = tcp_time_stamp; if (tp->undo_marker && tp->snd_cwnd > tp->snd_ssthresh) {
tp->snd_cwnd = tp->snd_ssthresh;
tp->snd_cwnd_stamp = tcp_time_stamp;
}
tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册