netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manjusaka <me@manjusaka.me>
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 <me@manjusaka.me>
Subject: [PATCH] [RFC PATCH] tcp event: add new tcp:tcp_cwnd_restart event
Date: Sun,  6 Aug 2023 07:52:16 +0000	[thread overview]
Message-ID: <20230806075216.13378-1-me@manjusaka.me> (raw)

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 <me@manjusaka.me>
---
 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


             reply	other threads:[~2023-08-06  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06  7:52 Manjusaka [this message]
2023-08-07 12:34 ` [PATCH] [RFC PATCH] tcp event: add new tcp:tcp_cwnd_restart event Eric Dumazet
2023-08-07 12:51   ` Manjusaka
     [not found]   ` <8d25f9e8-9653-4e9b-b88b-c5434ce8aabf@app.fastmail.com>
2023-08-07 13:25     ` Eric Dumazet
2023-08-07 13:40       ` Manjusaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230806075216.13378-1-me@manjusaka.me \
    --to=me@manjusaka.me \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).