mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
[TCP] vegas: Fix a bug in disabling slow start by gamma parameter.
TCP Vegas implementation has a bug in the process of disabling slow-start with gamma parameter. The bug may lead to extreme unfairness in the presence of early packet loss. See details in: http://www.cs.caltech.edu/~weixl/technical/ns2linux/known_linux/index.html#vegas Switch the order of "if (tp->snd_cwnd <= tp->snd_ssthresh)" statement and "if (diff > gamma)" statement to eliminate the problem. Signed-off-by: Xiaoliang (David) Wei <davidwei79@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5c81833c2f
commit
c940587bf6
1 changed files with 18 additions and 19 deletions
|
@ -266,9 +266,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
|
||||||
*/
|
*/
|
||||||
diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
|
diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
|
||||||
|
|
||||||
if (tp->snd_cwnd <= tp->snd_ssthresh) {
|
if (diff > gamma && tp->snd_ssthresh > 2 ) {
|
||||||
/* Slow start. */
|
|
||||||
if (diff > gamma) {
|
|
||||||
/* Going too fast. Time to slow down
|
/* Going too fast. Time to slow down
|
||||||
* and switch to congestion avoidance.
|
* and switch to congestion avoidance.
|
||||||
*/
|
*/
|
||||||
|
@ -285,7 +283,8 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
|
||||||
(target_cwnd >>
|
(target_cwnd >>
|
||||||
V_PARAM_SHIFT)+1);
|
V_PARAM_SHIFT)+1);
|
||||||
|
|
||||||
}
|
} else if (tp->snd_cwnd <= tp->snd_ssthresh) {
|
||||||
|
/* Slow start. */
|
||||||
tcp_slow_start(tp);
|
tcp_slow_start(tp);
|
||||||
} else {
|
} else {
|
||||||
/* Congestion avoidance. */
|
/* Congestion avoidance. */
|
||||||
|
|
Loading…
Reference in a new issue