summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPengcheng Yang <yangpc@wangsu.com>2020-03-16 14:35:10 +0800
committerDavid S. Miller <davem@davemloft.net>2020-03-16 18:26:55 -0700
commitca04f5d4bb79ef22b708ebb8ab147fc5abb25300 (patch)
treef7581ecc8d34788c98d3ba1cec730f9599f8dc5e /net/ipv4
parentd861b5c7534e12590e731433304d87b453c3613f (diff)
downloadlinux-ca04f5d4bb79ef22b708ebb8ab147fc5abb25300.tar.bz2
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: Pengcheng Yang <yangpc@wangsu.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_veno.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 857491c5b856..50a9a6e2c4cd 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -154,8 +154,9 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
if (tcp_in_slow_start(tp)) {
/* Slow start. */
- tcp_slow_start(tp, acked);
- goto done;
+ acked = tcp_slow_start(tp, acked);
+ if (!acked)
+ goto done;
}
/* Congestion avoidance. */
@@ -163,7 +164,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
/* In the "non-congestive state", increase cwnd
* every rtt.
*/
- tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
+ tcp_cong_avoid_ai(tp, tp->snd_cwnd, acked);
} else {
/* In the "congestive state", increase cwnd
* every other rtt.
@@ -177,7 +178,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
veno->inc = 1;
tp->snd_cwnd_cnt = 0;
} else
- tp->snd_cwnd_cnt++;
+ tp->snd_cwnd_cnt += acked;
}
done:
if (tp->snd_cwnd < 2)