This will relieve the user from the need to restore CM mode MTU
every time he switchs from UD to CM mode. With the current code,
if the user fails to reset the MTU to a decent higher value, he
will get poor performance.

Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>
---
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c 
b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 99a4daf..eba92e7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1384,8 +1384,12 @@ static ssize_t set_mode(struct device *d, struct 
device_attribute *attr,
                ipoib_warn(priv, "enabling connected mode "
                           "will cause multicast packet drops\n");
 
+               if (ipoib_cm_max_mtu(dev) > priv->mcast_mtu)
+                       ipoib_warn(priv, "mtu > %d will cause multicast packet 
drops.\n",
+                                  priv->mcast_mtu);
                rtnl_lock();
                dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO);
+               dev_set_mtu(dev, ipoib_cm_max_mtu(dev));
                rtnl_unlock();
                priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM;
 
-- 
1.5.6

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to