From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuchung Cheng Subject: [PATH net 1/4] tcp: correctly test congestion state in RACK Date: Thu, 7 Dec 2017 11:33:30 -0800 Message-ID: <20171207193333.59039-2-ycheng@google.com> References: <20171207193333.59039-1-ycheng@google.com> Cc: netdev@vger.kernel.org, edumazet@google.com, ncardwell@google.com, priyarjha@google.com, Yuchung Cheng To: davem@davemloft.net Return-path: Received: from mail-it0-f66.google.com ([209.85.214.66]:34595 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbdLGTdr (ORCPT ); Thu, 7 Dec 2017 14:33:47 -0500 Received: by mail-it0-f66.google.com with SMTP id m11so1985099iti.1 for ; Thu, 07 Dec 2017 11:33:47 -0800 (PST) In-Reply-To: <20171207193333.59039-1-ycheng@google.com> Sender: netdev-owner@vger.kernel.org List-ID: RACK does not test the loss recovery state correctly to compute the reordering window. It assumes if lost_out is zero then TCP is not in loss recovery. But it can be zero during recovery before calling tcp_rack_detect_loss(): when an ACK acknowledges all packets marked lost before receiving this ACK, but has not yet to discover new ones by tcp_rack_detect_loss(). The fix is to simply test the congestion state directly. Signed-off-by: Yuchung Cheng Reviewed-by: Neal Cardwell Reviewed-by: Priyaranjan Jha Reviewed-by: Eric Dumazet --- net/ipv4/tcp_recovery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c index d3ea89020c69..3143664902e9 100644 --- a/net/ipv4/tcp_recovery.c +++ b/net/ipv4/tcp_recovery.c @@ -55,7 +55,8 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) * to queuing or delayed ACKs. */ reo_wnd = 1000; - if ((tp->rack.reord || !tp->lost_out) && min_rtt != ~0U) { + if ((tp->rack.reord || inet_csk(sk)->icsk_ca_state < TCP_CA_Recovery) && + min_rtt != ~0U) { reo_wnd = max((min_rtt >> 2) * tp->rack.reo_wnd_steps, reo_wnd); reo_wnd = min(reo_wnd, tp->srtt_us >> 3); } -- 2.15.1.424.g9478a66081-goog