Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sock_diag: add SK_MEMINFO_DROPS

Reporting sk_drops to user space was available for UDP
sockets using /proc interface.

Add this to sock_diag, so that we can have the same information
available to ss users, and we'll be able to add sk_drops
indications for TCP sockets as well.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
15239302 3b24d854

+2
+1
include/uapi/linux/sock_diag.h
··· 20 20 SK_MEMINFO_WMEM_QUEUED, 21 21 SK_MEMINFO_OPTMEM, 22 22 SK_MEMINFO_BACKLOG, 23 + SK_MEMINFO_DROPS, 23 24 24 25 SK_MEMINFO_VARS, 25 26 };
+1
net/core/sock_diag.c
··· 67 67 mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued; 68 68 mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc); 69 69 mem[SK_MEMINFO_BACKLOG] = sk->sk_backlog.len; 70 + mem[SK_MEMINFO_DROPS] = atomic_read(&sk->sk_drops); 70 71 71 72 return nla_put(skb, attrtype, sizeof(mem), &mem); 72 73 }