Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286676
b: refs/heads/master
c: fc16dcd
h: refs/heads/master
v: v3
  • Loading branch information
Neal Cardwell authored and David S. Miller committed Jan 20, 2012
1 parent f674105 commit d6aaf51
Show file tree
Hide file tree
Showing 2 changed files with 8 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: b67f231ded332461dd31123c4f659c4681223fb1
refs/heads/master: fc16dcd8c2e1e9bc91ed765957e1f2bbf334253e
11 changes: 7 additions & 4 deletions trunk/net/ipv4/tcp_bic.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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->epoch_start = 0;
Expand All @@ -72,7 +71,11 @@ static inline void bictcp_reset(struct bictcp *ca)

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 (initial_ssthresh)
tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
}
Expand Down Expand Up @@ -127,7 +130,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
}

/* if in slow start or link utilization is very low */
if (ca->loss_cwnd == 0) {
if (ca->last_max_cwnd == 0) {
if (ca->cnt > 20) /* increase cwnd 5% per RTT */
ca->cnt = 20;
}
Expand Down Expand Up @@ -185,7 +188,7 @@ static u32 bictcp_undo_cwnd(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
const struct bictcp *ca = inet_csk_ca(sk);
return max(tp->snd_cwnd, ca->last_max_cwnd);
return max(tp->snd_cwnd, ca->loss_cwnd);
}

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

0 comments on commit d6aaf51

Please sign in to comment.