/* triggers start of the disconnect procedures and wait for them to be done  */
void iser_conn_terminate(struct iser_conn *ib_conn)
/* triggers start of the disconnect procedures and wait for them to be done  */
void iser_conn_terminate(struct iser_conn *ib_conn)
{
	int err = 0;
	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_put(ib_conn);
}