Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3074923imm; Mon, 16 Jul 2018 21:18:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc8Ga+nlW5EPBeRYAt3q1Sb30dPe/zjDKZ4/y3BFHRwloq+eZflJBBTrHCHXcYtSBZTq18Y X-Received: by 2002:a17:902:e093:: with SMTP id cb19-v6mr19455362plb.189.1531801114036; Mon, 16 Jul 2018 21:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531801114; cv=none; d=google.com; s=arc-20160816; b=Zn6qhjOM7jVJoQbLCsaAbo4eWuf8Kla6NwrbIJG2592WMeKaiYDzpaq8lhXMAV05Uq vKix2tIboF88iF/N1EAGOb2m/nPL43eapNZusFu01YZHRXp1lTCLccIyETNC0BEOGxqJ qxmjjPnS2w2IQXl64r7l25fjTfufElOhQT60AsdwDQVoCxeR5FIchtY5PzkTCY3nfVw+ PiEOZh6q2I/USrkDVFzniAtyi71ZPwOepg3XvhjjPdHDgVvSFAQCITL7xg0VqzsOrbF2 fCM/w9RcPP2LkemM+xryvzIU9zpusWlDnvDz94CdjCN7QCQKYKZqVmLVlN0JLnFfQwHZ Ok+Q== 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=hUXxUhSxD5PkHE46++U5JcnIKk4Odh7gkgebdsTHbLY=; b=P19IMDFeDT9iwlTMc18zLNtyNf3MySxdqtj7iG+DJNxzn+8252xu+5PUb2DudURR7y EYWyGQx5aD7sq9eMZPxVOXb9ZgomwUfbqlNVFpAElR7q4nAln0HbaZTt3Uku+p0zuivX 6jq8lux59qrsS3r1cfOPIFvVSlJO4QgAE5kTTww/An/qg6JHw4rHWcaarRg/KnRKKtsL 33QZie7O29k8NDWCRV+Z0mTa7N7mVLugo6PDrtetQ8IESvboszwNrWMtzScaQNFePJgW boPJhpAyrgkhvECfYGMFYxf6ivk2EVR+uAPqsBb/DKwjSzwib2P/lpTLQuyqPHadHXLh ARYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G/0gJnR3"; 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 p12-v6si12882635pls.53.2018.07.16.21.18.19; Mon, 16 Jul 2018 21:18:34 -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="G/0gJnR3"; 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 S1729642AbeGQErb (ORCPT + 99 others); Tue, 17 Jul 2018 00:47:31 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44915 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeGQEra (ORCPT ); Tue, 17 Jul 2018 00:47:30 -0400 Received: by mail-pg1-f194.google.com with SMTP id r1-v6so8391249pgp.11; Mon, 16 Jul 2018 21:16:56 -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=hUXxUhSxD5PkHE46++U5JcnIKk4Odh7gkgebdsTHbLY=; b=G/0gJnR3N7nIoSX8xhAGdj6n3JydmB6TVEHLxkNJXgNJtvDMTtbimo0IwnXrHez7ym Hq7WTRbJJPdtzMLLvEz/zC5yX2QOeT/sTdE5HKR0fIFhS4B2iHAHQOGqiJfgc+oqdUxu WSdidYC8WfUhIx95yp5eFtI7wg9fDPF+N21233pL4Wv8K2t51YmV0OT4htcoB1zf1Q3g +jBIFL1ZudOkviEfa5xZ144HJKI+hqemc7xD72BjtojWttzeZH4gMU65Q/qmtVreFt98 0dbTv1mfzp1JXkWpYkENkpt7+QGo09L85ZM4bvlemITb1hCanZ45+rSW9w69BCHBFoMm advg== 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=hUXxUhSxD5PkHE46++U5JcnIKk4Odh7gkgebdsTHbLY=; b=CKGUOjQh3S64CNB4twdijFpYbxxNveGSPjDXq+u22UuczYnLRSA3kt7KFdCstKCw5A mIQboM8WEMxS8znRQbJkx6k1/8Vek9gK4yvM1nwPgwqqsqkUlUa+2xd1A2NgJs6zVsNr z8vwkgVS+rFqB09zZncMnCCAAy8cjF3wH1K/xK5UKbAFmZtbUSHxJV6XPNSZF6oOdoGA TcoRRWWHdW+ka3tiS9Qz9KEuvqs+n2/YC5H2vVihKhEfjpNabEiKcDnOPZepqyDEAJt5 /LosrPhySX8xb4kvfeW5H4TMa7ZpIn9+fxAPtuj+HVpDrmA8sBaqE3SJFE56SfniBfV1 XfhQ== X-Gm-Message-State: AOUpUlGoAk+PRKJHe0Y94mFz2X5cOl/FBJf5AjKmI3jQN67hLkPSMl9H zTqqPVMI2/3JiEqEpyPqTMs= X-Received: by 2002:a63:6b03:: with SMTP id g3-v6mr18053806pgc.57.1531801016523; Mon, 16 Jul 2018 21:16:56 -0700 (PDT) Received: from 192-168-1-101.tpgi.com.com (14-202-218-81.tpgi.com.au. [14.202.218.81]) by smtp.gmail.com with ESMTPSA id v30-v6sm72135915pgn.80.2018.07.16.21.16.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 21:16:55 -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: [PATCH net-next v1 2/3] tcp: convert icsk_user_timeout from jiffies to msecs Date: Tue, 17 Jul 2018 14:16:01 +1000 Message-Id: <20180717041602.31100-3-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 v1 fixes fuzzy Indentation. 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..d212f183dd2d 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