int index;\r
volatile LONG refcnt;\r
struct rdma_cm_id **req_list;\r
+int active;\r
};\r
\r
struct cma_device\r
RtlCopyMemory(attr.Data, conn_param->private_data, attr.DataLength);\r
}\r
\r
+id_priv->active = 1;\r
id_priv->state = cma_active_connect;\r
id_priv->refcnt++;\r
id->comp_entry.Busy = 1;\r
HRESULT hr;\r
\r
id_priv = CONTAINING_RECORD(id, struct cma_id_private, id);\r
+ EnterCriticalSection(&lock);\r
if (id_priv->state == cma_connected) {\r
id_priv->state = cma_active_disconnect;\r
- } else {\r
+ } else if (id_priv->state == cma_passive_disconnect) {\r
id_priv->state = cma_disconnected;\r
}\r
+ LeaveCriticalSection(&lock);\r
hr = id->ep.connect->Disconnect(NULL);\r
if (FAILED(hr)) {\r
return hr;\r
HRESULT hr;\r
\r
if (FAILED(event->event.status)) {\r
+id = &event->id_priv->id;\r
+printf("ucma_process_conn_resp %p - failed 0x%x\n", id, event->event.status);\r
goto err;\r
}\r
\r
hr = id->ep.connect->Accept(id->qp->conn_handle, &attr,\r
&id->comp_entry.Overlap);\r
if (FAILED(hr) && hr != WV_IO_PENDING) {\r
+printf("ucma_process_conn_resp - accept failed 0x%x\n", hr);\r
id->comp_entry.Busy = 0;\r
event->event.status = hr;\r
goto err;\r
event->event.status = ucma_query_connect(&id_priv->id,\r
&event->event.param.conn);\r
}\r
+else\r
+ printf("ucma_process_establish %p error 0x%x (active %d)\n", id_priv, event->event.status, id_priv->active);\r
\r
if (SUCCEEDED(event->event.status)) {\r
event->event.event = RDMA_CM_EVENT_ESTABLISHED;\r
id_priv->id.comp_entry.Busy = 1;\r
id_priv->id.ep.connect->NotifyDisconnect(&id_priv->id.comp_entry.Overlap);\r
} else {\r
+printf("ucma_process_establish failure 0x%x\n", event->event.status);\r
event->event.event = RDMA_CM_EVENT_CONNECT_ERROR;\r
event->id_priv->state = cma_disconnected;\r
}\r