[ofa-general] [PATCH] ipoib: do not join broadcast group if interface is brought down

Yossi Etigin yosefe at Voltaire.COM
Wed Nov 19 11:53:27 PST 2008


Because ipoib_workqueue is not flushed when ipoib interface is brought down,
ipoib_mcast_join() may trigger a join to the broadcast group after priv->broadcast
was set to NULL (during cleanup). This will cause ipoib to be joined to the
broadcast group when interface is down.
As a side effect, this breaks the optimization of setting qkey only when joining
the broadcast group.

Signed-off-by: Yossi Etigin <yosefe at voltaire.com>

--

Fix bugzilla 1370.

Index: b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2008-11-19 21:33:54.000000000 +0200
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2008-11-19 21:40:12.000000000 +0200
@@ -565,7 +565,8 @@ void ipoib_mcast_join_task(struct work_s
 			ipoib_warn(priv, "ib_query_port failed\n");
 	}
 
-	if (!priv->broadcast) {
+	rtnl_lock();
+	if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags) && !priv->broadcast) {
 		struct ipoib_mcast *broadcast;
 
 		broadcast = ipoib_mcast_alloc(dev, 1);
@@ -576,6 +577,7 @@ void ipoib_mcast_join_task(struct work_s
 				queue_delayed_work(ipoib_workqueue,
 						   &priv->mcast_join_task, HZ);
 			mutex_unlock(&mcast_mutex);
+			rtnl_unlock();
 			return;
 		}
 
@@ -587,6 +589,7 @@ void ipoib_mcast_join_task(struct work_s
 		__ipoib_mcast_add(dev, priv->broadcast);
 		spin_unlock_irq(&priv->lock);
 	}
+	rtnl_unlock();
 
 	if (!test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) {
 		if (!test_bit(IPOIB_MCAST_FLAG_BUSY, &priv->broadcast->flags))
-- 
--Yossi



More information about the general mailing list