Commit ed7b521d authored by Erez Shitrit's avatar Erez Shitrit Committed by Doug Ledford

IB/IPoIB: Forward MTU change to driver below

This patch checks if there is a driver below that
needs to be updated on the new MTU and calls it
accordingly.
Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
Reviewed by: Alex Vesker <valex@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 98e77d9f
...@@ -233,6 +233,7 @@ static netdev_features_t ipoib_fix_features(struct net_device *dev, netdev_featu ...@@ -233,6 +233,7 @@ static netdev_features_t ipoib_fix_features(struct net_device *dev, netdev_featu
static int ipoib_change_mtu(struct net_device *dev, int new_mtu) static int ipoib_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct ipoib_dev_priv *priv = ipoib_priv(dev); struct ipoib_dev_priv *priv = ipoib_priv(dev);
int ret = 0;
/* dev->mtu > 2K ==> connected mode */ /* dev->mtu > 2K ==> connected mode */
if (ipoib_cm_admin_enabled(dev)) { if (ipoib_cm_admin_enabled(dev)) {
...@@ -256,9 +257,23 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu) ...@@ -256,9 +257,23 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu)
ipoib_dbg(priv, "MTU must be smaller than the underlying " ipoib_dbg(priv, "MTU must be smaller than the underlying "
"link layer MTU - 4 (%u)\n", priv->mcast_mtu); "link layer MTU - 4 (%u)\n", priv->mcast_mtu);
dev->mtu = min(priv->mcast_mtu, priv->admin_mtu); new_mtu = min(priv->mcast_mtu, priv->admin_mtu);
return 0; if (priv->rn_ops->ndo_change_mtu) {
bool carrier_status = netif_carrier_ok(dev);
netif_carrier_off(dev);
/* notify lower level on the real mtu */
ret = priv->rn_ops->ndo_change_mtu(dev, new_mtu);
if (carrier_status)
netif_carrier_on(dev);
} else {
dev->mtu = new_mtu;
}
return ret;
} }
/* Called with an RCU read lock taken */ /* Called with an RCU read lock taken */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment