netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Higdon <tph@fb.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Jonathan Lemon <jonathan.lemon@gmail.com>,
	Dave Jones <dsj@fb.com>, "Eric Dumazet" <edumazet@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	"Dave Taht" <dave.taht@gmail.com>,
	Yuchung Cheng <ycheng@google.com>,
	"Soheil Hassas Yeganeh" <soheil@google.com>
Subject: [PATCH v5 2/2] tcp: Add snd_wnd to TCP_INFO
Date: Fri, 13 Sep 2019 23:23:35 +0000	[thread overview]
Message-ID: <20190913232332.44036-2-tph@fb.com> (raw)
In-Reply-To: <20190913232332.44036-1-tph@fb.com>

Neal Cardwell mentioned that snd_wnd would be useful for diagnosing TCP
performance problems --
> (1) Usually when we're diagnosing TCP performance problems, we do so
> from the sender, since the sender makes most of the
> performance-critical decisions (cwnd, pacing, TSO size, TSQ, etc).
> From the sender-side the thing that would be most useful is to see
> tp->snd_wnd, the receive window that the receiver has advertised to
> the sender.

This serves the purpose of adding an additional __u32 to avoid the
would-be hole caused by the addition of the tcpi_rcvi_ooopack field.

Signed-off-by: Thomas Higdon <tph@fb.com>
---
changes since v4:
 - clarify comment
 include/uapi/linux/tcp.h | 4 ++++
 net/ipv4/tcp.c           | 1 +
 2 files changed, 5 insertions(+)

diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 20237987ccc8..81e697978e8b 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -272,6 +272,10 @@ struct tcp_info {
 	__u32	tcpi_reord_seen;     /* reordering events seen */
 
 	__u32	tcpi_rcv_ooopack;    /* Out-of-order packets received */
+
+	__u32	tcpi_snd_wnd;	     /* peer's advertised receive window after
+				      * scaling (bytes)
+				      */
 };
 
 /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4cf58208270e..79c325a07ba5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3297,6 +3297,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
 	info->tcpi_dsack_dups = tp->dsack_dups;
 	info->tcpi_reord_seen = tp->reord_seen;
 	info->tcpi_rcv_ooopack = tp->rcv_ooopack;
+	info->tcpi_snd_wnd = tp->snd_wnd;
 	unlock_sock_fast(sk, slow);
 }
 EXPORT_SYMBOL_GPL(tcp_get_info);
-- 
2.17.1


  reply	other threads:[~2019-09-13 23:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 23:23 [PATCH v5 1/2] tcp: Add TCP_INFO counter for packets received out-of-order Thomas Higdon
2019-09-13 23:23 ` Thomas Higdon [this message]
2019-09-13 23:36   ` [PATCH v5 2/2] tcp: Add snd_wnd to TCP_INFO Yuchung Cheng
2019-09-14 15:45   ` Neal Cardwell
2019-09-14 17:57     ` Soheil Hassas Yeganeh
2019-09-16 14:39   ` David Miller
2019-09-14 15:43 ` [PATCH v5 1/2] tcp: Add TCP_INFO counter for packets received out-of-order Neal Cardwell
2019-09-16 17:42   ` Thomas Higdon
2019-09-16 14:39 ` David Miller

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=20190913232332.44036-2-tph@fb.com \
    --to=tph@fb.com \
    --cc=dave.taht@gmail.com \
    --cc=dsj@fb.com \
    --cc=edumazet@google.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=soheil@google.com \
    --cc=ycheng@google.com \
    /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).