Skip to content

Commit bd36067

Browse files
Eli CohenRoland Dreier
authored andcommitted
IPoIB: Use dev_set_mtu() to change mtu
When the driver sets the MTU of the net device outside of its change_mtu method, it should make use of dev_set_mtu() instead of directly setting the mtu field of struct netdevice. Otherwise functions registered to be called upon MTU change will not get called (this is done through call_netdevice_notifiers() in dev_set_mtu()). Signed-off-by: Eli Cohen <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent c8c2afe commit bd36067

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/infiniband/ulp/ipoib/ipoib_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
14581458
if (priv->hca_caps & IB_DEVICE_UD_TSO)
14591459
dev->features |= NETIF_F_TSO;
14601460
}
1461-
dev->mtu = min(priv->mcast_mtu, dev->mtu);
1461+
dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu));
14621462
rtnl_unlock();
14631463
ipoib_flush_paths(dev);
14641464

drivers/infiniband/ulp/ipoib/ipoib_multicast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
577577

578578
if (!ipoib_cm_admin_enabled(dev)) {
579579
rtnl_lock();
580-
dev->mtu = min(priv->mcast_mtu, priv->admin_mtu);
580+
dev_set_mtu(dev, min(priv->mcast_mtu, priv->admin_mtu));
581581
rtnl_unlock();
582582
}
583583

0 commit comments

Comments
 (0)