[ewg] pkey change handling patch (was Re: bugs to fix for OFED 1.2 RC1)

Michael S. Tsirkin mst at dev.mellanox.co.il
Tue Mar 27 13:52:13 PDT 2007


> Changed from v3
> 	* added a flush_scheduled_work call before we restart the QP in order
> 	  to ensure that the pkey table we read from the cache is updated


+void ipoib_ib_dev_restart_qp(struct work_struct *work)
+{
+	struct ipoib_dev_priv *priv =
+		container_of(work, struct ipoib_dev_priv, restart_qp_task);
+	/* We only restart the QP in case of pkey change event */
+	ipoib_dbg(priv, "Flushing %s and restarting it's QP\n", priv->dev->name);
+	/* Ensures the pkey table we read  from the cache is updated properly */
+	flush_scheduled_work();
+ 	__ipoib_ib_dev_flush(priv, 1);
+}
+

I think doing flush_scheduled_work from inside the ipoib workqueue
can trigger deadlocks - which deadlocks the workqueue was
created to avoid, in the first place. Look at the comment
in ipoib_main.c where the WQ is created.

And, I don't think that depending on the fact that the cache
uses a default schedule queue internally is such a good idea.

How about simply requeueing the work again if the cache query failed?

-- 
MST



More information about the ewg mailing list