aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.co.il>2008-07-14 23:48:51 -0700
committerRoland Dreier <rolandd@cisco.com>2008-07-14 23:48:51 -0700
commitbd3606715effbf37df986548c43bbed0842b49d5 (patch)
tree08f2a13d486a75b42244beca90ae78c0045c0fc1 /drivers/infiniband
parentIPoIB: Use rtnl lock/unlock when changing device flags (diff)
downloadlinux-dev-bd3606715effbf37df986548c43bbed0842b49d5.tar.xz
linux-dev-bd3606715effbf37df986548c43bbed0842b49d5.zip
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 <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index b4269139135b..87f9f3ef3b2d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1458,7 +1458,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
if (priv->hca_caps & IB_DEVICE_UD_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();
ipoib_flush_paths(dev);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index be1ed38cdcfd..1fcc9a898d81 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -577,7 +577,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
if (!ipoib_cm_admin_enabled(dev)) {
rtnl_lock();
- dev->mtu = min(priv->mcast_mtu, priv->admin_mtu);
+ dev_set_mtu(dev, min(priv->mcast_mtu, priv->admin_mtu));
rtnl_unlock();
}