[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240826092625.2637632-1-liumingrui@huawei.com>
Date: Mon, 26 Aug 2024 09:26:25 +0000
From: Liu Mingrui <liumingrui@...wei.com>
To: <willemdebruijn.kernel@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
CC: <netdev@...r.kernel.org>, <liumingrui@...wei.com>
Subject: [PATCH -next] af_packet: display drop field in packet_seq_show
Display the dropped count of the packet, which could provide more
information for debugging.
Signed-off-by: Liu Mingrui <liumingrui@...wei.com>
---
net/packet/af_packet.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 4a364cdd445e..22c59ee61888 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4771,14 +4771,14 @@ static int packet_seq_show(struct seq_file *seq, void *v)
{
if (v == SEQ_START_TOKEN)
seq_printf(seq,
- "%*sRefCnt Type Proto Iface R Rmem User Inode\n",
+ "%*sRefCnt Type Proto Iface R Rmem User Inode Drops\n",
IS_ENABLED(CONFIG_64BIT) ? -17 : -9, "sk");
else {
struct sock *s = sk_entry(v);
const struct packet_sock *po = pkt_sk(s);
seq_printf(seq,
- "%pK %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu\n",
+ "%pK %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu %u\n",
s,
refcount_read(&s->sk_refcnt),
s->sk_type,
@@ -4787,7 +4787,8 @@ static int packet_seq_show(struct seq_file *seq, void *v)
packet_sock_flag(po, PACKET_SOCK_RUNNING),
atomic_read(&s->sk_rmem_alloc),
from_kuid_munged(seq_user_ns(seq), sock_i_uid(s)),
- sock_i_ino(s));
+ sock_i_ino(s),
+ atomic_read(&po->tp_drops));
}
return 0;
--
2.25.1
Powered by blists - more mailing lists