提交 bd360671 编写于 作者: E Eli Cohen 提交者: Roland Dreier

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: NEli Cohen <eli@mellanox.co.il>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 c8c2afe3
...@@ -1458,7 +1458,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr, ...@@ -1458,7 +1458,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
if (priv->hca_caps & IB_DEVICE_UD_TSO) if (priv->hca_caps & IB_DEVICE_UD_TSO)
dev->features |= NETIF_F_TSO; dev->features |= NETIF_F_TSO;
} }
dev->mtu = min(priv->mcast_mtu, dev->mtu); dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu));
rtnl_unlock(); rtnl_unlock();
ipoib_flush_paths(dev); ipoib_flush_paths(dev);
......
...@@ -577,7 +577,7 @@ void ipoib_mcast_join_task(struct work_struct *work) ...@@ -577,7 +577,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
if (!ipoib_cm_admin_enabled(dev)) { if (!ipoib_cm_admin_enabled(dev)) {
rtnl_lock(); rtnl_lock();
dev->mtu = min(priv->mcast_mtu, priv->admin_mtu); dev_set_mtu(dev, min(priv->mcast_mtu, priv->admin_mtu));
rtnl_unlock(); rtnl_unlock();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册