[openib-general] Re: recursion depth exceeded in ipoib_workqueue

Roland Dreier rolandd at cisco.com
Mon Sep 19 10:09:17 PDT 2005


    Michael> Dont we need to cancel outstanding mcast queries?

Yes, I missed that.  How about this?

Index: linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c	(revision 3480)
+++ linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c	(working copy)
@@ -598,20 +598,11 @@ int ipoib_mcast_start_thread(struct net_
 	return 0;
 }
 
-int ipoib_mcast_stop_thread(struct net_device *dev)
+static void ipoib_mcast_cancel_queries(struct net_device *dev)
 {
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 	struct ipoib_mcast *mcast;
 
-	ipoib_dbg_mcast(priv, "stopping multicast thread\n");
-
-	down(&mcast_mutex);
-	clear_bit(IPOIB_MCAST_RUN, &priv->flags);
-	cancel_delayed_work(&priv->mcast_task);
-	up(&mcast_mutex);
-
-	flush_workqueue(ipoib_workqueue);
-
 	if (priv->broadcast && priv->broadcast->query) {
 		ib_sa_cancel_query(priv->broadcast->query_id, priv->broadcast->query);
 		priv->broadcast->query = NULL;
@@ -628,6 +619,22 @@ int ipoib_mcast_stop_thread(struct net_d
 			wait_for_completion(&mcast->done);
 		}
 	}
+}
+
+int ipoib_mcast_stop_thread(struct net_device *dev)
+{
+	struct ipoib_dev_priv *priv = netdev_priv(dev);
+
+	ipoib_dbg_mcast(priv, "stopping multicast thread\n");
+
+	down(&mcast_mutex);
+	clear_bit(IPOIB_MCAST_RUN, &priv->flags);
+	cancel_delayed_work(&priv->mcast_task);
+	up(&mcast_mutex);
+
+	flush_workqueue(ipoib_workqueue);
+
+	ipoib_mcast_cancel_queries(dev);
 
 	return 0;
 }
@@ -832,7 +839,7 @@ void ipoib_mcast_restart_task(void *dev_
 
 	ipoib_dbg_mcast(priv, "restarting multicast task\n");
 
-	ipoib_mcast_stop_thread(dev);
+	ipoib_mcast_cancel_queries(dev);
 
 	spin_lock_irqsave(&priv->lock, flags);
 



More information about the general mailing list