From patchwork Fri Apr 29 10:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengcheng Yang X-Patchwork-Id: 12831778 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1995CC433F5 for ; Fri, 29 Apr 2022 10:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357494AbiD2Khm (ORCPT ); Fri, 29 Apr 2022 06:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357489AbiD2Khl (ORCPT ); Fri, 29 Apr 2022 06:37:41 -0400 Received: from zg8tmty1ljiyny4xntqumjca.icoremail.net (zg8tmty1ljiyny4xntqumjca.icoremail.net [165.227.154.27]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 847B8B36AF for ; Fri, 29 Apr 2022 03:34:19 -0700 (PDT) Received: from 102.wangsu.com (unknown [59.61.78.232]) by app1 (Coremail) with SMTP id SiJltAD3_xMIv2tiJ7cCAA--.204S2; Fri, 29 Apr 2022 18:33:44 +0800 (CST) From: Pengcheng Yang To: Eric Dumazet , Neal Cardwell , netdev@vger.kernel.org Cc: "David S. Miller" , Hideaki YOSHIFUJI , Jakub Kicinski , Paolo Abeni , David Ahern , Pengcheng Yang Subject: [PATCH net-next] tcp: use tcp_skb_sent_after() instead in RACK Date: Fri, 29 Apr 2022 18:32:56 +0800 Message-Id: <1651228376-10737-1-git-send-email-yangpc@wangsu.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: SiJltAD3_xMIv2tiJ7cCAA--.204S2 X-Coremail-Antispam: 1UD129KBjvJ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.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch doesn't change any functionality. Signed-off-by: Pengcheng Yang Cc: Neal Cardwell Acked-by: Neal Cardwell Tested-by: Neal Cardwell Reviewed-by: Eric Dumazet --- net/ipv4/tcp_recovery.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c index fd113f6..48f30e7 100644 --- a/net/ipv4/tcp_recovery.c +++ b/net/ipv4/tcp_recovery.c @@ -2,11 +2,6 @@ #include #include -static bool tcp_rack_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2) -{ - return t1 > t2 || (t1 == t2 && after(seq1, seq2)); -} - static u32 tcp_rack_reo_wnd(const struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); @@ -77,9 +72,9 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) !(scb->sacked & TCPCB_SACKED_RETRANS)) continue; - if (!tcp_rack_sent_after(tp->rack.mstamp, - tcp_skb_timestamp_us(skb), - tp->rack.end_seq, scb->end_seq)) + if (!tcp_skb_sent_after(tp->rack.mstamp, + tcp_skb_timestamp_us(skb), + tp->rack.end_seq, scb->end_seq)) break; /* A packet is lost if it has not been s/acked beyond @@ -140,8 +135,8 @@ void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq, } tp->rack.advanced = 1; tp->rack.rtt_us = rtt_us; - if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp, - end_seq, tp->rack.end_seq)) { + if (tcp_skb_sent_after(xmit_time, tp->rack.mstamp, + end_seq, tp->rack.end_seq)) { tp->rack.mstamp = xmit_time; tp->rack.end_seq = end_seq; }