提交 15239302 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3b24d854
...@@ -20,6 +20,7 @@ enum { ...@@ -20,6 +20,7 @@ enum {
SK_MEMINFO_WMEM_QUEUED, SK_MEMINFO_WMEM_QUEUED,
SK_MEMINFO_OPTMEM, SK_MEMINFO_OPTMEM,
SK_MEMINFO_BACKLOG, SK_MEMINFO_BACKLOG,
SK_MEMINFO_DROPS,
SK_MEMINFO_VARS, SK_MEMINFO_VARS,
}; };
......
...@@ -67,6 +67,7 @@ int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attrtype) ...@@ -67,6 +67,7 @@ int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attrtype)
mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued; mem[SK_MEMINFO_WMEM_QUEUED] = sk->sk_wmem_queued;
mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc); mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc);
mem[SK_MEMINFO_BACKLOG] = sk->sk_backlog.len; mem[SK_MEMINFO_BACKLOG] = sk->sk_backlog.len;
mem[SK_MEMINFO_DROPS] = atomic_read(&sk->sk_drops);
return nla_put(skb, attrtype, sizeof(mem), &mem); return nla_put(skb, attrtype, sizeof(mem), &mem);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册