[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206111629.3521865-4-shaojijie@huawei.com>
Date: Fri, 6 Dec 2024 19:16:24 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <andrew+netdev@...n.ch>, <horms@...nel.org>,
<gregkh@...uxfoundation.org>
CC: <shenjian15@...wei.com>, <wangpeiyang1@...wei.com>,
<liuyonglong@...wei.com>, <chenhao418@...wei.com>, <sudongming1@...wei.com>,
<xujunsheng@...wei.com>, <shiyongbang@...wei.com>, <libaihan@...wei.com>,
<jonathan.cameron@...wei.com>, <shameerali.kolothum.thodi@...wei.com>,
<salil.mehta@...wei.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <shaojijie@...wei.com>, <hkelam@...vell.com>
Subject: [PATCH V5 net-next 3/8] net: hibmcge: Add irq_info file to debugfs
the driver requested three interrupts: "tx", "rx", "err".
The err interrupt is a summary interrupt. We distinguish
different errors based on the status register and mask.
With "cat /proc/interrupts | grep hibmcge",
we can't distinguish the detailed cause of the error,
so we added this file to debugfs.
the following effects are achieved:
[root@...alhost sjj]# cat /sys/kernel/debug/hibmcge/0000\:83\:00.1/irq_info
RX : enabled: true , logged: false, count: 0
TX : enabled: true , logged: false, count: 0
MAC_MII_FIFO_ERR : enabled: false, logged: true , count: 0
MAC_PCS_RX_FIFO_ERR : enabled: false, logged: true , count: 0
MAC_PCS_TX_FIFO_ERR : enabled: false, logged: true , count: 0
MAC_APP_RX_FIFO_ERR : enabled: false, logged: true , count: 0
MAC_APP_TX_FIFO_ERR : enabled: false, logged: true , count: 0
SRAM_PARITY_ERR : enabled: true , logged: true , count: 0
TX_AHB_ERR : enabled: true , logged: true , count: 0
RX_BUF_AVL : enabled: true , logged: false, count: 0
REL_BUF_ERR : enabled: true , logged: true , count: 0
TXCFG_AVL : enabled: true , logged: false, count: 0
TX_DROP : enabled: true , logged: false, count: 0
RX_DROP : enabled: true , logged: false, count: 0
RX_AHB_ERR : enabled: true , logged: true , count: 0
MAC_FIFO_ERR : enabled: true , logged: false, count: 0
RBREQ_ERR : enabled: true , logged: false, count: 0
WE_ERR : enabled: true , logged: false, count: 0
The irq framework of hibmcge driver also includes tx/rx interrupts.
Therefore, TX and RX are not moved separately form this file.
Signed-off-by: Jijie Shao <shaojijie@...wei.com>
Reviewed-by: Simon Horman <horms@...nel.org>
---
.../ethernet/hisilicon/hibmcge/hbg_debugfs.c | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c
index d445c0c1035c..af550f8258b2 100644
--- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c
@@ -56,9 +56,31 @@ static int hbg_dbg_rx_ring(struct seq_file *s, void *unused)
return 0;
}
+static int hbg_dbg_irq_info(struct seq_file *s, void *unused)
+{
+ struct net_device *netdev = dev_get_drvdata(s->private);
+ struct hbg_priv *priv = netdev_priv(netdev);
+ struct hbg_irq_info *info;
+ u32 i;
+
+ for (i = 0; i < priv->vectors.info_array_len; i++) {
+ info = &priv->vectors.info_array[i];
+ seq_printf(s,
+ "%-20s: enabled: %-5s, logged: %-5s, count: %llu\n",
+ info->name,
+ hbg_get_bool_str(hbg_hw_irq_is_enabled(priv,
+ info->mask)),
+ hbg_get_bool_str(info->need_print),
+ info->count);
+ }
+
+ return 0;
+}
+
static const struct hbg_dbg_info hbg_dbg_infos[] = {
{ "tx_ring", hbg_dbg_tx_ring },
{ "rx_ring", hbg_dbg_rx_ring },
+ { "irq_info", hbg_dbg_irq_info },
};
void hbg_debugfs_init(struct hbg_priv *priv)
--
2.33.0
Powered by blists - more mailing lists