[ofa-general] [PATCH] IB/ipoib: set max CM MTU when moving to CM mode

Eli Cohen eli at mellanox.co.il
Thu May 22 01:51:04 PDT 2008


>From c878b9d3a4cfd031e8baaba46a224b46b1ced441 Mon Sep 17 00:00:00 2001
From: Eli Cohen <eli at mellanox.co.il>
Date: Thu, 22 May 2008 11:45:04 +0300
Subject: [PATCH] IB/ipoib: set max CM MTU when moving to CM mode

This will relieve the user from the need to restore CM mode MTU
every time we switch from UD to CM mode.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---
I would like to push this patch to ofed 1.3.1 too.

 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 97e67d3..e6f57dd 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1387,6 +1387,11 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
 		dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO);
 		priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM;
 
+		if (ipoib_cm_max_mtu(dev) > priv->mcast_mtu)
+			ipoib_warn(priv, "mtu > %d will cause multicast packet drops.\n",
+				   priv->mcast_mtu);
+		dev->mtu = ipoib_cm_max_mtu(dev);
+
 		ipoib_flush_paths(dev);
 		return count;
 	}
-- 
1.5.5.1






More information about the general mailing list