aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJijie Shao <shaojijie@huawei.com>2025-04-10 10:13:24 +0800
committerJakub Kicinski <kuba@kernel.org>2025-04-11 20:17:36 -0700
commit4e4ac53335de54bcb9d26842df0998cfd8fcaf90 (patch)
treea2fab5d28e6ff03956823aef74f59c4bc3658b55
parentnet: hibmcge: fix the share of irq statistics among different network ports issue (diff)
downloadlinux-rng-4e4ac53335de54bcb9d26842df0998cfd8fcaf90.tar.xz
linux-rng-4e4ac53335de54bcb9d26842df0998cfd8fcaf90.zip
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: ff4edac6e9bd ("net: hibmcge: Implement some .ndo functions") Signed-off-by: Jijie Shao <shaojijie@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250410021327.590362-5-shaojijie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
index e5c961ad4b9b..2e64dc1ab355 100644
--- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
+++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
@@ -203,12 +203,12 @@ static int hbg_net_change_mtu(struct net_device *netdev, int new_mtu)
if (netif_running(netdev))
return -EBUSY;
- hbg_hw_set_mtu(priv, new_mtu);
- WRITE_ONCE(netdev->mtu, new_mtu);
-
dev_dbg(&priv->pdev->dev,
"change mtu from %u to %u\n", netdev->mtu, new_mtu);
+ hbg_hw_set_mtu(priv, new_mtu);
+ WRITE_ONCE(netdev->mtu, new_mtu);
+
return 0;
}