* [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu()
@ 2025-06-28 14:56 Alok Tiwari
2025-06-30 10:58 ` Simon Horman
2025-07-02 2:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2025-06-28 14:56 UTC (permalink / raw)
To: johndale, neescoba, benve, satishkh, andrew+netdev, davem,
edumazet, kuba, pabeni, horms, netdev
Cc: alok.a.tiwari
The comparison in enic_change_mtu() incorrectly used the current
netdev->mtu instead of the new new_mtu value when warning about
an MTU exceeding the port MTU. This could suppress valid warnings
or issue incorrect ones.
Fix the condition and log to properly reflect the new_mtu.
Fixes: ab123fe071c9 ("enic: handle mtu change for vf properly")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 773f5ad972a24..6bc8dfdb3d4be 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1864,10 +1864,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
return -EOPNOTSUPP;
- if (netdev->mtu > enic->port_mtu)
+ if (new_mtu > enic->port_mtu)
netdev_warn(netdev,
"interface MTU (%d) set higher than port MTU (%d)\n",
- netdev->mtu, enic->port_mtu);
+ new_mtu, enic->port_mtu);
return _enic_change_mtu(netdev, new_mtu);
}
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu()
2025-06-28 14:56 [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu() Alok Tiwari
@ 2025-06-30 10:58 ` Simon Horman
2025-07-02 2:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-06-30 10:58 UTC (permalink / raw)
To: Alok Tiwari
Cc: johndale, neescoba, benve, satishkh, andrew+netdev, davem,
edumazet, kuba, pabeni, netdev
On Sat, Jun 28, 2025 at 07:56:05AM -0700, Alok Tiwari wrote:
> The comparison in enic_change_mtu() incorrectly used the current
> netdev->mtu instead of the new new_mtu value when warning about
> an MTU exceeding the port MTU. This could suppress valid warnings
> or issue incorrect ones.
>
> Fix the condition and log to properly reflect the new_mtu.
>
> Fixes: ab123fe071c9 ("enic: handle mtu change for vf properly")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu()
2025-06-28 14:56 [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu() Alok Tiwari
2025-06-30 10:58 ` Simon Horman
@ 2025-07-02 2:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-02 2:40 UTC (permalink / raw)
To: ALOK TIWARI
Cc: johndale, neescoba, benve, satishkh, andrew+netdev, davem,
edumazet, kuba, pabeni, horms, netdev
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 28 Jun 2025 07:56:05 -0700 you wrote:
> The comparison in enic_change_mtu() incorrectly used the current
> netdev->mtu instead of the new new_mtu value when warning about
> an MTU exceeding the port MTU. This could suppress valid warnings
> or issue incorrect ones.
>
> Fix the condition and log to properly reflect the new_mtu.
>
> [...]
Here is the summary with links:
- [net] enic: fix incorrect MTU comparison in enic_change_mtu()
https://git.kernel.org/netdev/net/c/aaf2b2480375
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-02 2:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28 14:56 [PATCH net] enic: fix incorrect MTU comparison in enic_change_mtu() Alok Tiwari
2025-06-30 10:58 ` Simon Horman
2025-07-02 2:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).