diff options
Diffstat (limited to 'net/ipv4/tcp_cubic.c')
-rw-r--r-- | net/ipv4/tcp_cubic.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index f376b05cca81..a9077f441cb2 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c | |||
@@ -107,7 +107,6 @@ static inline void bictcp_reset(struct bictcp *ca) | |||
107 | { | 107 | { |
108 | ca->cnt = 0; | 108 | ca->cnt = 0; |
109 | ca->last_max_cwnd = 0; | 109 | ca->last_max_cwnd = 0; |
110 | ca->loss_cwnd = 0; | ||
111 | ca->last_cwnd = 0; | 110 | ca->last_cwnd = 0; |
112 | ca->last_time = 0; | 111 | ca->last_time = 0; |
113 | ca->bic_origin_point = 0; | 112 | ca->bic_origin_point = 0; |
@@ -142,7 +141,10 @@ static inline void bictcp_hystart_reset(struct sock *sk) | |||
142 | 141 | ||
143 | static void bictcp_init(struct sock *sk) | 142 | static void bictcp_init(struct sock *sk) |
144 | { | 143 | { |
145 | bictcp_reset(inet_csk_ca(sk)); | 144 | struct bictcp *ca = inet_csk_ca(sk); |
145 | |||
146 | bictcp_reset(ca); | ||
147 | ca->loss_cwnd = 0; | ||
146 | 148 | ||
147 | if (hystart) | 149 | if (hystart) |
148 | bictcp_hystart_reset(sk); | 150 | bictcp_hystart_reset(sk); |
@@ -275,7 +277,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd) | |||
275 | * The initial growth of cubic function may be too conservative | 277 | * The initial growth of cubic function may be too conservative |
276 | * when the available bandwidth is still unknown. | 278 | * when the available bandwidth is still unknown. |
277 | */ | 279 | */ |
278 | if (ca->loss_cwnd == 0 && ca->cnt > 20) | 280 | if (ca->last_max_cwnd == 0 && ca->cnt > 20) |
279 | ca->cnt = 20; /* increase cwnd 5% per RTT */ | 281 | ca->cnt = 20; /* increase cwnd 5% per RTT */ |
280 | 282 | ||
281 | /* TCP Friendly */ | 283 | /* TCP Friendly */ |
@@ -342,7 +344,7 @@ static u32 bictcp_undo_cwnd(struct sock *sk) | |||
342 | { | 344 | { |
343 | struct bictcp *ca = inet_csk_ca(sk); | 345 | struct bictcp *ca = inet_csk_ca(sk); |
344 | 346 | ||
345 | return max(tcp_sk(sk)->snd_cwnd, ca->last_max_cwnd); | 347 | return max(tcp_sk(sk)->snd_cwnd, ca->loss_cwnd); |
346 | } | 348 | } |
347 | 349 | ||
348 | static void bictcp_state(struct sock *sk, u8 new_state) | 350 | static void bictcp_state(struct sock *sk, u8 new_state) |