Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286677
b: refs/heads/master
c: 5a45f00
h: refs/heads/master
i:
  286675: f674105
v: v3
  • Loading branch information
Neal Cardwell authored and David S. Miller committed Jan 20, 2012
1 parent d6aaf51 commit 0eca1f5
Show file tree
Hide file tree
Showing 2 changed files with 7 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: fc16dcd8c2e1e9bc91ed765957e1f2bbf334253e
refs/heads/master: 5a45f0086a2dcf50db7e6a0bf5be933880f85127
10 changes: 6 additions & 4 deletions trunk/net/ipv4/tcp_cubic.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static inline void bictcp_reset(struct bictcp *ca)
{
ca->cnt = 0;
ca->last_max_cwnd = 0;
ca->loss_cwnd = 0;
ca->last_cwnd = 0;
ca->last_time = 0;
ca->bic_origin_point = 0;
Expand Down Expand Up @@ -142,7 +141,10 @@ static inline void bictcp_hystart_reset(struct sock *sk)

static void bictcp_init(struct sock *sk)
{
bictcp_reset(inet_csk_ca(sk));
struct bictcp *ca = inet_csk_ca(sk);

bictcp_reset(ca);
ca->loss_cwnd = 0;

if (hystart)
bictcp_hystart_reset(sk);
Expand Down Expand Up @@ -275,7 +277,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
* The initial growth of cubic function may be too conservative
* when the available bandwidth is still unknown.
*/
if (ca->loss_cwnd == 0 && ca->cnt > 20)
if (ca->last_max_cwnd == 0 && ca->cnt > 20)
ca->cnt = 20; /* increase cwnd 5% per RTT */

/* TCP Friendly */
Expand Down Expand Up @@ -342,7 +344,7 @@ static u32 bictcp_undo_cwnd(struct sock *sk)
{
struct bictcp *ca = inet_csk_ca(sk);

return max(tcp_sk(sk)->snd_cwnd, ca->last_max_cwnd);
return max(tcp_sk(sk)->snd_cwnd, ca->loss_cwnd);
}

static void bictcp_state(struct sock *sk, u8 new_state)
Expand Down

0 comments on commit 0eca1f5

Please sign in to comment.