Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349653
b: refs/heads/master
c: 973ec44
h: refs/heads/master
i:
  349651: 6da1900
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 3, 2013
1 parent 3184c53 commit 164fcc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59fa534874e6779082275d12d950e26c67c86498
refs/heads/master: 973ec449bb4f2b8c514bacbcb4d9506fc31c8ce3
14 changes: 10 additions & 4 deletions trunk/net/ipv4/tcp_cong.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ void tcp_slow_start(struct tcp_sock *tp)
{
int cnt; /* increase in packets */
unsigned int delta = 0;
u32 snd_cwnd = tp->snd_cwnd;

if (unlikely(!snd_cwnd)) {
pr_err_once("snd_cwnd is nul, please report this bug.\n");
snd_cwnd = 1U;
}

/* RFC3465: ABC Slow start
* Increase only after a full MSS of bytes is acked
Expand All @@ -324,7 +330,7 @@ void tcp_slow_start(struct tcp_sock *tp)
if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh)
cnt = sysctl_tcp_max_ssthresh >> 1; /* limited slow start */
else
cnt = tp->snd_cwnd; /* exponential increase */
cnt = snd_cwnd; /* exponential increase */

/* RFC3465: ABC
* We MAY increase by 2 if discovered delayed ack
Expand All @@ -334,11 +340,11 @@ void tcp_slow_start(struct tcp_sock *tp)
tp->bytes_acked = 0;

tp->snd_cwnd_cnt += cnt;
while (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
tp->snd_cwnd_cnt -= tp->snd_cwnd;
while (tp->snd_cwnd_cnt >= snd_cwnd) {
tp->snd_cwnd_cnt -= snd_cwnd;
delta++;
}
tp->snd_cwnd = min(tp->snd_cwnd + delta, tp->snd_cwnd_clamp);
tp->snd_cwnd = min(snd_cwnd + delta, tp->snd_cwnd_clamp);
}
EXPORT_SYMBOL_GPL(tcp_slow_start);

Expand Down

0 comments on commit 164fcc0

Please sign in to comment.