[openib-general] [PATCH] IB/ipoib_cm: reduce MTU on connected->datagram mode change

Michael S. Tsirkin mst at mellanox.co.il
Wed Jan 17 08:00:47 PST 2007


UD mode requires MTU <= broadcast group MTU, make sure MTU is valid
when switching back from connected mode.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

---

Incremental patch on top of the IPoIB CM.
Pls apply in for-mm.

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index bb6a9b1..43500fd 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1127,6 +1127,7 @@ static ssize_t set_mode(struct class_device *cdev,
 
 	if (!strcmp(buf, "datagram\n")) {
 		clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags);
+		dev->mtu = min(priv->mcast_mtu, dev->mtu);
 		ipoib_flush_paths(dev);
 		return count;
 	}
-- 
MST




More information about the general mailing list