]> git.baikalelectronics.ru Git - kernel.git/commit
dctcp: avoid bogus doubling of cwnd after loss
authorFlorian Westphal <fw@strlen.de>
Fri, 28 Oct 2016 16:43:11 +0000 (18:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Oct 2016 19:16:28 +0000 (15:16 -0400)
commitdd468b8eced6b09014c6b0297ec8a3d4a98aa5ba
tree133ffe80d56955a590a8f3d1dfad24e34f61aef6
parentd560be3595d333462a1df9b15ba01987edf03dc3
dctcp: avoid bogus doubling of cwnd after loss

If a congestion control module doesn't provide .undo_cwnd function,
tcp_undo_cwnd_reduction() will set cwnd to

   tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1);

... which makes sense for reno (it sets ssthresh to half the current cwnd),
but it makes no sense for dctcp, which sets ssthresh based on the current
congestion estimate.

This can cause severe growth of cwnd (eventually overflowing u32).

Fix this by saving last cwnd on loss and restore cwnd based on that,
similar to cubic and other algorithms.

Fixes: 752f76819578e2 ("net: tcp: add DCTCP congestion control algorithm")
Cc: Lawrence Brakmo <brakmo@fb.com>
Cc: Andrew Shewmaker <agshew@gmail.com>
Cc: Glenn Judd <glenn.judd@morganstanley.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_dctcp.c