Windows SDP client works with another windows client.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 21 Nov 2005 12:21:14 +0000 (12:21 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 21 Nov 2005 12:21:14 +0000 (12:21 +0000)
Windows SDP client works with SDP gen2.
Fix user mode provider while the driver is not loaded. (Rev 298)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@172 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/sdp/kernel/SdpArp.h
ulp/sdp/kernel/SdpBufferPool.cpp
ulp/sdp/kernel/SdpBufferPool.h
ulp/sdp/kernel/SdpConnectionList.cpp
ulp/sdp/kernel/SdpRecvPool.cpp
ulp/sdp/kernel/SdpTrace.h

index 0ce5135..f869d56 100644 (file)
@@ -28,13 +28,25 @@ public:
         if (DestIp == 11 * 256*256*256 + \r
                       4 * 256*256 +\r
                       8 * 256 +\r
-                      + 170) {\r
+                      + 57) {\r
             *SrcIp = 11 * 256*256*256 + \r
                       4 * 256*256 +\r
                       8 * 256 +\r
                       + 159;\r
             return STATUS_SUCCESS;\r
         }\r
+\r
+        if (DestIp == 11 * 256*256*256 + \r
+                      4 * 256*256 +\r
+                      8 * 256 +\r
+                      + 63) {\r
+            *SrcIp = 11 * 256*256*256 + \r
+                      4 * 256*256 +\r
+                      8 * 256 +\r
+                      + 159;\r
+            return STATUS_SUCCESS;\r
+        }\r
+        \r
         ASSERT(FALSE);\r
         *SrcIp = 0;\r
         return STATUS_UNEXPECTED_IO_ERROR;\r
@@ -71,6 +83,16 @@ public:
             *SrcCaGuid = CL_NTOH64(0x2c9010b7c4360);\r
             return STATUS_SUCCESS;\r
         }\r
+        if (SourceAddr == 11 * 256*256*256 + \r
+                      4 * 256*256 +\r
+                      8 * 256 +\r
+                      + 63) {\r
+\r
+            *SrcPortGuid = CL_NTOH64(0x2c901093d8432);//????? swlab63\r
+            *SrcCaGuid = CL_NTOH64(0x2c901093d8430);\r
+            return STATUS_SUCCESS;\r
+        }\r
+        \r
         ASSERT(FALSE);\r
         *SrcPortGuid = 0;\r
         *SrcCaGuid = 0;\r
@@ -93,6 +115,24 @@ public:
             \r
             return STATUS_SUCCESS;\r
         }\r
+        if (DestAddr == 11 * 256*256*256 + \r
+                      4 * 256*256 +\r
+                      8 * 256 +\r
+                      + 63) {\r
+            *DestPortGuid =   CL_NTOH64(0x2c901093d8432);//????? swlab63\r
+            \r
+            return STATUS_SUCCESS;\r
+        }\r
+\r
+        if (DestAddr == 11 * 256*256*256 + \r
+                      4 * 256*256 +\r
+                      8 * 256 +\r
+                      + 57) {\r
+            *DestPortGuid =   CL_NTOH64(0x2c90108a03611);//????? swlab57\r
+            \r
+            return STATUS_SUCCESS;\r
+        }\r
+        \r
         ASSERT(FALSE);\r
         *DestPortGuid = 0;\r
         return STATUS_UNEXPECTED_IO_ERROR;\r
index 7761e8b..b2e2ecb 100644 (file)
@@ -370,6 +370,13 @@ BufferPool::SendBuffer(BufferDescriptor *pBufferDescriptor)
 \r
     send_wr.num_ds = 1;\r
     send_wr.ds_array = &pBufferDescriptor->ds_array;\r
+\r
+\r
+    SDP_PRINT(SDP_DEBUG, SDP_CREDITS, ("Sending buffer pHeader->recv_bufs = %d pHeader->seq_ack = %d\n", \r
+        CL_NTOH16(pHeader->recv_bufs),\r
+        CL_NTOH32(pHeader->seq_ack)\r
+        ));\r
+\r
     \r
     ib_api_status_t ib_status = ib_post_send(m_qp, &send_wr, NULL);\r
     if( ib_status != IB_SUCCESS ) {\r
@@ -424,7 +431,7 @@ BufferPool::PostCredits()
 \r
     rc = SendBuffer(m_CreditdBufferDescriptor);\r
     if (!NT_SUCCESS(rc)) {\r
-        SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("AllocateBuffer failed rc = 0x%x\n", rc ));\r
+        SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("SendBuffer failed rc = 0x%x\n", rc ));\r
         goto Cleanup;\r
     }\r
     \r
index b65bab4..05940a0 100644 (file)
@@ -37,6 +37,25 @@ public:
         return m_Data.Flink;\r
 \r
     }\r
+\r
+    VOID RemoveEntryList(LIST_ENTRY *Item) {\r
+        ASSERT(size > 0);\r
+        ASSERT(!IsListEmpty(&m_Data));        \r
+#if DBG\r
+        // Verify that this item is indeed in the list\r
+        LIST_ENTRY *current = m_Data.Flink;\r
+    while (current != Item) {\r
+        if (current == & m_Data) {\r
+            ASSERT(FALSE);\r
+            SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("Object is not in the list\n"));\r
+        }\r
+        current = current->Flink;\r
+    }\r
+        \r
+#endif\r
+        ::RemoveEntryList(Item);\r
+        size--;\r
+    }\r
     \r
 \r
 private:\r
@@ -145,7 +164,7 @@ public:
     VOID ShutDown();\r
 \r
     uint32_t GetSendSeq() {return m_SendSeq;}\r
-    uint32_t GetAndIncreaseSendSeq() {return m_SendSeq++;}\r
+    uint32_t GetAndIncreaseSendSeq() {return ++m_SendSeq;}\r
     uint32_t GetAdvtSeq() {return m_AdvtSeq;}\r
 \r
     VOID SetRemoteRecvBuf (uint16_t rRecvBuf) {\r
index 4888ccc..7920fef 100644 (file)
@@ -13,9 +13,27 @@ ConnectionList::Init(SdpSocket *pSdpSocket)
 \r
 VOID ConnectionList::Shutdown() \r
 {\r
-    //????????\r
     //?????AssertLocked();\r
     SDP_PRINT(SDP_TRACE, SDP_CONNECTION_LIST, ("this = 0x%p \n", this));\r
+    // Go over both lists, and shutdown all their objects\r
+    LIST_ENTRY *item = NULL;\r
+    SdpSocket *pSocket = NULL;\r
+\r
+    while (m_ReplySentConnections.Size() > 0) {\r
+        item = m_ReplySentConnections.RemoveHeadList();\r
+        pSocket = CONTAINING_RECORD(item, SdpSocket , m_ListeningSocketList);\r
+        pSocket->Shutdown();\r
+        pSocket->Release();\r
+    }\r
+    ASSERT(m_ReplySentConnections.Size() == 0);\r
+\r
+    while (m_ReadyConnections.Size() > 0) {\r
+        item = m_ReadyConnections.RemoveHeadList();\r
+        pSocket = CONTAINING_RECORD(item, SdpSocket , m_ListeningSocketList);\r
+        pSocket->Shutdown();\r
+        pSocket->Release();\r
+    }\r
+    ASSERT(m_ReadyConnections.Size() == 0);\r
     \r
 }\r
 \r
@@ -73,7 +91,9 @@ ConnectionList::MoveConnectionFromReplyToReady(SdpSocket *pNewSocket)
     AssertLocked();\r
     pNewSocket->AssertLocked();\r
     // just take it out from one list and put it in the other\r
-    RemoveEntryList(&pNewSocket->m_ListeningSocketList);\r
+    // This must be done through the list, in order to make sure\r
+    // that the list size is being kept correctly\r
+    m_ReplySentConnections.RemoveEntryList(&pNewSocket->m_ListeningSocketList);\r
     m_ReadyConnections.InsertTailList(&pNewSocket->m_ListeningSocketList);\r
 }\r
 \r
index bfa4d2f..d25f15e 100644 (file)
@@ -77,6 +77,11 @@ RecvPool::RecievedBuffer(BufferDescriptor *pBufferDescriptor, bool error)
                 abs (\r
                     (int)m_pSdpSocket->m_SendBufferPool.GetSendSeq()- \r
                     (int)pHeader->seq_ack);\r
+    SDP_PRINT(SDP_DEBUG, SDP_CREDITS,("SetRemoteRecvBuf rRecvBuf = %d, pHeader->recv_bufs = %d, SendSeq = %d , pHeader->seq_ack = %d\n",\r
+        rRecvBuf,\r
+        pHeader->recv_bufs,\r
+        (int)m_pSdpSocket->m_SendBufferPool.GetSendSeq(),\r
+        (int)pHeader->seq_ack));\r
     m_pSdpSocket->m_SendBufferPool.SetRemoteRecvBuf(rRecvBuf);\r
 \r
     // ???? Handle state changes here ????\r
index 247b340..5254c23 100644 (file)
@@ -4,8 +4,8 @@
 \r
 // Debug level masks\r
 #define SDP_ALL     0x00000001\r
-#define SDP_DEBUG   0x00000002\r
-#define SDP_TRACE   0x00000004\r
+#define SDP_DEBUG   0x00000002   // No - per packet, but very noisy (i.e. credits) \r
+#define SDP_TRACE   0x00000004   // No - per packet (data) print \r
 #define SDP_WARN    0x00000008\r
 #define SDP_ERR     0x00000010\r
 \r
@@ -19,6 +19,8 @@
 #define SDP_LOCK            0x000040\r
 #define SDP_PERFORMANCE     0x000080\r
 #define SDP_CONNECTION_LIST 0x000100\r
+#define SDP_CREDITS         0x000200\r
+\r
 \r
 \r
 // BUGBUG: CONVERT TO A FUNCTION\r