Skip to content

Commit

Permalink
tcp: stretch ACK fixes in Veno prep
Browse files Browse the repository at this point in the history
No code logic has been changed in this patch.

Signed-off-by: Pengcheng Yang <[email protected]>
Acked-by: Neal Cardwell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ws-yangpc authored and davem330 committed Mar 17, 2020
1 parent 5415e3c commit d861b5c
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions net/ipv4/tcp_veno.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,31 +153,33 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
veno->diff = (tp->snd_cwnd << V_PARAM_SHIFT) - target_cwnd;

if (tcp_in_slow_start(tp)) {
/* Slow start. */
/* Slow start. */
tcp_slow_start(tp, acked);
goto done;
}

/* Congestion avoidance. */
if (veno->diff < beta) {
/* In the "non-congestive state", increase cwnd
* every rtt.
*/
tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
} else {
/* Congestion avoidance. */
if (veno->diff < beta) {
/* In the "non-congestive state", increase cwnd
* every rtt.
*/
tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
} else {
/* In the "congestive state", increase cwnd
* every other rtt.
*/
if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
if (veno->inc &&
tp->snd_cwnd < tp->snd_cwnd_clamp) {
tp->snd_cwnd++;
veno->inc = 0;
} else
veno->inc = 1;
tp->snd_cwnd_cnt = 0;
/* In the "congestive state", increase cwnd
* every other rtt.
*/
if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
if (veno->inc &&
tp->snd_cwnd < tp->snd_cwnd_clamp) {
tp->snd_cwnd++;
veno->inc = 0;
} else
tp->snd_cwnd_cnt++;
}
veno->inc = 1;
tp->snd_cwnd_cnt = 0;
} else
tp->snd_cwnd_cnt++;
}
done:
if (tp->snd_cwnd < 2)
tp->snd_cwnd = 2;
else if (tp->snd_cwnd > tp->snd_cwnd_clamp)
Expand Down

0 comments on commit d861b5c

Please sign in to comment.