aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2012-09-02 13:38:04 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-03 14:34:02 -0400
commit684bad1107571d35610a674c61b3544efb5a5b13 (patch)
treeaba9dc4a825ac3c454d9058f0bec0829f2b6df69 /net/ipv4/tcp_output.c
parentfb4d3d1df31907eadd2e2a745e840921888b346a (diff)
tcp: use PRR to reduce cwin in CWR state
Use proportional rate reduction (PRR) algorithm to reduce cwnd in CWR state, in addition to Recovery state. Retire the current rate-halving in CWR. When losses are detected via ACKs in CWR state, the sender enters Recovery state but the cwnd reduction continues and does not restart. Rename and refactor cwnd reduction functions since both CWR and Recovery use the same algorithm: tcp_init_cwnd_reduction() is new and initiates reduction state variables. tcp_cwnd_reduction() is previously tcp_update_cwnd_in_recovery(). tcp_ends_cwnd_reduction() is previously tcp_complete_cwr(). The rate halving functions and logic such as tcp_cwnd_down(), tcp_min_cwnd(), and the cwnd moderation inside tcp_enter_cwr() are removed. The unused parameter, flag, in tcp_cwnd_reduction() is also removed. Signed-off-by: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 9383b51f3efc..cfe6ffe1c177 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2037,10 +2037,10 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
2037 if (push_one) 2037 if (push_one)
2038 break; 2038 break;
2039 } 2039 }
2040 if (inet_csk(sk)->icsk_ca_state == TCP_CA_Recovery)
2041 tp->prr_out += sent_pkts;
2042 2040
2043 if (likely(sent_pkts)) { 2041 if (likely(sent_pkts)) {
2042 if (tcp_in_cwnd_reduction(sk))
2043 tp->prr_out += sent_pkts;
2044 tcp_cwnd_validate(sk); 2044 tcp_cwnd_validate(sk);
2045 return false; 2045 return false;
2046 } 2046 }
@@ -2542,7 +2542,7 @@ begin_fwd:
2542 } 2542 }
2543 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2543 NET_INC_STATS_BH(sock_net(sk), mib_idx);
2544 2544
2545 if (inet_csk(sk)->icsk_ca_state == TCP_CA_Recovery) 2545 if (tcp_in_cwnd_reduction(sk))
2546 tp->prr_out += tcp_skb_pcount(skb); 2546 tp->prr_out += tcp_skb_pcount(skb);
2547 2547
2548 if (skb == tcp_write_queue_head(sk)) 2548 if (skb == tcp_write_queue_head(sk))