[openib-general] question on rdma_disconnect
Or Gerlitz
ogerlitz at voltaire.com
Mon May 8 08:06:34 PDT 2006
Resending, this time with a subject line.
Or.
---------- Forwarded message ----------
Date: Mon, 8 May 2006 18:01:51 +0300 (IDT)
From: Or Gerlitz <ogerlitz at voltaire.com>
To: mshefty at ichips.intel.com
Cc: openib-general at openib.org
Hi Sean,
Looking in the code i have realized that it is a must for the CMA
consumer to call rdma_disconnect to have the QP state moved into ERROR.
Am i correct? with this understanding at hand, i have changed iSER code to
call rdma_disconnect even if it got a DISCONNECTED event caused by the
passive side initiating the disconnect flow (ie sending a DREQ), since
otherwise in such case i never got the FLUSHES on the posted RX/TX WRs.
This makes sense to me, just wanted to have your confirmation.
Or.
Index: iser_verbs.c
===================================================================
--- iser_verbs.c (revision 6965)
+++ iser_verbs.c (working copy)
@@ -318,18 +318,20 @@ void iser_conn_terminate(struct iser_con
{
int err = 0;
- if (iser_conn_state_comp_exch(ib_conn, ISER_CONN_UP,
- ISER_CONN_TERMINATING)) {
- err = rdma_disconnect(ib_conn->cma_id);
- if (err)
- iser_err("Failed to disconnect, conn: 0x%p err %d\n",
- ib_conn,err);
-
- }
-
+ /* change the ib conn state only if the conn is UP, however always call
+ * rdma_disconnect since this is the only way to cause the CMA to change
+ * the QP state to ERROR
+ */
+
+ iser_conn_state_comp_exch(ib_conn, ISER_CONN_UP, ISER_CONN_TERMINATING);
+ err = rdma_disconnect(ib_conn->cma_id);
+ if (err)
+ iser_err("Failed to disconnect, conn: 0x%p err %d\n",
+ ib_conn,err);
+
wait_event_interruptible(ib_conn->wait,
ib_conn->state == ISER_CONN_DOWN);
-
+
iser_conn_release(ib_conn);
}
More information about the general
mailing list