|
@@ -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;
|
|
@@ -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;
|
|
|
}
|
|
@@ -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;
|
|
|
}
|
|
@@ -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)
|