sock_diag: add SK_MEMINFO_BACKLOG
authorEric Dumazet <edumazet@google.com>
Mon, 4 Jun 2012 03:50:35 +0000 (03:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jun 2012 15:27:40 +0000 (11:27 -0400)
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>
include/linux/sock_diag.h
net/core/sock_diag.c

index db4bae78bda94d99af2ab614f70ba87b41949632..6793fac5eab500e056e1030125651e335a644b6a 100644 (file)
@@ -18,6 +18,7 @@ enum {
        SK_MEMINFO_FWD_ALLOC,
        SK_MEMINFO_WMEM_QUEUED,
        SK_MEMINFO_OPTMEM,
+       SK_MEMINFO_BACKLOG,
 
        SK_MEMINFO_VARS,
 };
index 5fd146720f395ff91e85c3ab5ae7f4d543a5e75e..0d934ce1075f2a5912440123ccded872df37c618 100644 (file)
@@ -46,6 +46,7 @@ int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attrtype)
        mem[SK_MEMINFO_FWD_ALLOC] = sk->sk_forward_alloc;
        mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued;
        mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc);
+       mem[SK_MEMINFO_BACKLOG] = sk->sk_backlog.len;
 
        return 0;