Skip to content

Commit 4e4ac53

Browse files
Jijie Shaokuba-moo
authored andcommitted
net: hibmcge: fix wrong mtu log issue
A dbg log is generated when the driver modifies the MTU, which is expected to trace the change of the MTU. However, the log is recorded after WRITE_ONCE(). At this time, netdev->mtu has been changed to the new value. As a result, netdev->mtu is the same as new_mtu. This patch modifies the log location and records logs before WRITE_ONCE(). Fixes: ff4edac ("net: hibmcge: Implement some .ndo functions") 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 4ad3df7 commit 4e4ac53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ static int hbg_net_change_mtu(struct net_device *netdev, int new_mtu)
203203
if (netif_running(netdev))
204204
return -EBUSY;
205205

206-
hbg_hw_set_mtu(priv, new_mtu);
207-
WRITE_ONCE(netdev->mtu, new_mtu);
208-
209206
dev_dbg(&priv->pdev->dev,
210207
"change mtu from %u to %u\n", netdev->mtu, new_mtu);
211208

209+
hbg_hw_set_mtu(priv, new_mtu);
210+
WRITE_ONCE(netdev->mtu, new_mtu);
211+
212212
return 0;
213213
}
214214

0 commit comments

Comments
 (0)