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

Configure Feed

Select the types of activity you want to include in your feed.

net: hibmcge: support for statistics of reset failures

Add a statistical item to count the number of reset failures.
This statistical item can be queried using ethtool -S or
reported through diagnose information.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20250723074826.2756135-1-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jijie Shao and committed by
Jakub Kicinski
15dc08fd fe09560f

+5
+1
drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
··· 258 258 u64 tx_dma_err_cnt; 259 259 260 260 u64 np_link_fail_cnt; 261 + u64 reset_fail_cnt; 261 262 }; 262 263 263 264 struct hbg_priv {
+1
drivers/net/ethernet/hisilicon/hibmcge/hbg_diagnose.c
··· 156 156 HBG_PUSH_STATS_I(tx_drop_cnt, 84), 157 157 HBG_PUSH_STATS_I(tx_excessive_length_drop_cnt, 85), 158 158 HBG_PUSH_STATS_I(tx_dma_err_cnt, 86), 159 + HBG_PUSH_STATS_I(reset_fail_cnt, 87), 159 160 }; 160 161 161 162 static int hbg_push_msg_send(struct hbg_priv *priv,
+2
drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c
··· 68 68 clear_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state); 69 69 ret = hbg_hw_event_notify(priv, HBG_HW_EVENT_RESET); 70 70 if (ret) { 71 + priv->stats.reset_fail_cnt++; 71 72 set_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state); 72 73 clear_bit(HBG_NIC_STATE_RESETTING, &priv->state); 73 74 } ··· 89 88 clear_bit(HBG_NIC_STATE_RESETTING, &priv->state); 90 89 ret = hbg_rebuild(priv); 91 90 if (ret) { 91 + priv->stats.reset_fail_cnt++; 92 92 set_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state); 93 93 dev_err(&priv->pdev->dev, "failed to rebuild after reset\n"); 94 94 return ret;
+1
drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c
··· 84 84 HBG_REG_TX_EXCESSIVE_LENGTH_DROP_ADDR), 85 85 HBG_STATS_I(tx_dma_err_cnt), 86 86 HBG_STATS_I(tx_timeout_cnt), 87 + HBG_STATS_I(reset_fail_cnt), 87 88 }; 88 89 89 90 static const struct hbg_ethtool_stats hbg_ethtool_rmon_stats_info[] = {