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 <[EMAIL PROTECTED]>

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:

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to