Commit ca04f5d4 authored by Pengcheng Yang's avatar Pengcheng Yang Committed by David S. Miller

tcp: fix stretch ACK bugs in Veno

Change Veno to properly handle stretch ACKs in additive
increase mode by passing in the count of ACKed packets
to tcp_cong_avoid_ai().
Signed-off-by: default avatarPengcheng Yang <yangpc@wangsu.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d861b5c7
...@@ -154,8 +154,9 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked) ...@@ -154,8 +154,9 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
if (tcp_in_slow_start(tp)) { if (tcp_in_slow_start(tp)) {
/* Slow start. */ /* Slow start. */
tcp_slow_start(tp, acked); acked = tcp_slow_start(tp, acked);
goto done; if (!acked)
goto done;
} }
/* Congestion avoidance. */ /* Congestion avoidance. */
...@@ -163,7 +164,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked) ...@@ -163,7 +164,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
/* In the "non-congestive state", increase cwnd /* In the "non-congestive state", increase cwnd
* every rtt. * every rtt.
*/ */
tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1); tcp_cong_avoid_ai(tp, tp->snd_cwnd, acked);
} else { } else {
/* In the "congestive state", increase cwnd /* In the "congestive state", increase cwnd
* every other rtt. * every other rtt.
...@@ -177,7 +178,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked) ...@@ -177,7 +178,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
veno->inc = 1; veno->inc = 1;
tp->snd_cwnd_cnt = 0; tp->snd_cwnd_cnt = 0;
} else } else
tp->snd_cwnd_cnt++; tp->snd_cwnd_cnt += acked;
} }
done: done:
if (tp->snd_cwnd < 2) if (tp->snd_cwnd < 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment