Skip to content

Commit 0099705

Browse files
Jijie Shaokuba-moo
authored andcommitted
net: hibmcge: fix incorrect statistics update issue
When the user dumps statistics, the hibmcge driver automatically updates all statistics. If the driver is performing the reset operation, the error data of 0xFFFFFFFF is updated. Therefore, if the driver is resetting, the hbg_update_stats_by_info() needs to return directly. Fixes: c0bf9bf ("net: hibmcge: Add support for dump statistics") Signed-off-by: Jijie Shao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b95ed55 commit 0099705

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ static void hbg_update_stats_by_info(struct hbg_priv *priv,
317317
const struct hbg_ethtool_stats *stats;
318318
u32 i;
319319

320+
if (test_bit(HBG_NIC_STATE_RESETTING, &priv->state))
321+
return;
322+
320323
for (i = 0; i < info_len; i++) {
321324
stats = &info[i];
322325
if (!stats->reg)

0 commit comments

Comments
 (0)