All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@parallels.com>
To: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH 3/5] inet_diag: Extend the meminfo report
Date: Wed, 28 Dec 2011 17:38:40 +0400	[thread overview]
Message-ID: <4EFB1BE0.1020305@parallels.com> (raw)

Add the backlog length and wmem and rmem buffers limits.
With this the TCP memory info is full and can be analyzed.

Few words about extending the existing structure. The nla engine stores lengths of
fields and the nla parser will parse the new format successfully (checked on the ss
tool). But new apps will have to take this field's length into account. Hopefully
this is acceptable price for not introducing another ext bit and structure.

Singed-off-by: Pavel Emelyanov <xemul@parallels.com>

---
 include/linux/inet_diag.h |    3 +++
 net/ipv4/inet_diag.c      |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index afa5d5c..d274712 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -120,6 +120,9 @@ struct inet_diag_meminfo {
 	__u32	idiag_wmem;
 	__u32	idiag_fmem;
 	__u32	idiag_tmem;
+	__u32	idiag_backlog;
+	__u32	idiag_rcvbuf;
+	__u32	idiag_sndbuf;
 };
 
 /* INET_DIAG_VEGASINFO */
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index fb2e47f..91f9092 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -134,6 +134,9 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
 		minfo->idiag_wmem = sk->sk_wmem_queued;
 		minfo->idiag_fmem = sk->sk_forward_alloc;
 		minfo->idiag_tmem = sk_wmem_alloc_get(sk);
+		minfo->idiag_backlog = sk->sk_backlog.len;
+		minfo->idiag_rcvbuf = sk->sk_rcvbuf;
+		minfo->idiag_sndbuf = sk->sk_sndbuf;
 	}
 
 	if (icsk == NULL) {
-- 
1.5.5.6

             reply	other threads:[~2011-12-28 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28 13:38 Pavel Emelyanov [this message]
2011-12-28 18:45 ` [PATCH 3/5] inet_diag: Extend the meminfo report David Miller
2011-12-28 18:58   ` Pavel Emelyanov
2011-12-28 19:02     ` 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=4EFB1BE0.1020305@parallels.com \
    --to=xemul@parallels.com \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.