Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134983
b: refs/heads/master
c: 758ce5c
h: refs/heads/master
i:
  134981: 5966656
  134979: fb53e25
  134975: 6f11aec
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Mar 2, 2009
1 parent 69baf88 commit c107a55
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 50 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: 571a5dd8d01f2a7e279c502fa220a69262d73694
refs/heads/master: 758ce5c8d11d6fc57fe5f1dbc237aa8ff6386eac
1 change: 1 addition & 0 deletions trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ extern void tcp_get_allowed_congestion_control(char *buf, size_t len);
extern int tcp_set_allowed_congestion_control(char *allowed);
extern int tcp_set_congestion_control(struct sock *sk, const char *name);
extern void tcp_slow_start(struct tcp_sock *tp);
extern void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w);

extern struct tcp_congestion_ops tcp_init_congestion_ops;
extern u32 tcp_reno_ssthresh(struct sock *sk);
Expand Down
11 changes: 1 addition & 10 deletions trunk/net/ipv4/tcp_bic.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,7 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
tcp_slow_start(tp);
else {
bictcp_update(ca, tp->snd_cwnd);

/* In dangerous area, increase slowly.
* In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd
*/
if (tp->snd_cwnd_cnt >= ca->cnt) {
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
} else
tp->snd_cwnd_cnt++;
tcp_cong_avoid_ai(tp, ca->cnt);
}

}
Expand Down
21 changes: 14 additions & 7 deletions trunk/net/ipv4/tcp_cong.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,19 @@ void tcp_slow_start(struct tcp_sock *tp)
}
EXPORT_SYMBOL_GPL(tcp_slow_start);

/* In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd (or alternative w) */
void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w)
{
if (tp->snd_cwnd_cnt >= w) {
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
} else {
tp->snd_cwnd_cnt++;
}
}
EXPORT_SYMBOL_GPL(tcp_cong_avoid_ai);

/*
* TCP Reno congestion control
* This is special case used for fallback as well.
Expand Down Expand Up @@ -365,13 +378,7 @@ void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
tp->snd_cwnd++;
}
} else {
/* In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd */
if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
} else
tp->snd_cwnd_cnt++;
tcp_cong_avoid_ai(tp, tp->snd_cwnd);
}
}
EXPORT_SYMBOL_GPL(tcp_reno_cong_avoid);
Expand Down
11 changes: 1 addition & 10 deletions trunk/net/ipv4/tcp_cubic.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,7 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
tcp_slow_start(tp);
} else {
bictcp_update(ca, tp->snd_cwnd);

/* In dangerous area, increase slowly.
* In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd
*/
if (tp->snd_cwnd_cnt >= ca->cnt) {
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
} else
tp->snd_cwnd_cnt++;
tcp_cong_avoid_ai(tp, ca->cnt);
}

}
Expand Down
10 changes: 2 additions & 8 deletions trunk/net/ipv4/tcp_scalable.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)

if (tp->snd_cwnd <= tp->snd_ssthresh)
tcp_slow_start(tp);
else {
tp->snd_cwnd_cnt++;
if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)){
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
}
}
else
tcp_cong_avoid_ai(tp, min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT));
}

static u32 tcp_scalable_ssthresh(struct sock *sk)
Expand Down
7 changes: 1 addition & 6 deletions trunk/net/ipv4/tcp_veno.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
/* In the "non-congestive state", increase cwnd
* every rtt.
*/
if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
if (tp->snd_cwnd < tp->snd_cwnd_clamp)
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
} else
tp->snd_cwnd_cnt++;
tcp_cong_avoid_ai(tp, tp->snd_cwnd);
} else {
/* In the "congestive state", increase cwnd
* every other rtt.
Expand Down
9 changes: 1 addition & 8 deletions trunk/net/ipv4/tcp_yeah.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)

} else {
/* Reno */

if (tp->snd_cwnd_cnt < tp->snd_cwnd)
tp->snd_cwnd_cnt++;

if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
tp->snd_cwnd++;
tp->snd_cwnd_cnt = 0;
}
tcp_cong_avoid_ai(tp, tp->snd_cwnd);
}

/* The key players are v_vegas.beg_snd_una and v_beg_snd_nxt.
Expand Down

0 comments on commit c107a55

Please sign in to comment.