From patchwork Thu Dec 7 19:33:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuchung Cheng X-Patchwork-Id: 845784 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="FHFwLtt0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yt5JJ2bHdz9s9Y for ; Fri, 8 Dec 2017 06:33:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752214AbdLGTdt (ORCPT ); Thu, 7 Dec 2017 14:33:49 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m71FStVzBV0DQSvClGTR2XT/ASWnyEDRv7qtktx4Y6Y=; b=FHFwLtt0xQsOAQkmp3Nwhg0uP4IIhg7bKr/70ineRQyl/JkEHevC1fRcnXlnt2JYE2 trnfSB0/x/HbHTPGUaPtQZpZoaX0wrdWKNccvOTgLBa4vAZtjRzlwWYA8wagB7KKd0CD dEeBH9/7BjTPDN0n9rIRSwK2pN0dN8u/X8y9n3BU1r7zZILFoUr7Aatwzd+lNBKyfv8o IzNajZtDOLmAHnDsi8TTrDP24hHDQhA2Mhwiu9+9wO/kc5Q388xGtCt/xiz2fXM9mnsC 7BfaVId1ctOQNK/Z+MYzx72yzQ9w/pD3BJxKLeCEXjRXVwy2juH6bF3xJ1QpWSY7J4/z /MvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=m71FStVzBV0DQSvClGTR2XT/ASWnyEDRv7qtktx4Y6Y=; b=PUb7byLw4OJdHmfU/jYyCar5uT17bC6UgNUaKalum9UGNSD8qCnnPBsV6sSi2FWY2O JaMNAacSpx4z0b/ET8WnyhJwIyCeCAkBjlTH1+tyr07IMxUa9uvB8cC8ccShugmQTRH8 Z1FLz4nIj7J7DcYH3xJY1aD8hGKZIgVLfZ8zKF3E9OevApHGaKINBq4TKJ2dzbBdoaaP Rd2zg7iAL2S5RIYz8vZdG1Rw5X3M6U2th5S0gulT8IU20p3ywu2c1KfHkRxqJlFHvNvY 7Di4R5mGFarZnk/gL6oFq3HRYvmHd9yQSfL0HFH9sMipx8MpoRHrIBMM+9iSMf88k7Ih KSoA== X-Gm-Message-State: AKGB3mJaW1ltuGZxWXKOFnlZx6pJVjxqS/A+e4BU0Wg89gN48BBxnWLg NV5OSikwqhgDnt8VjiF7z9DMG4zhfog= X-Google-Smtp-Source: AGs4zMaYRW0exhe08Twl7YEH2+DI7NBie5ZEZbiyvgQUr0OHkbRBVHUEJxTwebSFuvalIs7Iui0/Sw== X-Received: by 10.36.145.203 with SMTP id i194mr2716950ite.73.1512675226724; Thu, 07 Dec 2017 11:33:46 -0800 (PST) Received: from ycheng2.svl.corp.google.com ([100.116.160.41]) by smtp.gmail.com with ESMTPSA id h128sm3078168ita.42.2017.12.07.11.33.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 11:33:44 -0800 (PST) From: Yuchung Cheng To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, ncardwell@google.com, priyarjha@google.com, 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> X-Mailer: git-send-email 2.15.1.424.g9478a66081-goog In-Reply-To: <20171207193333.59039-1-ycheng@google.com> References: <20171207193333.59039-1-ycheng@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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); }