diff options
author | Florian Westphal <fw@strlen.de> | 2016-11-14 16:42:01 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-15 22:01:58 -0500 |
commit | 4780566784b3968ab9fd6cc94bab72421813f004 (patch) | |
tree | a740b61075e065ba2d819b8cb83f967de61648de /net/ipv4/tcp_dctcp.c | |
parent | 0fa1dfd6b92b31eed5446e907049d5b0062b8860 (diff) | |
download | talos-op-linux-4780566784b3968ab9fd6cc94bab72421813f004.tar.gz talos-op-linux-4780566784b3968ab9fd6cc94bab72421813f004.zip |
dctcp: update cwnd on congestion event
draft-ietf-tcpm-dctcp-02 says:
... when the sender receives an indication of congestion
(ECE), the sender SHOULD update cwnd as follows:
cwnd = cwnd * (1 - DCTCP.Alpha / 2)
So, lets do this and reduce cwnd more smoothly (and faster), as per
current congestion estimate.
Cc: Lawrence Brakmo <brakmo@fb.com>
Cc: Andrew Shewmaker <agshew@gmail.com>
Cc: Glenn Judd <glenn.judd@morganstanley.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_dctcp.c')
-rw-r--r-- | net/ipv4/tcp_dctcp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv4/tcp_dctcp.c b/net/ipv4/tcp_dctcp.c index ab37c6775630..51139175bf61 100644 --- a/net/ipv4/tcp_dctcp.c +++ b/net/ipv4/tcp_dctcp.c @@ -188,8 +188,8 @@ static void dctcp_ce_state_1_to_0(struct sock *sk) static void dctcp_update_alpha(struct sock *sk, u32 flags) { - const struct tcp_sock *tp = tcp_sk(sk); struct dctcp *ca = inet_csk_ca(sk); + struct tcp_sock *tp = tcp_sk(sk); u32 acked_bytes = tp->snd_una - ca->prior_snd_una; /* If ack did not advance snd_una, count dupack as MSS size. @@ -229,6 +229,13 @@ static void dctcp_update_alpha(struct sock *sk, u32 flags) WRITE_ONCE(ca->dctcp_alpha, alpha); dctcp_reset(tp, ca); } + + if (flags & CA_ACK_ECE) { + unsigned int cwnd = dctcp_ssthresh(sk); + + if (cwnd != tp->snd_cwnd) + tp->snd_cwnd = cwnd; + } } static void dctcp_state(struct sock *sk, u8 new_state) |