[openib-general] work around another Ammasso CM process hang

Pete Wyckoff pw at osc.edu
Fri Aug 4 13:20:27 PDT 2006


This patch adds code in the TERMINATE_MESSAGE_RECEIVED handler
to send a close to the CM as well as to the verbs async handler.
Otherwise, the process will hang at QP destroy time due to an
extra refcount.  Perhaps there is a better fix.  iwarp branch.

Signed-off-by: Pete Wyckoff <pw at osc.edu>

Index: linux-kernel/infiniband/hw/amso1100/c2_ae.c
===================================================================
--- linux-kernel/infiniband/hw/amso1100/c2_ae.c	(revision 8688)
+++ linux-kernel/infiniband/hw/amso1100/c2_ae.c	(working copy)
@@ -259,6 +259,21 @@
 				qp->ibqp.event_handler(&ib_event,
 						       qp->ibqp.
 						       qp_context);
+			/*
+			 * The message above goes to the async handler.
+			 * Also tell the CM else we end up with a dangling
+			 * refcount to the qp and cannot ever free it.
+			 */
+			spin_lock_irqsave(&qp->lock, flags);
+			if (cm_id) {
+				cm_id->rem_ref(cm_id);
+				qp->cm_id = NULL;
+			}
+			spin_unlock_irqrestore(&qp->lock, flags);
+			cm_event.event = IW_CM_EVENT_CLOSE;
+			cm_event.status = 0;
+			if (cm_id && cm_id->event_handler)
+				cm_id->event_handler(cm_id, &cm_event);
 			break;
 		case CCAE_BAD_CLOSE:
 		case CCAE_LLP_CLOSE_COMPLETE:




More information about the general mailing list