Skip to content

Commit aaf2b24

Browse files
aloktiwakuba-moo
authored andcommitted
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: ab123fe ("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>
1 parent 42fd432 commit aaf2b24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,10 +1864,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
18641864
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
18651865
return -EOPNOTSUPP;
18661866

1867-
if (netdev->mtu > enic->port_mtu)
1867+
if (new_mtu > enic->port_mtu)
18681868
netdev_warn(netdev,
18691869
"interface MTU (%d) set higher than port MTU (%d)\n",
1870-
netdev->mtu, enic->port_mtu);
1870+
new_mtu, enic->port_mtu);
18711871

18721872
return _enic_change_mtu(netdev, new_mtu);
18731873
}

0 commit comments

Comments
 (0)