From: tzachid Date: Mon, 21 Nov 2005 12:21:14 +0000 (+0000) Subject: Windows SDP client works with another windows client. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ae29b84f5d7ac855fca112d75694d23d44b341fb;p=~shefty%2Frdma-win.git Windows SDP client works with another windows client. 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@172 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/sdp/kernel/SdpArp.h b/trunk/ulp/sdp/kernel/SdpArp.h index 0ce51357..f869d567 100644 --- a/trunk/ulp/sdp/kernel/SdpArp.h +++ b/trunk/ulp/sdp/kernel/SdpArp.h @@ -28,13 +28,25 @@ public: if (DestIp == 11 * 256*256*256 + 4 * 256*256 + 8 * 256 + - + 170) { + + 57) { *SrcIp = 11 * 256*256*256 + 4 * 256*256 + 8 * 256 + + 159; return STATUS_SUCCESS; } + + if (DestIp == 11 * 256*256*256 + + 4 * 256*256 + + 8 * 256 + + + 63) { + *SrcIp = 11 * 256*256*256 + + 4 * 256*256 + + 8 * 256 + + + 159; + return STATUS_SUCCESS; + } + ASSERT(FALSE); *SrcIp = 0; return STATUS_UNEXPECTED_IO_ERROR; @@ -71,6 +83,16 @@ public: *SrcCaGuid = CL_NTOH64(0x2c9010b7c4360); return STATUS_SUCCESS; } + if (SourceAddr == 11 * 256*256*256 + + 4 * 256*256 + + 8 * 256 + + + 63) { + + *SrcPortGuid = CL_NTOH64(0x2c901093d8432);//????? swlab63 + *SrcCaGuid = CL_NTOH64(0x2c901093d8430); + return STATUS_SUCCESS; + } + ASSERT(FALSE); *SrcPortGuid = 0; *SrcCaGuid = 0; @@ -93,6 +115,24 @@ public: return STATUS_SUCCESS; } + if (DestAddr == 11 * 256*256*256 + + 4 * 256*256 + + 8 * 256 + + + 63) { + *DestPortGuid = CL_NTOH64(0x2c901093d8432);//????? swlab63 + + return STATUS_SUCCESS; + } + + if (DestAddr == 11 * 256*256*256 + + 4 * 256*256 + + 8 * 256 + + + 57) { + *DestPortGuid = CL_NTOH64(0x2c90108a03611);//????? swlab57 + + return STATUS_SUCCESS; + } + ASSERT(FALSE); *DestPortGuid = 0; return STATUS_UNEXPECTED_IO_ERROR; diff --git a/trunk/ulp/sdp/kernel/SdpBufferPool.cpp b/trunk/ulp/sdp/kernel/SdpBufferPool.cpp index 7761e8b0..b2e2ecb3 100644 --- a/trunk/ulp/sdp/kernel/SdpBufferPool.cpp +++ b/trunk/ulp/sdp/kernel/SdpBufferPool.cpp @@ -370,6 +370,13 @@ BufferPool::SendBuffer(BufferDescriptor *pBufferDescriptor) send_wr.num_ds = 1; send_wr.ds_array = &pBufferDescriptor->ds_array; + + + SDP_PRINT(SDP_DEBUG, SDP_CREDITS, ("Sending buffer pHeader->recv_bufs = %d pHeader->seq_ack = %d\n", + CL_NTOH16(pHeader->recv_bufs), + CL_NTOH32(pHeader->seq_ack) + )); + ib_api_status_t ib_status = ib_post_send(m_qp, &send_wr, NULL); if( ib_status != IB_SUCCESS ) { @@ -424,7 +431,7 @@ BufferPool::PostCredits() rc = SendBuffer(m_CreditdBufferDescriptor); if (!NT_SUCCESS(rc)) { - SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("AllocateBuffer failed rc = 0x%x\n", rc )); + SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("SendBuffer failed rc = 0x%x\n", rc )); goto Cleanup; } diff --git a/trunk/ulp/sdp/kernel/SdpBufferPool.h b/trunk/ulp/sdp/kernel/SdpBufferPool.h index b65bab4f..05940a0d 100644 --- a/trunk/ulp/sdp/kernel/SdpBufferPool.h +++ b/trunk/ulp/sdp/kernel/SdpBufferPool.h @@ -37,6 +37,25 @@ public: return m_Data.Flink; } + + VOID RemoveEntryList(LIST_ENTRY *Item) { + ASSERT(size > 0); + ASSERT(!IsListEmpty(&m_Data)); +#if DBG + // Verify that this item is indeed in the list + LIST_ENTRY *current = m_Data.Flink; + while (current != Item) { + if (current == & m_Data) { + ASSERT(FALSE); + SDP_PRINT(SDP_ERR, SDP_BUFFER_POOL, ("Object is not in the list\n")); + } + current = current->Flink; + } + +#endif + ::RemoveEntryList(Item); + size--; + } private: @@ -145,7 +164,7 @@ public: VOID ShutDown(); uint32_t GetSendSeq() {return m_SendSeq;} - uint32_t GetAndIncreaseSendSeq() {return m_SendSeq++;} + uint32_t GetAndIncreaseSendSeq() {return ++m_SendSeq;} uint32_t GetAdvtSeq() {return m_AdvtSeq;} VOID SetRemoteRecvBuf (uint16_t rRecvBuf) { diff --git a/trunk/ulp/sdp/kernel/SdpConnectionList.cpp b/trunk/ulp/sdp/kernel/SdpConnectionList.cpp index 4888cccd..7920fefc 100644 --- a/trunk/ulp/sdp/kernel/SdpConnectionList.cpp +++ b/trunk/ulp/sdp/kernel/SdpConnectionList.cpp @@ -13,9 +13,27 @@ ConnectionList::Init(SdpSocket *pSdpSocket) VOID ConnectionList::Shutdown() { - //???????? //?????AssertLocked(); SDP_PRINT(SDP_TRACE, SDP_CONNECTION_LIST, ("this = 0x%p \n", this)); + // Go over both lists, and shutdown all their objects + LIST_ENTRY *item = NULL; + SdpSocket *pSocket = NULL; + + while (m_ReplySentConnections.Size() > 0) { + item = m_ReplySentConnections.RemoveHeadList(); + pSocket = CONTAINING_RECORD(item, SdpSocket , m_ListeningSocketList); + pSocket->Shutdown(); + pSocket->Release(); + } + ASSERT(m_ReplySentConnections.Size() == 0); + + while (m_ReadyConnections.Size() > 0) { + item = m_ReadyConnections.RemoveHeadList(); + pSocket = CONTAINING_RECORD(item, SdpSocket , m_ListeningSocketList); + pSocket->Shutdown(); + pSocket->Release(); + } + ASSERT(m_ReadyConnections.Size() == 0); } @@ -73,7 +91,9 @@ ConnectionList::MoveConnectionFromReplyToReady(SdpSocket *pNewSocket) AssertLocked(); pNewSocket->AssertLocked(); // just take it out from one list and put it in the other - RemoveEntryList(&pNewSocket->m_ListeningSocketList); + // This must be done through the list, in order to make sure + // that the list size is being kept correctly + m_ReplySentConnections.RemoveEntryList(&pNewSocket->m_ListeningSocketList); m_ReadyConnections.InsertTailList(&pNewSocket->m_ListeningSocketList); } diff --git a/trunk/ulp/sdp/kernel/SdpRecvPool.cpp b/trunk/ulp/sdp/kernel/SdpRecvPool.cpp index bfa4d2f4..d25f15e7 100644 --- a/trunk/ulp/sdp/kernel/SdpRecvPool.cpp +++ b/trunk/ulp/sdp/kernel/SdpRecvPool.cpp @@ -77,6 +77,11 @@ RecvPool::RecievedBuffer(BufferDescriptor *pBufferDescriptor, bool error) abs ( (int)m_pSdpSocket->m_SendBufferPool.GetSendSeq()- (int)pHeader->seq_ack); + SDP_PRINT(SDP_DEBUG, SDP_CREDITS,("SetRemoteRecvBuf rRecvBuf = %d, pHeader->recv_bufs = %d, SendSeq = %d , pHeader->seq_ack = %d\n", + rRecvBuf, + pHeader->recv_bufs, + (int)m_pSdpSocket->m_SendBufferPool.GetSendSeq(), + (int)pHeader->seq_ack)); m_pSdpSocket->m_SendBufferPool.SetRemoteRecvBuf(rRecvBuf); // ???? Handle state changes here ???? diff --git a/trunk/ulp/sdp/kernel/SdpTrace.h b/trunk/ulp/sdp/kernel/SdpTrace.h index 247b3408..5254c231 100644 --- a/trunk/ulp/sdp/kernel/SdpTrace.h +++ b/trunk/ulp/sdp/kernel/SdpTrace.h @@ -4,8 +4,8 @@ // Debug level masks #define SDP_ALL 0x00000001 -#define SDP_DEBUG 0x00000002 -#define SDP_TRACE 0x00000004 +#define SDP_DEBUG 0x00000002 // No - per packet, but very noisy (i.e. credits) +#define SDP_TRACE 0x00000004 // No - per packet (data) print #define SDP_WARN 0x00000008 #define SDP_ERR 0x00000010 @@ -19,6 +19,8 @@ #define SDP_LOCK 0x000040 #define SDP_PERFORMANCE 0x000080 #define SDP_CONNECTION_LIST 0x000100 +#define SDP_CREDITS 0x000200 + // BUGBUG: CONVERT TO A FUNCTION