[ofa-general] [PATCH] IB/IPoIB: Fix change mtu when switching to UD mode

Eli Cohen eli at dev.mellanox.co.il
Mon Jun 30 09:06:51 PDT 2008


>From 83e0e38b113980112c4ed34d0de367afd2b2b198 Mon Sep 17 00:00:00 2001
From: Eli Cohen <eli at mellanox.co.il>
Date: Mon, 30 Jun 2008 18:59:54 +0300
Subject: [PATCH] IB/IPoIB: Fix change mtu when switching to UD mode

When changing from CM mode to UD mode, use the kernel function
dev_set_mtu() instead of directly setting dev->mtu. This is necessary
so any other subsystem that need to know about this will (this is done
through the call to call_netdevice_notifiers().

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 6223fc3..82f3f2f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1410,7 +1410,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
 
 	if (!strcmp(buf, "datagram\n")) {
 		clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags);
-		dev->mtu = min(priv->mcast_mtu, dev->mtu);
+		dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu))
 		ipoib_flush_paths(dev);
 
 		if (test_bit(IPOIB_FLAG_CSUM, &priv->flags)) {
-- 
1.5.6




More information about the general mailing list