Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4513197imw; Tue, 19 Jul 2022 08:02:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uXrV7JEAK2QdcVXAmcnEOe8ZVy8rnxoFwVhRdB20u2E25ejyfLYeH/zbVpwOXYlk/SOOPx X-Received: by 2002:a17:907:7d91:b0:72b:4d74:f4f6 with SMTP id oz17-20020a1709077d9100b0072b4d74f4f6mr30133687ejc.314.1658242929422; Tue, 19 Jul 2022 08:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658242929; cv=none; d=google.com; s=arc-20160816; b=HWWlvXxa4Ngf9UcDjImpAtLD3qTDtJ1Dr5LKlSO278OEK4216gZCbwcAgXTBwmu/5l 6szc+NOpJBmxXAYQSjdnsb8HcKdVhgFWPYduSxmVd+1uqUrUnbTbSc9iigRHm6JH5WNe OU3DJ00IlUYdxx/eTInpORU8ALnsJH5aWaywZARs8qVXmLpdgyM+cgY297uGcdc8YKap wXP39qtntvdnh1kbBdaB8Qn2O75ocFjgodZatKm/gFPZ4cM1kIS6Ayh8SSm823hiqb2X eGYRQaXfHhVPKLZK6VZgmCBT9Qmt7gbsKmzq+vHu1bVUx3Pr3ggm5JSX5MPETWzfWDUR C4uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7TN6Ys6lyWLDn5YUA0Tv3OcWK4i5YKVKHK2RMkEF81k=; b=NSNOjn7NvrUSCohgTZ7VVQPCSZfbD5pCGhWIxKn+v3F8wtBmbCKm++SQZ/1axcGUyD W8W3jU5rLpDInkz/gM9Qi8+wiXOi7bi10Jf9A400NzJGc+2FjgD+lR5UM/xPQcMmUM2/ 1HTtBDf3+milhGl+2+D+hj5zEP0EzkSYt6tj+r3xphFc62OWOV04or/r1XZVtad/wJ9z B+oV2CKC/rYd26+rf4LbNSc8CAoT15GjERDM6cLBG5gmeM8+jAuMr8g3EXCsHFljUYNV 7j2rfw5876wnb1Ffxbje8sMGaFAulwWgqSijOlO+b2zxkUt66jEfWZaXQsGmxvTvmPdM wxOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=pfIMkLvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fw8-20020a170907500800b007156fc5217bsi16192658ejc.899.2022.07.19.08.01.36; Tue, 19 Jul 2022 08:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=pfIMkLvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238226AbiGSNus (ORCPT + 99 others); Tue, 19 Jul 2022 09:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236906AbiGSNua (ORCPT ); Tue, 19 Jul 2022 09:50:30 -0400 Received: from mail-m973.mail.163.com (mail-m973.mail.163.com [123.126.97.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB46781B0E; Tue, 19 Jul 2022 06:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=7TN6Y s6lyWLDn5YUA0Tv3OcWK4i5YKVKHK2RMkEF81k=; b=pfIMkLvrClzv+tPblYxnN BRSjghAtS0XZj2Sh4P1ks+cNl6ZLka48JcjSuiHaM9UZSox7XcUQTOJo9fUT4h+R sE74bC2KWJKCoADeMl35MftzBFBVHdNTB1Smzjiyd23VTv7UK+J7ML4gS67m8jKd MNiHass6M2iGTt2adNsSg8= Received: from localhost.localdomain (unknown [112.95.163.118]) by smtp3 (Coremail) with SMTP id G9xpCgDXc5VUq9ZixZwlQA--.4530S2; Tue, 19 Jul 2022 21:02:28 +0800 (CST) From: LemmyHuang To: edumazet@google.com, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, LemmyHuang Subject: [PATCH net-next] tcp: fix condition for increasing pingpong count Date: Tue, 19 Jul 2022 21:01:37 +0800 Message-Id: <20220719130136.11907-1-hlm3280@163.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: G9xpCgDXc5VUq9ZixZwlQA--.4530S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFWxZFy8Ary7tF1UAF4rGrg_yoWfArbEkw 1DGrZFyr43Jrn7t34093yYqFy8KrsxWF1Fkr13uas3t3W8tF1DCrZ3Cry3ZrsYkr45Wry5 Zws8tF1UZ342qjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_SdgJUUUUU== X-Originating-IP: [112.95.163.118] X-CM-SenderInfo: pkopjjiyq6il2tof0z/1tbiWAVD+VuHzZ1pcQAAsz X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_HZ defaults to 1000Hz and the network transmission time is less than 1ms, lsndtime and lrcvtime are likely to be equal, which will lead to hundreds of interactions before entering pingpong mode. Signed-off-by: LemmyHuang --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 858a15cc2..35ed65f80 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -172,7 +172,7 @@ static void tcp_event_data_sent(struct tcp_sock *tp, * and it is a reply for ato after last received packet, * increase pingpong count. */ - if (before(tp->lsndtime, icsk->icsk_ack.lrcvtime) && + if ((tp->lsndtime <= icsk->icsk_ack.lrcvtime) && (u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) inet_csk_inc_pingpong_cnt(sk); -- 2.27.0