Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp188349imm; Thu, 12 Jul 2018 17:03:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdygY8B5TlFj8bcdd1xozSpfq2/6c1xom3VQfaNXnsqnJSZl1PyVqgaQHkKP4OMgeXGkGJu X-Received: by 2002:a63:e0b:: with SMTP id d11-v6mr3979319pgl.134.1531440237879; Thu, 12 Jul 2018 17:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531440237; cv=none; d=google.com; s=arc-20160816; b=twzz1V4zuCFAHWIpUeakXGki3H4HoyyPFRXyzlAwdV2g+MIbZYX5ODBpDKHTSIUVbW jn5aVQSLixonkmIJUNKoGtxzzzkq88VUl7ZzGzLhKuCUUFR6oTuy3oSrtHiWTOGdwRdi gRHek5jh9COo3zbQOYOJP1RwxICc56ANoks6GknvyDywr48umHts+cyZztMdFI+AzMeH Ndnzglt9uwUYUfZg0fVe9QcU1rWEoU0EWJ4FPgNBZmRO9wNn561g911SbnddnDDFJKMT Wv+b4lfRj0UGLRVocof7A3LIxZmzQfOQVNd7kQkixk11y3zA5CHFB6r5wgEg7Bl0Dh8w qyOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=UlnLBq3OMUeir439IFNBYgEOZjYSe38xuIY4a7lzsY8=; b=kxxJWW5M3zao+ubndbSkdcQ3cTYebQXGc2aWV6ZOEH6OIUJlsH/7TbUovZ27Dp0+XE M3ot+JlY3EBIbh3axDjYF67Z3QgFMazIqWQ9StKSjIojvgYk6waVHBY3i4G3O1f/td9X e6vf73iP616ioixRvpbi/mjo5hljkosH8TA0RONUhqRZMYvoGcilyCGfcplg7BUMs4di BkmtMercWw+HNs3um3tFy+ecDWFbFlvIcvkH3H+RGyuOqb9jG0MCqm/meg2OXd6zVXO5 rLwTdDBitIivDBitxyBm1sR4+cOPyu5276OEDkurI9ELx5FTqhZMylQ335qU88v0IXjN NtvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZLp7AaOc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15-v6si18842835pls.439.2018.07.12.17.03.42; Thu, 12 Jul 2018 17:03:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZLp7AaOc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387798AbeGMAPA (ORCPT + 99 others); Thu, 12 Jul 2018 20:15:00 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45234 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387733AbeGMAPA (ORCPT ); Thu, 12 Jul 2018 20:15:00 -0400 Received: by mail-pf0-f193.google.com with SMTP id i26-v6so10102895pfo.12; Thu, 12 Jul 2018 17:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=UlnLBq3OMUeir439IFNBYgEOZjYSe38xuIY4a7lzsY8=; b=ZLp7AaOcoFR342gi1TbRKXEbLYAMBmAHpz+44ZiwXWsQnQCDf3BRsU+UX3S2tkijZt GxMwBR2BtYgAuPVaQq3nbZjCywYAr8R1OjmZ5YvqBjPCqcjnl6knhceoUfaLADgapX/t 2GWI76habEN3hhObNOrVzva7RwKxlQDyE2TTY1vmW4TuyfNSeKaL6v6F4QB8dhjJJgpD +sdOEOMKESWuXKZ1QCrAKk+Hrtwsxg6zfJhAc/V8e5GiSfWLOy+AiXXi4AyhXc3rLfN1 1uDPgBeEPChmBb/mwpUsNBgd1cUADdJT20miVQ7NSwI/EsKe9nzw+zkQiGoqmwCPx4Lp RMag== 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; bh=UlnLBq3OMUeir439IFNBYgEOZjYSe38xuIY4a7lzsY8=; b=Fc4GKZLTrxgAYeB0buBVKj2Lrnyd2IP6JbKGPoVB+ICbWl6O+5PW3fPlk2r1J2u9ML LITLNlHrlw+D8IMtbD1WTikvbKNjyBzw7MSr8Zy6zP3vFZFoawbmQsJMYfRQA5VaLzuV Y0WQVOgr/lwqXQyjtl5ddIoFBXLq4SItfEsD2rGU1LCsvOO+ZMFOlCbhkCSTqQDJ0PB8 WQQ2mp4rAt6abVbXv9VK8xFMpz1JTeXFm+qywpbI7pYCLTmyJMAMrhuzN38gmoX51kLv h+vJrjLKtHK8WaiCAS7NuiSkxoUfozfUjCF8bwHVk/SRshrvRoSCjN7zD8gcOPImO1mm IIYg== X-Gm-Message-State: AOUpUlFMuod8SwHsqe3ax01PAXJoIEWrZ9KlLz/NoXbQNBj9RWnzJE9s Ym2LvCU3lCM3I7DLK7BWGpI= X-Received: by 2002:a62:843:: with SMTP id c64-v6mr4547521pfd.14.1531440184292; Thu, 12 Jul 2018 17:03:04 -0700 (PDT) Received: from 192-168-1-101.tpgi.com.com ([61.68.54.151]) by smtp.gmail.com with ESMTPSA id t21-v6sm13813083pfh.45.2018.07.12.17.03.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 17:03:03 -0700 (PDT) From: Jon Maxwell To: davem@davemloft.net Cc: edumazet@google.com, ncardwell@google.com, David.Laight@aculab.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jmaxwell@redhat.com Subject: [net-next, 2/3] tcp: convert icsk_user_timeout from jiffies to msecs Date: Fri, 13 Jul 2018 10:02:41 +1000 Message-Id: <20180713000241.17608-1-jmaxwell37@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create a seperate helper routine called tcp_retransmit_stamp() as per Neal Cardwells suggestion. To be used by the final commit in this series and retransmits_timed_out(). Signed-off-by: Jon Maxwell --- net/ipv4/tcp_timer.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index fa34984d0b12..8ab8c9645294 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -22,6 +22,20 @@ #include #include +u32 tcp_retransmit_stamp(const struct sock *sk) +{ + u32 start_ts = tcp_sk(sk)->retrans_stamp; + + if (unlikely(!start_ts)) { + struct sk_buff *head = tcp_rtx_queue_head(sk); + + if (!head) + return 0; + start_ts = tcp_skb_timestamp(head); + } + return start_ts; +} + /** * tcp_write_err() - close socket and save error info * @sk: The socket the error has appeared on. @@ -166,14 +180,9 @@ static bool retransmits_timed_out(struct sock *sk, if (!inet_csk(sk)->icsk_retransmits) return false; - start_ts = tcp_sk(sk)->retrans_stamp; - if (unlikely(!start_ts)) { - struct sk_buff *head = tcp_rtx_queue_head(sk); - - if (!head) - return false; - start_ts = tcp_skb_timestamp(head); - } + start_ts = tcp_retransmit_stamp(sk); + if (!start_ts) + return false; if (likely(timeout == 0)) { linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); -- 2.13.6