Skip to content

Commit

Permalink
dctcp: update cwnd on congestion event
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Nov 16, 2016
1 parent 0fa1dfd commit 4780566
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion net/ipv4/tcp_dctcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4780566

Please sign in to comment.