winverbs/ep: allow failed connections to be retried
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 2 Apr 2010 23:31:13 +0000 (23:31 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 2 Apr 2010 23:31:13 +0000 (23:31 +0000)
Allow a user to retry a connection request if it fails.  Report a
'success' timeout value, rather than an error timeout, reset the
EP state, and allow the request to be retried from user space.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2761 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/winverbs/kernel/wv_ep.c

index cb897d3..f7394dc 100644 (file)
@@ -504,8 +504,8 @@ static NTSTATUS WvEpIbCmHandler(iba_cm_id *pId, iba_cm_event *pEvent)
        case iba_cm_req_error:\r
                WdfObjectAcquireLock(ep->Queue);\r
                if (ep->State == WvEpActiveConnect) {\r
-                       ep->State = WvEpDisconnected;\r
-                       WvCompleteRequests(ep->Queue, STATUS_IO_TIMEOUT);\r
+                       ep->State = WvEpRouteResolved;\r
+                       WvCompleteRequests(ep->Queue, STATUS_TIMEOUT);\r
                }\r
                WdfObjectReleaseLock(ep->Queue);\r
                break;\r
@@ -518,7 +518,7 @@ static NTSTATUS WvEpIbCmHandler(iba_cm_id *pId, iba_cm_event *pEvent)
                WdfObjectReleaseLock(ep->Queue);\r
                break;\r
        case iba_cm_dreq_error:\r
-               WvEpCompleteDisconnect(ep, STATUS_IO_TIMEOUT);\r
+               WvEpCompleteDisconnect(ep, STATUS_TIMEOUT);\r
                break;\r
        case iba_cm_rep_received:\r
                WdfObjectAcquireLock(ep->Queue);\r
@@ -1046,6 +1046,7 @@ void WvEpDisconnect(WV_PROVIDER *pProvider, WDFREQUEST Request)
                        }\r
                }\r
                /* Fall through to passive disconnect case on failure */\r
+       case WvEpActiveDisconnect:\r
        case WvEpPassiveDisconnect:\r
                ep->State = WvEpDisconnected;\r
                WdfObjectReleaseLock(ep->Queue);\r