[ewg] [PATCH] Subject: [PATCH] IB/ipoib: set max CM MTU when moving to CM mode

Eli Cohen eli at mellanox.co.il
Thu Jul 3 01:53:29 PDT 2008


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 <eli at mellanox.co.il>
---
---
 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




More information about the ewg mailing list