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
*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
\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
\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
\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
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
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
\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
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
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
\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
#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