netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog
@ 2012-06-06 23:11 Vijay Subramanian
  2012-06-06 23:23 ` Stephen Hemminger
  2012-06-07  4:20 ` Eric Dumazet
  0 siblings, 2 replies; 5+ messages in thread
From: Vijay Subramanian @ 2012-06-06 23:11 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Eric Dumazet, Vijay Subramanian

This adds the ability to print the backlog length of sockets that is provided by
recent Linux kernels since commit (d594e987c6 sock_diag: add
SK_MEMINFO_BACKLOG).

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
 include/linux/sock_diag.h |    1 +
 misc/ss.c                 |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index 39e4b1c..ac9db19 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -18,6 +18,7 @@ enum {
 	SK_MEMINFO_FWD_ALLOC,
 	SK_MEMINFO_WMEM_QUEUED,
 	SK_MEMINFO_OPTMEM,
+	SK_MEMINFO_BACKLOG,
 
 	SK_MEMINFO_VARS,
 };
diff --git a/misc/ss.c b/misc/ss.c
index cf529ef..ea14e2b 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1338,14 +1338,15 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r)
 
 	if (tb[INET_DIAG_SKMEMINFO]) {
 		const __u32 *skmeminfo =  RTA_DATA(tb[INET_DIAG_SKMEMINFO]);
-		printf(" skmem:(r%u,rb%u,t%u,tb%u,f%u,w%u,o%u)",
+		printf(" skmem:(r%u,rb%u,t%u,tb%u,f%u,w%u,o%u,bl%u)",
 			skmeminfo[SK_MEMINFO_RMEM_ALLOC],
 			skmeminfo[SK_MEMINFO_RCVBUF],
 			skmeminfo[SK_MEMINFO_WMEM_ALLOC],
 			skmeminfo[SK_MEMINFO_SNDBUF],
 			skmeminfo[SK_MEMINFO_FWD_ALLOC],
 			skmeminfo[SK_MEMINFO_WMEM_QUEUED],
-			skmeminfo[SK_MEMINFO_OPTMEM]);
+			skmeminfo[SK_MEMINFO_OPTMEM],
+			skmeminfo[SK_MEMINFO_BACKLOG]);
 	}else if (tb[INET_DIAG_MEMINFO]) {
 		const struct inet_diag_meminfo *minfo
 			= RTA_DATA(tb[INET_DIAG_MEMINFO]);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog
  2012-06-06 23:11 [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog Vijay Subramanian
@ 2012-06-06 23:23 ` Stephen Hemminger
  2012-06-07  4:20 ` Eric Dumazet
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2012-06-06 23:23 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, Eric Dumazet

On Wed,  6 Jun 2012 16:11:32 -0700
Vijay Subramanian <subramanian.vijay@gmail.com> wrote:

> This adds the ability to print the backlog length of sockets that is provided by
> recent Linux kernels since commit (d594e987c6 sock_diag: add
> SK_MEMINFO_BACKLOG).
> 
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>

Since the SK_MEMINFO_BACKLOG is not in 3.5 (it is in net-next);
please resubmit this when it is accepted in Linus's tree.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog
  2012-06-06 23:11 [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog Vijay Subramanian
  2012-06-06 23:23 ` Stephen Hemminger
@ 2012-06-07  4:20 ` Eric Dumazet
  2012-06-07  5:18   ` Vijay Subramanian
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2012-06-07  4:20 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, Stephen Hemminger

On Wed, 2012-06-06 at 16:11 -0700, Vijay Subramanian wrote:
> This adds the ability to print the backlog length of sockets that is provided by
> recent Linux kernels since commit (d594e987c6 sock_diag: add
> SK_MEMINFO_BACKLOG).
> 
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> ---
>  include/linux/sock_diag.h |    1 +
>  misc/ss.c                 |    5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
> index 39e4b1c..ac9db19 100644
> --- a/include/linux/sock_diag.h
> +++ b/include/linux/sock_diag.h
> @@ -18,6 +18,7 @@ enum {
>  	SK_MEMINFO_FWD_ALLOC,
>  	SK_MEMINFO_WMEM_QUEUED,
>  	SK_MEMINFO_OPTMEM,
> +	SK_MEMINFO_BACKLOG,
>  
>  	SK_MEMINFO_VARS,
>  };
> diff --git a/misc/ss.c b/misc/ss.c
> index cf529ef..ea14e2b 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -1338,14 +1338,15 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r)
>  
>  	if (tb[INET_DIAG_SKMEMINFO]) {
>  		const __u32 *skmeminfo =  RTA_DATA(tb[INET_DIAG_SKMEMINFO]);
> -		printf(" skmem:(r%u,rb%u,t%u,tb%u,f%u,w%u,o%u)",
> +		printf(" skmem:(r%u,rb%u,t%u,tb%u,f%u,w%u,o%u,bl%u)",
>  			skmeminfo[SK_MEMINFO_RMEM_ALLOC],
>  			skmeminfo[SK_MEMINFO_RCVBUF],
>  			skmeminfo[SK_MEMINFO_WMEM_ALLOC],
>  			skmeminfo[SK_MEMINFO_SNDBUF],
>  			skmeminfo[SK_MEMINFO_FWD_ALLOC],
>  			skmeminfo[SK_MEMINFO_WMEM_QUEUED],
> -			skmeminfo[SK_MEMINFO_OPTMEM]);
> +			skmeminfo[SK_MEMINFO_OPTMEM],
> +			skmeminfo[SK_MEMINFO_BACKLOG]);
>  	}else if (tb[INET_DIAG_MEMINFO]) {
>  		const struct inet_diag_meminfo *minfo
>  			= RTA_DATA(tb[INET_DIAG_MEMINFO]);


This is not the right way to handle this.

I already have a patch and was waiting the appropriate time to submit
it.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog
  2012-06-07  4:20 ` Eric Dumazet
@ 2012-06-07  5:18   ` Vijay Subramanian
  2012-06-07  5:32     ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Vijay Subramanian @ 2012-06-07  5:18 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Stephen Hemminger

> This is not the right way to handle this.
>
> I already have a patch and was waiting the appropriate time to submit
> it.
>
Thanks. I will wait for your patch to see what I missed.

Vijay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog
  2012-06-07  5:18   ` Vijay Subramanian
@ 2012-06-07  5:32     ` Eric Dumazet
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2012-06-07  5:32 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, Stephen Hemminger

On Wed, 2012-06-06 at 22:18 -0700, Vijay Subramanian wrote:
> > This is not the right way to handle this.
> >
> > I already have a patch and was waiting the appropriate time to submit
> > it.
> >
> Thanks. I will wait for your patch to see what I missed.
> 
> Vijay

Well, the trick is that we must support previous kernels (3.5 for
example), so should not display backlog info on them.

I'll send the patch, dont worry ;)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-07  5:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 23:11 [PATCH IPROUTE2] ss: Add support for sk_meminfo_backlog Vijay Subramanian
2012-06-06 23:23 ` Stephen Hemminger
2012-06-07  4:20 ` Eric Dumazet
2012-06-07  5:18   ` Vijay Subramanian
2012-06-07  5:32     ` Eric Dumazet

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).