From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, Amerigo Wang <amwang@redhat.com>,
David Miller <davem@davemloft.net>
Subject: [Patch] net: export TCP send buffer size via netlink
Date: Mon, 1 Feb 2010 02:59:32 -0500 [thread overview]
Message-ID: <20100201080256.4084.30962.sendpatchset@localhost.localdomain> (raw)
Currently, we can only get TCP send buffer size by
getsockopt (SO_SNDBUF or TCP_INFO), this is not enough
for the tools like netstat or ss to read.
Show TCP send buffer size via netlink NETLINK_INET_DIAG.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
---
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7fee8a4..46768de 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -136,6 +136,7 @@ struct tcp_info {
__u32 tcpi_ato;
__u32 tcpi_snd_mss;
__u32 tcpi_rcv_mss;
+ __u32 tcpi_sndbuf;
__u32 tcpi_unacked;
__u32 tcpi_sacked;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b0a26bb..b3d6a62 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2385,6 +2385,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info->tcpi_retransmits = icsk->icsk_retransmits;
info->tcpi_probes = icsk->icsk_probes_out;
info->tcpi_backoff = icsk->icsk_backoff;
+ info->tcpi_sndbuf = sk->sk_sndbuf;
if (tp->rx_opt.tstamp_ok)
info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
next reply other threads:[~2010-02-01 7:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 7:59 Amerigo Wang [this message]
2010-02-01 8:51 ` [Patch] net: export TCP send buffer size via netlink Eric Dumazet
2010-02-01 9:04 ` Cong Wang
2010-02-01 9:58 ` 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=20100201080256.4084.30962.sendpatchset@localhost.localdomain \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).