[ofw] [PATCH] winverbs/ep: handle receiving REQ then DREQ

Sean Hefty sean.hefty at intel.com
Tue Jan 19 16:26:00 PST 2010


For fast connections, it's possible to receive a DREQ immediately
after receiving a REQ, without an RTU coming in between.  If we've
sent a REP to the REQ, then the DREQ should be treated as if the
connection had been fully established.  (The RTU could be delayed,
and the communication established event is processed asynchronously,
so there's no way to tell for certain.)

This fixes an issue where the passive side Accept() call fails
waiting for the RTU, but receives a DREQ instead.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
 trunk/core/winverbs/kernel/wv_ep.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/trunk/core/winverbs/kernel/wv_ep.c b/trunk/core/winverbs/kernel/wv_ep.c
index 3ad91ac..cb897d3 100644
--- a/trunk/core/winverbs/kernel/wv_ep.c
+++ b/trunk/core/winverbs/kernel/wv_ep.c
@@ -542,6 +542,10 @@ static NTSTATUS WvEpIbCmHandler(iba_cm_id *pId, iba_cm_event *pEvent)
 			ep->State = WvEpPassiveDisconnect;
 			WvCompleteRequests(ep->Queue, STATUS_SUCCESS);
 			WdfObjectReleaseLock(ep->Queue);
+		} else if (ep->State == WvEpPassiveConnect) {
+			ep->State = WvEpPassiveDisconnect;
+			WvCompleteRequestsWithInformation(ep->Queue, STATUS_SUCCESS);
+			WdfObjectReleaseLock(ep->Queue);
 		} else {
 			WdfObjectReleaseLock(ep->Queue);
 			WvEpCompleteDisconnect(ep, STATUS_SUCCESS);





More information about the ofw mailing list