Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1766335rwb; Sun, 6 Aug 2023 02:16:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf0raqf1W0HhKn6fZd0gxS9YdYXsYFNJEA/QD6jQ7879Fnh3BX7iV6zZ5j1KS26wPqQk1K X-Received: by 2002:a17:90b:1d88:b0:269:4645:80b9 with SMTP id pf8-20020a17090b1d8800b00269464580b9mr2174491pjb.2.1691313403255; Sun, 06 Aug 2023 02:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691313403; cv=none; d=google.com; s=arc-20160816; b=NsQmFsrnuAm9tcdujyI7EBO/lfnV30VvPHFij/imgU6y9+S1rm1wOd3S6RgwNKR8h9 xHEWjKSRNvS+rIKosW0lljDilkPA/VBnnuaxmobejYH/rUwLyNkBKkrkRcPEg+mvo8E1 s/zUQDgq2goTxhEt7TgRuRCQ8aXcHDHsxkNEWNl/OBmc0r95OXiinxAWatulDOgy9nPa l3UubpdkMGq6/CDPhj3422s6r/kSo6H8ZVULy0AJM/mb2ILwLlwctSo6y0eIf/T/8jpN lp5nxP1QOpwdcqtM1d6UOTHtp7/tqH8dI3BPwRnLgRJPGhhRUXIje0QMVef9Yewnaku/ bthQ== 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:feedback-id:dkim-signature :dkim-signature; bh=k+YpVT6VAoF7F80t6KXXgq3nfq+BBYr4oC0WOTx8568=; fh=NxRrPv2ILaFmBTTmRDBBm6Iw0sYKZXLg7cHqVDE5S0E=; b=u8C/r7anvTH5M0+THXpeGuRBojv40dj2xG7Kutstrn42Hu1VcBS6gzTSfbcoNkPSHj i6oKthBWZBXH3QSrLLdelMc6jnFSdZdOTwWquTg8N5iTCUka9hrY16nRFdETF3I4evZF Wp58L68v5DkwZ6t7sT6VYBJ4w7UDvTMB56RetMi56nuXSI67Ee8RN9J81J6nzoQCToSk DGv4Udto5fHCoRXQjkWHcDQxlhHpnbWnSJMWiMDQdTngcs0uxctrbPiG0XYYnGXwG07L thLiHc9r2cdkySdH6uWyiIFF0BYRjG0sA3c+xCIGw10gM11z9AgNDG9CK5hXvyYnIDb3 LmBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@manjusaka.me header.s=fm3 header.b=awHlM6U1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=VkhKufPp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q41-20020a17090a1b2c00b00268198ef8f6si7540423pjq.39.2023.08.06.02.16.31; Sun, 06 Aug 2023 02:16:43 -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=@manjusaka.me header.s=fm3 header.b=awHlM6U1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=VkhKufPp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbjHFHwv (ORCPT + 99 others); Sun, 6 Aug 2023 03:52:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjHFHws (ORCPT ); Sun, 6 Aug 2023 03:52:48 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7CD31BD4; Sun, 6 Aug 2023 00:52:45 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9D0ED5C0075; Sun, 6 Aug 2023 03:52:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 06 Aug 2023 03:52:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjusaka.me; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1691308362; x=1691394762; bh=k+YpVT6VAo F7F80t6KXXgq3nfq+BBYr4oC0WOTx8568=; b=awHlM6U1PzHY/fbAnP9S6KyVrX ZGryZK6fH8MwBrytIk5Oe48O4WOsGZ33qUk6kXit1xX6/1HgT6xvd1R0yMf6H2qV s/AwL5kHELXvH50fgTxyI/OrIyuL9f/KeJ2EXqWH8CRnldIJynVz5fWVeEuztMrO W3H9emK7UGmA/DPWmUudSMs7N7GMjEYlstRkcHHfNT8n+rj4mkoQWzIumbeWmM+y XA/ZhijWJ1GJJU547Revt2oIrhE99Kf4Q83e8aRxy6IJ5Jvj86oceROovQ98iBBk wuFOdFqO9s+/MY7mu+Q0T5knq0QjxL2lClmTYOuH3BvDu90a/oDbDTBrdeXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1691308362; x=1691394762; bh=k+YpVT6VAoF7F 80t6KXXgq3nfq+BBYr4oC0WOTx8568=; b=VkhKufPpRwzTrjWI5PNqXzFUTSPM+ GqhOVHLpCc2n89Gqcd3m8erhcwKgkhHNzS9rFky0CJhE6rWpPxSk+UNwPlYGAV1g +AHn5hxi5IIlaZsB/K00JULQJ3T6Fa/TXaTNCQHIPrWq/SRai3m5U4mb8Gg06X8j uvXddhGyS6CtX4cLgYjUhbeQ1+NNTaesxxt6eS/81gQVZgdzf7Soj03A+tM8IhPk XO3BSjQe2S2lkNRUb9fW7LThOIh7UmGaNQiBywONs0pEvrncDN4ii3B871bziR0c YDrb+24co4dJLbFEQNWcbMmKt8FUgYWRuvm1odmSRaYHNPrhUBiJJqHCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkeejgdduvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeforghnjhhushgrkhgruceomhgvsehmrghnjhhushgrkhgrrdhm vgeqnecuggftrfgrthhtvghrnhepvddujeetiefgheehvefhveetieeuudeutdehhedtue etueehjeffhefhueeutdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepmhgvsehmrghnjhhushgrkhgrrdhmvg X-ME-Proxy: Feedback-ID: i3ea9498d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 6 Aug 2023 03:52:38 -0400 (EDT) From: Manjusaka To: edumazet@google.com, mhiramat@kernel.org, rostedt@goodmis.org, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, Manjusaka Subject: [PATCH] [RFC PATCH] tcp event: add new tcp:tcp_cwnd_restart event Date: Sun, 6 Aug 2023 07:52:16 +0000 Message-Id: <20230806075216.13378-1-me@manjusaka.me> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 The tcp_cwnd_restart function would be called if the user has enabled the tcp_slow_start_after_idle configuration and would be triggered when the connection is idle (like LONG RTO etc.). I think it would be great to add a new trace event named 'tcp:tcp_cwnd_reset'; it would help people to monitor the TCP state in a complicated network environment(like overlay/underlay SDN in Kubernetes, etc) Signed-off-by: Manjusaka --- include/trace/events/tcp.h | 7 +++++++ net/ipv4/tcp_output.c | 1 + 2 files changed, 8 insertions(+) diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index bf06db8d2046..fa44191cc609 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -187,6 +187,13 @@ DEFINE_EVENT(tcp_event_sk, tcp_rcv_space_adjust, TP_ARGS(sk) ); +DEFINE_EVENT(tcp_event_sk, tcp_cwnd_restart, + + TP_PROTO(struct sock *sk), + + TP_ARGS(sk) +); + TRACE_EVENT(tcp_retransmit_synack, TP_PROTO(const struct sock *sk, const struct request_sock *req), diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 51d8638d4b4c..e902fa74303d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -141,6 +141,7 @@ static __u16 tcp_advertise_mss(struct sock *sk) */ void tcp_cwnd_restart(struct sock *sk, s32 delta) { + trace_tcp_cwnd_restart(sk); struct tcp_sock *tp = tcp_sk(sk); u32 restart_cwnd = tcp_init_cwnd(tp, __sk_dst_get(sk)); u32 cwnd = tcp_snd_cwnd(tp); -- 2.34.1