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

enic: fix incorrect MTU comparison in enic_change_mtu()

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>
Acked-by: John Daley <johndale@cisco.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250628145612.476096-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alok Tiwari and committed by
Jakub Kicinski
aaf2b248 42fd432f

+2 -2
+2 -2
drivers/net/ethernet/cisco/enic/enic_main.c
··· 1864 1864 if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic)) 1865 1865 return -EOPNOTSUPP; 1866 1866 1867 - if (netdev->mtu > enic->port_mtu) 1867 + if (new_mtu > enic->port_mtu) 1868 1868 netdev_warn(netdev, 1869 1869 "interface MTU (%d) set higher than port MTU (%d)\n", 1870 - netdev->mtu, enic->port_mtu); 1870 + new_mtu, enic->port_mtu); 1871 1871 1872 1872 return _enic_change_mtu(netdev, new_mtu); 1873 1873 }