Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3126002rwb; Mon, 7 Aug 2023 08:36:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN5zZzyxR9046cZ96IFo5svL/iZS551yYQu8v6yDzyAS+jEUSoYdQ6IH0sbsiJ1toehj7C X-Received: by 2002:aa7:d493:0:b0:523:3751:17b0 with SMTP id b19-20020aa7d493000000b00523375117b0mr3088028edr.16.1691422593264; Mon, 07 Aug 2023 08:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691422593; cv=none; d=google.com; s=arc-20160816; b=NnBNmIA52T3xHqiJvldoyPOWtbnPek3xqunHrvyH6bj0td8k6BovocvMRIp2nYqeWJ B6yUD97o2sYo8mqj0GiKOqIguiULZj/TAQ/DOAcI2h2fnQUNAEM24TQmxh1dNQQxUfKs Wokp+a+0TbXCQSUOMPumUP9I5qbfy+ydHPp29zayGWGDUqXY+yjPmTyy3TXZsyLMhj01 uHCbSsbwuCZKBgfpHut3fszElA38olehL8DXTfQ05blbhYWdzcxAfEzBabsed0kmJk3u +UlZ/aaH4PuOVhO8TANNC55l436ZImzmgTCegEYBSpetYXmzeCDviU23BRhdZLbbvJQw /A2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=Lt8hOx2s13NynnFjaOie8s5FfN5HGBhA+5kSEKOK+zc=; fh=RUOV72EMVwh4yRs+53FP8QsXL6xZGa0OT/zL0wauN3c=; b=cspfzDjly92mXQamK4MYkP6E04VXeRzY0AzAptFMV3SDAiv7LdGyyMx50cDTOtVArj cKZQM5fwOVIMfYLX7gTYDz5GWFonfXXhHL/cVI73Vc9oB+hB5iaYa9F8Qjr63aAW688b zxeDor81R6G0bt+URGcMGJzkQH6CR1mQyK2gBIZ+ij2qlPMDqiqU/qxB10oljtoZRK6/ iqMQtCXfTAdII+XQG6YGe9K4qfrbx7YG2m2Bzy8P86CfCMLBeCU3tSLqUo5S3EeEzuov rbDGvBs0hJSpg1Yi2dfUzce67NzfB8V5fMht7t6l0C6eT0mxPNOMgbY+PRJHT9EONJ9O xv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@manjusaka.me header.s=fm3 header.b=QodS85LZ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=hRCDQ0LY; 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 t26-20020a05640203da00b005233885dc41si1349436edw.507.2023.08.07.08.36.08; Mon, 07 Aug 2023 08:36:33 -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=QodS85LZ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=hRCDQ0LY; 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 S232912AbjHGMvY (ORCPT + 99 others); Mon, 7 Aug 2023 08:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjHGMvW (ORCPT ); Mon, 7 Aug 2023 08:51:22 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADDBFC9; Mon, 7 Aug 2023 05:51:21 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 248F45C00AF; Mon, 7 Aug 2023 08:51:21 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute4.internal (MEProxy); Mon, 07 Aug 2023 08:51:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjusaka.me; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1691412681; x=1691499081; bh=Lt8hOx2s13NynnFjaOie8s5FfN5HGBhA+5k SEKOK+zc=; b=QodS85LZyPZ3yoGP1hEd5iCF2fM0nFMaO5nA/Zoe8c+0zxYqoaK i7uxbDKtMfj0k9spjPC4dAsgCjkWGwIfu91A8OYeKL1KMTqdqpvSLSdvPj9qTMlV KdCDLt1bAil53Oy5t68Ry7iZiethODhcusrezTd2QmpSTErRlKBnXgsVz6aI2j5P 4rixov0B96J0LMUtzHrsJSplo0au/TIds9Hgpjj25qCHBVbMdkU4RacKG+cEsOgS lZj5rliz+r5l/PXy62eXi6pbXw0P9r6pq9YBuzGj+8HyrldEAbYkFROl1DfvSbqf 969LhD+wMU+g5mFzv/aKXBWaZjI1/YROlJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references: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= 1691412681; x=1691499081; bh=Lt8hOx2s13NynnFjaOie8s5FfN5HGBhA+5k SEKOK+zc=; b=hRCDQ0LY3RH0+tWuYz92V/SIeW5z6Vw7kCOIG9j7fTzoHKaPAbt lp9Kb/l8W2dzPYQxybwvhljH7A4/EAJlZUDaF7b01eAqFNEfAQVsNt4RK2rtxbBm XZgUh3FfLK/813CYmkUqmloP3XJ1DZCS8qwDgYJi5wBorG+i2KMv+VDBFUuFrbKK mgPqaBnGS60VXzCtfGFAYQmqw0b+OXkneFzyku878ThSfMBgyVELTSw1xqrSSB+A GXOUGDylhwyjExAXXkCETO6vUblWmON2zQP5e/DkBK/MG4bGjFauo4HPVBfDsikZ C5Fek/3laeT2NVh9jIALO0ItbOCy5yPCtoQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrledtgdehiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpeforghn jhhushgrkhgruceomhgvsehmrghnjhhushgrkhgrrdhmvgeqnecuggftrfgrthhtvghrnh epffdvfeejleefjeegfedtieeuleelhffhuedufeevkeeltdelgeetiefgkefhvddvnecu ffhomhgrihhnpegsohhothhlihhnrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgvsehmrghnjhhushgrkhgrrdhmvg X-ME-Proxy: Feedback-ID: i3ea9498d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id EAA2831A0064; Mon, 7 Aug 2023 08:51:20 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230806075216.13378-1-me@manjusaka.me> Date: Mon, 07 Aug 2023 20:51:00 +0800 From: Manjusaka To: "Eric Dumazet" Cc: mhiramat@kernel.org, rostedt@goodmis.org, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] [RFC PATCH] tcp event: add new tcp:tcp_cwnd_restart event Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 > Do not include code before variable declarations. Sorry about that. I will update the code later. > I would rather add a trace in tcp_ca_event(), this would be more gener= ic ? https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_cong.c#L41 I think maybe we already have the tcp_ca_event but named tcp_cong_state_= set? On Mon, Aug 7, 2023, at 8:34 PM, Eric Dumazet wrote: > On Sun, Aug 6, 2023 at 9:52=E2=80=AFAM Manjusaka wro= te: > > > > The tcp_cwnd_restart function would be called if the user has enable= d 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 peop= le > > 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 *r= eq), > > 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); >=20 > Do not include code before variable declarations. >=20 > > struct tcp_sock *tp =3D tcp_sk(sk); > > u32 restart_cwnd =3D tcp_init_cwnd(tp, __sk_dst_get(sk)); > > u32 cwnd =3D tcp_snd_cwnd(tp); > > -- > > 2.34.1 > > >=20 > I would rather add a trace in tcp_ca_event(), this would be more gener= ic ? >=20