Bottom: fa748f1c52b43305bedd9af43719f0863bbecab5
-Top: 387b7f5f1602203485c10762ab1e083ed5ad08f6
+Top: 320329bcea61ab9c1c6da4cb408e769a18685487
Author: U-AMR\MSHEFTY <MSHEFTY@mshefty-MOBL2.amr.corp.intel.com>
Date: 2010-01-06 10:08:50 -0800
p_ifc->send_rep = cm_send_rep;\r
p_ifc->send_rtu = cm_send_rtu;\r
diff --git a/trunk/core/winverbs/kernel/wv_ep.c b/trunk/core/winverbs/kernel/wv_ep.c
-index 3d5c6ce..874f3d1 100644
+index 3d5c6ce..3a9e02f 100644
--- a/trunk/core/winverbs/kernel/wv_ep.c
+++ b/trunk/core/winverbs/kernel/wv_ep.c
-@@ -1110,28 +1110,34 @@ complete:
+@@ -1110,60 +1110,124 @@ complete:
WdfRequestComplete(Request, status);\r
}\r
\r
\r
- listen = ((iba_cm_id *) pId->context)->context;\r
+ WdfObjectAcquireLock(pListen->Queue);\r
-+ status = WdfIoQueueRetrieveNextRequest(pListen->Queue, &request);\r
-+ if (!NT_SUCCESS(status)) {\r
-+ goto release;\r
-+ }\r
++ while (1) {\r
++ status = WdfIoQueueRetrieveNextRequest(pListen->Queue, &request);\r
++ if (!NT_SUCCESS(status)) {\r
++ break;\r
++ }\r
\r
- WdfObjectAcquireLock(listen->Queue);\r
- status = WdfIoQueueRetrieveNextRequest(listen->Queue, &request);\r
-+ status = IbCmInterface.CM.get_request(pListen->pIbCmId, &id, &event);\r
- if (!NT_SUCCESS(status)) {\r
-+ WdfRequestRequeue(request);\r
- goto release;\r
- }\r
+- if (!NT_SUCCESS(status)) {\r
+- goto release;\r
+- }\r
++ status = IbCmInterface.CM.get_request(pListen->pIbCmId, &id, &event);\r
++ if (!NT_SUCCESS(status)) {\r
++ WdfRequestRequeue(request);\r
++ break;\r
++ }\r
++\r
++ ASSERT(!IsListEmpty(&pListen->Entry));\r
++ ep = CONTAINING_RECORD(RemoveHeadList(&pListen->Entry), WV_ENDPOINT, Entry);\r
++ ep->pIbCmId = id;\r
++ id->callback = WvEpIbCmHandler;\r
++ id->context = ep;\r
++\r
++ hdr = event.data.req.req.p_pdata;\r
++ if ((hdr->IpVersion >> 4) == 4) {\r
++ ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
++ ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
++ ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
++ ep->Attributes.PeerAddress.SockAddr.In.SinAddr = hdr->SrcAddress.Ip4.Address;\r
++ } else {\r
++ ep->Attributes.LocalAddress.SockAddr.In6.Sin6Family = WV_AF_INET6; \r
++ RtlCopyMemory(ep->Attributes.LocalAddress.SockAddr.In6.Sin6Addr,\r
++ hdr->DstAddress.Ip6Address, 16);\r
++ ep->Attributes.PeerAddress.SockAddr.In6.Sin6Family = WV_AF_INET6;\r
++ RtlCopyMemory(ep->Attributes.PeerAddress.SockAddr.In6.Sin6Addr,\r
++ hdr->SrcAddress.Ip6Address, 16);\r
++ }\r
++ ep->Attributes.Device.DeviceGuid = event.data.req.local_ca_guid;\r
++ ep->Attributes.Device.Pkey = event.data.req.req.p_primary_path->pkey;\r
++ ep->Attributes.Device.PortNumber = event.data.req.port_num;\r
++ ep->Attributes.Param.Connect.ResponderResources = event.data.req.req.resp_res;\r
++ ep->Attributes.Param.Connect.InitiatorDepth = event.data.req.req.init_depth;\r
++ ep->Attributes.Param.Connect.RetryCount = event.data.req.req.retry_cnt;\r
++ ep->Attributes.Param.Connect.RnrRetryCount = event.data.req.req.rnr_retry_cnt;\r
++ ep->Attributes.Param.Connect.DataLength = sizeof(ep->Attributes.Param.Connect.Data);\r
++ RtlCopyMemory(ep->Attributes.Param.Connect.Data, hdr + 1,\r
++ sizeof(ep->Attributes.Param.Connect.Data));\r
++ ep->Route = *event.data.req.req.p_primary_path;\r
++\r
++ ep->State = WvEpPassiveConnect;\r
++ WvEpPut(ep);\r
\r
- ASSERT(!IsListEmpty(&listen->Entry));\r
- ep = CONTAINING_RECORD(RemoveHeadList(&listen->Entry), WV_ENDPOINT, Entry);\r
- ep->pIbCmId = pId;\r
- pId->callback = WvEpIbCmHandler;\r
- pId->context = ep;\r
-+ ASSERT(!IsListEmpty(&pListen->Entry));\r
-+ ep = CONTAINING_RECORD(RemoveHeadList(&pListen->Entry), WV_ENDPOINT, Entry);\r
-+ ep->pIbCmId = id;\r
-+ id->callback = WvEpIbCmHandler;\r
-+ id->context = ep;\r
++ WdfRequestComplete(request, STATUS_SUCCESS);\r
++ }\r
++ WdfObjectReleaseLock(pListen->Queue);\r
++}\r
\r
- hdr = pEvent->data.req.req.p_pdata;\r
-+ hdr = event.data.req.req.p_pdata;\r
- if ((hdr->IpVersion >> 4) == 4) {\r
- ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
- ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
-@@ -1145,25 +1151,82 @@ static NTSTATUS WvEpIbListenHandler(iba_cm_id *pId, iba_cm_event *pEvent)
- RtlCopyMemory(ep->Attributes.PeerAddress.SockAddr.In6.Sin6Addr,\r
- hdr->SrcAddress.Ip6Address, 16);\r
- }\r
+- if ((hdr->IpVersion >> 4) == 4) {\r
+- ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
+- ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
+- ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
+- ep->Attributes.PeerAddress.SockAddr.In.SinAddr = hdr->SrcAddress.Ip4.Address;\r
+- } else {\r
+- ep->Attributes.LocalAddress.SockAddr.In6.Sin6Family = WV_AF_INET6; \r
+- RtlCopyMemory(ep->Attributes.LocalAddress.SockAddr.In6.Sin6Addr,\r
+- hdr->DstAddress.Ip6Address, 16);\r
+- ep->Attributes.PeerAddress.SockAddr.In6.Sin6Family = WV_AF_INET6;\r
+- RtlCopyMemory(ep->Attributes.PeerAddress.SockAddr.In6.Sin6Addr,\r
+- hdr->SrcAddress.Ip6Address, 16);\r
+- }\r
- ep->Attributes.Device.DeviceGuid = pEvent->data.req.local_ca_guid;\r
- ep->Attributes.Device.Pkey = pEvent->data.req.req.p_primary_path->pkey;\r
- ep->Attributes.Device.PortNumber = pEvent->data.req.port_num;\r
- ep->Attributes.Param.Connect.InitiatorDepth = pEvent->data.req.req.init_depth;\r
- ep->Attributes.Param.Connect.RetryCount = pEvent->data.req.req.retry_cnt;\r
- ep->Attributes.Param.Connect.RnrRetryCount = pEvent->data.req.req.rnr_retry_cnt;\r
-+ ep->Attributes.Device.DeviceGuid = event.data.req.local_ca_guid;\r
-+ ep->Attributes.Device.Pkey = event.data.req.req.p_primary_path->pkey;\r
-+ ep->Attributes.Device.PortNumber = event.data.req.port_num;\r
-+ ep->Attributes.Param.Connect.ResponderResources = event.data.req.req.resp_res;\r
-+ ep->Attributes.Param.Connect.InitiatorDepth = event.data.req.req.init_depth;\r
-+ ep->Attributes.Param.Connect.RetryCount = event.data.req.req.retry_cnt;\r
-+ ep->Attributes.Param.Connect.RnrRetryCount = event.data.req.req.rnr_retry_cnt;\r
- ep->Attributes.Param.Connect.DataLength = sizeof(ep->Attributes.Param.Connect.Data);\r
- RtlCopyMemory(ep->Attributes.Param.Connect.Data, hdr + 1,\r
- sizeof(ep->Attributes.Param.Connect.Data));\r
+- ep->Attributes.Param.Connect.DataLength = sizeof(ep->Attributes.Param.Connect.Data);\r
+- RtlCopyMemory(ep->Attributes.Param.Connect.Data, hdr + 1,\r
+- sizeof(ep->Attributes.Param.Connect.Data));\r
- ep->Route = *pEvent->data.req.req.p_primary_path;\r
-+ ep->Route = *event.data.req.req.p_primary_path;\r
- \r
- ep->State = WvEpPassiveConnect;\r
- WvEpPut(ep);\r
- \r
- WdfRequestComplete(request, STATUS_SUCCESS);\r
- release:\r
+-\r
+- ep->State = WvEpPassiveConnect;\r
+- WvEpPut(ep);\r
+-\r
+- WdfRequestComplete(request, STATUS_SUCCESS);\r
+-release:\r
- WdfObjectReleaseLock(listen->Queue);\r
- return status;\r
-+ WdfObjectReleaseLock(pListen->Queue);\r
-+}\r
-+\r
+static NTSTATUS WvEpIbListenHandler(iba_cm_id *pId, iba_cm_event *pEvent)\r
+{\r
+ WV_ENDPOINT *listen;\r
}\r
\r
void WvEpListen(WV_PROVIDER *pProvider, WDFREQUEST Request)\r
-@@ -1235,24 +1298,24 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
+@@ -1235,24 +1299,24 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
status = WdfRequestRetrieveInputBuffer(Request, sizeof(WV_IO_EP_GET_REQUEST),\r
&req, NULL);\r
if (!NT_SUCCESS(status)) {\r
}\r
\r
WdfObjectAcquireLock(ep->Queue);\r
-@@ -1262,9 +1325,8 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
+@@ -1262,9 +1326,8 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
status = STATUS_CONNECTION_IN_USE;\r
}\r
WdfObjectReleaseLock(ep->Queue);\r
}\r
\r
WdfObjectAcquireLock(listen->Queue);\r
-@@ -1274,15 +1336,21 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
+@@ -1274,15 +1337,21 @@ void WvEpGetRequest(WV_PROVIDER *pProvider, WDFREQUEST Request)
WvEpGet(ep);\r
}\r
WdfObjectReleaseLock(listen->Queue);\r
+++ /dev/null
-Bottom: 387b7f5f1602203485c10762ab1e083ed5ad08f6
-Top: 320329bcea61ab9c1c6da4cb408e769a18685487
-Author: U-AMR\MSHEFTY <MSHEFTY@mshefty-MOBL2.amr.corp.intel.com>
-Date: 2010-01-06 16:46:46 -0800
-
-Refresh of cm_poll
-
----
-
-diff --git a/trunk/core/winverbs/kernel/wv_ep.c b/trunk/core/winverbs/kernel/wv_ep.c
-index 874f3d1..3a9e02f 100644
---- a/trunk/core/winverbs/kernel/wv_ep.c
-+++ b/trunk/core/winverbs/kernel/wv_ep.c
-@@ -1120,54 +1120,55 @@ static void WvEpGetIbRequest(WV_ENDPOINT *pListen)
- iba_cm_event event;\r
- \r
- WdfObjectAcquireLock(pListen->Queue);\r
-- status = WdfIoQueueRetrieveNextRequest(pListen->Queue, &request);\r
-- if (!NT_SUCCESS(status)) {\r
-- goto release;\r
-- }\r
-+ while (1) {\r
-+ status = WdfIoQueueRetrieveNextRequest(pListen->Queue, &request);\r
-+ if (!NT_SUCCESS(status)) {\r
-+ break;\r
-+ }\r
- \r
-- status = IbCmInterface.CM.get_request(pListen->pIbCmId, &id, &event);\r
-- if (!NT_SUCCESS(status)) {\r
-- WdfRequestRequeue(request);\r
-- goto release;\r
-- }\r
-+ status = IbCmInterface.CM.get_request(pListen->pIbCmId, &id, &event);\r
-+ if (!NT_SUCCESS(status)) {\r
-+ WdfRequestRequeue(request);\r
-+ break;\r
-+ }\r
- \r
-- ASSERT(!IsListEmpty(&pListen->Entry));\r
-- ep = CONTAINING_RECORD(RemoveHeadList(&pListen->Entry), WV_ENDPOINT, Entry);\r
-- ep->pIbCmId = id;\r
-- id->callback = WvEpIbCmHandler;\r
-- id->context = ep;\r
-+ ASSERT(!IsListEmpty(&pListen->Entry));\r
-+ ep = CONTAINING_RECORD(RemoveHeadList(&pListen->Entry), WV_ENDPOINT, Entry);\r
-+ ep->pIbCmId = id;\r
-+ id->callback = WvEpIbCmHandler;\r
-+ id->context = ep;\r
-+\r
-+ hdr = event.data.req.req.p_pdata;\r
-+ if ((hdr->IpVersion >> 4) == 4) {\r
-+ ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
-+ ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
-+ ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
-+ ep->Attributes.PeerAddress.SockAddr.In.SinAddr = hdr->SrcAddress.Ip4.Address;\r
-+ } else {\r
-+ ep->Attributes.LocalAddress.SockAddr.In6.Sin6Family = WV_AF_INET6; \r
-+ RtlCopyMemory(ep->Attributes.LocalAddress.SockAddr.In6.Sin6Addr,\r
-+ hdr->DstAddress.Ip6Address, 16);\r
-+ ep->Attributes.PeerAddress.SockAddr.In6.Sin6Family = WV_AF_INET6;\r
-+ RtlCopyMemory(ep->Attributes.PeerAddress.SockAddr.In6.Sin6Addr,\r
-+ hdr->SrcAddress.Ip6Address, 16);\r
-+ }\r
-+ ep->Attributes.Device.DeviceGuid = event.data.req.local_ca_guid;\r
-+ ep->Attributes.Device.Pkey = event.data.req.req.p_primary_path->pkey;\r
-+ ep->Attributes.Device.PortNumber = event.data.req.port_num;\r
-+ ep->Attributes.Param.Connect.ResponderResources = event.data.req.req.resp_res;\r
-+ ep->Attributes.Param.Connect.InitiatorDepth = event.data.req.req.init_depth;\r
-+ ep->Attributes.Param.Connect.RetryCount = event.data.req.req.retry_cnt;\r
-+ ep->Attributes.Param.Connect.RnrRetryCount = event.data.req.req.rnr_retry_cnt;\r
-+ ep->Attributes.Param.Connect.DataLength = sizeof(ep->Attributes.Param.Connect.Data);\r
-+ RtlCopyMemory(ep->Attributes.Param.Connect.Data, hdr + 1,\r
-+ sizeof(ep->Attributes.Param.Connect.Data));\r
-+ ep->Route = *event.data.req.req.p_primary_path;\r
-+\r
-+ ep->State = WvEpPassiveConnect;\r
-+ WvEpPut(ep);\r
- \r
-- hdr = event.data.req.req.p_pdata;\r
-- if ((hdr->IpVersion >> 4) == 4) {\r
-- ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
-- ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
-- ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
-- ep->Attributes.PeerAddress.SockAddr.In.SinAddr = hdr->SrcAddress.Ip4.Address;\r
-- } else {\r
-- ep->Attributes.LocalAddress.SockAddr.In6.Sin6Family = WV_AF_INET6; \r
-- RtlCopyMemory(ep->Attributes.LocalAddress.SockAddr.In6.Sin6Addr,\r
-- hdr->DstAddress.Ip6Address, 16);\r
-- ep->Attributes.PeerAddress.SockAddr.In6.Sin6Family = WV_AF_INET6;\r
-- RtlCopyMemory(ep->Attributes.PeerAddress.SockAddr.In6.Sin6Addr,\r
-- hdr->SrcAddress.Ip6Address, 16);\r
-- }\r
-- ep->Attributes.Device.DeviceGuid = event.data.req.local_ca_guid;\r
-- ep->Attributes.Device.Pkey = event.data.req.req.p_primary_path->pkey;\r
-- ep->Attributes.Device.PortNumber = event.data.req.port_num;\r
-- ep->Attributes.Param.Connect.ResponderResources = event.data.req.req.resp_res;\r
-- ep->Attributes.Param.Connect.InitiatorDepth = event.data.req.req.init_depth;\r
-- ep->Attributes.Param.Connect.RetryCount = event.data.req.req.retry_cnt;\r
-- ep->Attributes.Param.Connect.RnrRetryCount = event.data.req.req.rnr_retry_cnt;\r
-- ep->Attributes.Param.Connect.DataLength = sizeof(ep->Attributes.Param.Connect.Data);\r
-- RtlCopyMemory(ep->Attributes.Param.Connect.Data, hdr + 1,\r
-- sizeof(ep->Attributes.Param.Connect.Data));\r
-- ep->Route = *event.data.req.req.p_primary_path;\r
--\r
-- ep->State = WvEpPassiveConnect;\r
-- WvEpPut(ep);\r
--\r
-- WdfRequestComplete(request, STATUS_SUCCESS);\r
--release:\r
-+ WdfRequestComplete(request, STATUS_SUCCESS);\r
-+ }\r
- WdfObjectReleaseLock(pListen->Queue);\r
- }