From patchwork Thu Jan 31 19:16:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuchung Cheng X-Patchwork-Id: 217244 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 520F52C008D for ; Fri, 1 Feb 2013 06:16:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755577Ab3AaTQv (ORCPT ); Thu, 31 Jan 2013 14:16:51 -0500 Received: from mail-qa0-f73.google.com ([209.85.216.73]:33042 "EHLO mail-qa0-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945Ab3AaTQt (ORCPT ); Thu, 31 Jan 2013 14:16:49 -0500 Received: by mail-qa0-f73.google.com with SMTP id g10so349231qah.4 for ; Thu, 31 Jan 2013 11:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=y8OT5Rx+F0cF0dzf7bd3WWnetn3sKfR/+gwIGRfPB4g=; b=djUx/bnnYc9bVmWqZdkFDXYWMcCGDOinAuq0npVagkml4hNG617+yE0Cz6Qj72ehzV jZtyiSVEoClIyOAk43SZvjARA6eBrpX7Qlbe0PTtMpAHldxUU3GnrIxiNZCP61VCHAno JUZEDFbQVQFckIfTb7OvPqIP0fxBEkHgWZ2JbGDWFYfnpQGXmU0GwFKKe7zWrbi0YZip 1egi8MAjzgb6mO2aeq6HN308HFEBiiBSCgsfYH2T+F4U3ZnztAuZRJ5Rajz70me23JsF acf/clNJlW5WwNLzaAtF+tPDs/nnMZeYa0oeoo++9vn+LDi6cdpBhsALdnm0ja8uKRWA JfKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=y8OT5Rx+F0cF0dzf7bd3WWnetn3sKfR/+gwIGRfPB4g=; b=eA0ktE5z8ymBzti6BFQjO2qYlkKtnwSi6sWYk/Ol+peaNAc0VpXDnoXtny8QkD6Awz DEl7S6hngafN/qvK71U+NGV6DL9PfrFxAoQJo4Fg0BGspaLlPKiBbQ2kWcNpIuNSlKra xJGTkFRvSikAZ3/hqOkYHP30pkB7zJbmuoSy8rRxnDmI1RG5P63BVTmTBTIcyU8oaOG5 RggW912C+xeYrxvoTokUFpQ9Ah1Qz25X0prYlY1wbZ+LlMNLxdO3s1HSZt2dfnC7F5id OqnDedJwtgUb/ig4nszWd+IHRU7q5UwPobAQW1y6+0o9crShTVdlvUCt9lZGkSfcavxo 2Yuw== X-Received: by 10.236.133.236 with SMTP id q72mr4387761yhi.11.1359659808310; Thu, 31 Jan 2013 11:16:48 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id x63si242127yhl.2.2013.01.31.11.16.48 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Thu, 31 Jan 2013 11:16:48 -0800 (PST) Received: from blast2.mtv.corp.google.com (blast2.mtv.corp.google.com [172.17.132.164]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 27BE35A4207; Thu, 31 Jan 2013 11:16:48 -0800 (PST) Received: by blast2.mtv.corp.google.com (Postfix, from userid 5463) id B18BA180851; Thu, 31 Jan 2013 11:16:47 -0800 (PST) From: Yuchung Cheng To: davem@davemloft.net, ncardwell@google.com, edumazet@google.com Cc: netdev@vger.kernel.org, Yuchung Cheng Subject: [PATCH] tcp: detect SYN/data drop when F-RTO is disabled Date: Thu, 31 Jan 2013 11:16:46 -0800 Message-Id: <1359659806-29556-1-git-send-email-ycheng@google.com> X-Mailer: git-send-email 1.8.1 X-Gm-Message-State: ALoCoQnLw9TSxc+Tgh1Q0QOU9/HzSF4tAtIAOz+tEBetQQHFUiVPVpejWxWsTW1ejpyPHbuLSPVwfHy+E3n9UDvFSOrfOMHCXXc6pOkRmuTUDfu26NHCgNI9MGRt/kfPMQSZ/qdhufOwytL7itCPRgtnEtSzQRkiu72ML2HR4huf4Khe6teNnZ2nI50gX6jMt8PVciZQiSP5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On receiving the SYN-ACK, Fast Open checks icsk_retransmit for SYN retransmission to detect SYN/data drops. But if F-RTO is disabled, icsk_retransmit is reset at step D of tcp_fastretrans_alert() ( under tcp_ack()) before tcp_rcv_fastopen_synack(). The fix is to use total_retrans instead which accounts for SYN retransmission regardless the use of F-RTO. Signed-off-by: Yuchung Cheng --- net/ipv4/tcp_input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 492c7cf..de52403 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5647,8 +5647,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, * the remote receives only the retransmitted (regular) SYNs: either * the original SYN-data or the corresponding SYN-ACK is lost. */ - syn_drop = (cookie->len <= 0 && data && - inet_csk(sk)->icsk_retransmits); + syn_drop = (cookie->len <= 0 && data && tp->total_retrans); tcp_fastopen_cache_set(sk, mss, cookie, syn_drop);