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

Roland Dreier rolandd at cisco.com
Mon Sep 19 13:44:09 PDT 2005


Yep, I was wrong again.

OK, how about this: don't do the flush when we're calling from the
same workqueue context.

Index: linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c	(revision 3483)
+++ linux-kernel/infiniband/ulp/ipoib/ipoib_multicast.c	(working copy)
@@ -598,7 +598,7 @@ int ipoib_mcast_start_thread(struct net_
 	return 0;
 }
 
-int ipoib_mcast_stop_thread(struct net_device *dev)
+int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
 {
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 	struct ipoib_mcast *mcast;
@@ -610,7 +610,8 @@ int ipoib_mcast_stop_thread(struct net_d
 	cancel_delayed_work(&priv->mcast_task);
 	up(&mcast_mutex);
 
-	flush_workqueue(ipoib_workqueue);
+	if (flush)
+		flush_workqueue(ipoib_workqueue);
 
 	if (priv->broadcast && priv->broadcast->query) {
 		ib_sa_cancel_query(priv->broadcast->query_id, priv->broadcast->query);
@@ -832,7 +833,7 @@ void ipoib_mcast_restart_task(void *dev_
 
 	ipoib_dbg_mcast(priv, "restarting multicast task\n");
 
-	ipoib_mcast_stop_thread(dev);
+	ipoib_mcast_stop_thread(dev, 0);
 
 	spin_lock_irqsave(&priv->lock, flags);
 
Index: linux-kernel/infiniband/ulp/ipoib/ipoib.h
===================================================================
--- linux-kernel/infiniband/ulp/ipoib/ipoib.h	(revision 3483)
+++ linux-kernel/infiniband/ulp/ipoib/ipoib.h	(working copy)
@@ -257,7 +257,7 @@ void ipoib_mcast_send(struct net_device 
 
 void ipoib_mcast_restart_task(void *dev_ptr);
 int ipoib_mcast_start_thread(struct net_device *dev);
-int ipoib_mcast_stop_thread(struct net_device *dev);
+int ipoib_mcast_stop_thread(struct net_device *dev, int flush);
 
 void ipoib_mcast_dev_down(struct net_device *dev);
 void ipoib_mcast_dev_flush(struct net_device *dev);
Index: linux-kernel/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- linux-kernel/infiniband/ulp/ipoib/ipoib_ib.c	(revision 3483)
+++ linux-kernel/infiniband/ulp/ipoib/ipoib_ib.c	(working copy)
@@ -432,7 +432,7 @@ int ipoib_ib_dev_down(struct net_device 
 		flush_workqueue(ipoib_workqueue);
 	}
 
-	ipoib_mcast_stop_thread(dev);
+	ipoib_mcast_stop_thread(dev, 1);
 
 	/*
 	 * Flush the multicast groups first so we stop any multicast joins. The
@@ -599,7 +599,7 @@ void ipoib_ib_dev_cleanup(struct net_dev
 
 	ipoib_dbg(priv, "cleaning up ib_dev\n");
 
-	ipoib_mcast_stop_thread(dev);
+	ipoib_mcast_stop_thread(dev, 1);
 
 	/* Delete the broadcast address and the local address */
 	ipoib_mcast_dev_down(dev);



More information about the general mailing list