Skip to content

Commit aec5f11

Browse files
author
CKI Backport Bot
committed
enic: fix incorrect MTU comparison in enic_change_mtu()
JIRA: https://issues.redhat.com/browse/RHEL-108264 commit aaf2b24 Author: Alok Tiwari <alok.a.tiwari@oracle.com> Date: Sat Jun 28 07:56:05 2025 -0700 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> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 9fd94b3 commit aec5f11

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
@@ -1863,10 +1863,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
18631863
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
18641864
return -EOPNOTSUPP;
18651865

1866-
if (netdev->mtu > enic->port_mtu)
1866+
if (new_mtu > enic->port_mtu)
18671867
netdev_warn(netdev,
18681868
"interface MTU (%d) set higher than port MTU (%d)\n",
1869-
netdev->mtu, enic->port_mtu);
1869+
new_mtu, enic->port_mtu);
18701870

18711871
return _enic_change_mtu(netdev, new_mtu);
18721872
}

0 commit comments

Comments
 (0)