aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-06-03 23:50:35 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-04 11:27:40 -0400
commitd594e987c6f5417cc63dd7e107a2a03a7eeee03f (patch)
tree383bbb0260798a4f0db49f1fc331c085a2ce3d85
parent5d0ba55b6486f58cc890918d7167063d83f7fbb4 (diff)
sock_diag: add SK_MEMINFO_BACKLOG
Adding socket backlog len in INET_DIAG_SKMEMINFO is really useful to diagnose various TCP problems. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/sock_diag.h1
-rw-r--r--net/core/sock_diag.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index db4bae78bda9..6793fac5eab5 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -18,6 +18,7 @@ enum {
18 SK_MEMINFO_FWD_ALLOC, 18 SK_MEMINFO_FWD_ALLOC,
19 SK_MEMINFO_WMEM_QUEUED, 19 SK_MEMINFO_WMEM_QUEUED,
20 SK_MEMINFO_OPTMEM, 20 SK_MEMINFO_OPTMEM,
21 SK_MEMINFO_BACKLOG,
21 22
22 SK_MEMINFO_VARS, 23 SK_MEMINFO_VARS,
23}; 24};
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
index 5fd146720f39..0d934ce1075f 100644
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -46,6 +46,7 @@ int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attrtype)
46 mem[SK_MEMINFO_FWD_ALLOC] = sk->sk_forward_alloc; 46 mem[SK_MEMINFO_FWD_ALLOC] = sk->sk_forward_alloc;
47 mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued; 47 mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued;
48 mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc); 48 mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc);
49 mem[SK_MEMINFO_BACKLOG] = sk->sk_backlog.len;
49 50
50 return 0; 51 return 0;
51 52