#include <SCI_Transporter.hpp>
Inheritance diagram for SCI_Transporter:


class SCITransporter
Definition at line 68 of file SCI_Transporter.hpp.
typedef struct SCI_Transporter::SciAdapter SCI_Transporter::SciAdapter [private] |
typedef struct SCI_Transporter::sourceSegm SCI_Transporter::sourceSegm [private] |
typedef struct SCI_Transporter::targetSegm SCI_Transporter::targetSegm [private] |
| SCI_Transporter::SCI_Transporter | ( | TransporterRegistry & | t_reg, | |
| const char * | local_host, | |||
| const char * | remote_host, | |||
| int | port, | |||
| bool | isMgmConnection, | |||
| Uint32 | packetSize, | |||
| Uint32 | bufferSize, | |||
| Uint32 | nAdapters, | |||
| Uint16 | remoteSciNodeId0, | |||
| Uint16 | remoteSciNodeId1, | |||
| NodeId | localNodeID, | |||
| NodeId | remoteNodeID, | |||
| NodeId | serverNodeId, | |||
| bool | checksum, | |||
| bool | signalId, | |||
| Uint32 | reportFreq = 4096 | |||
| ) | [private] |
Definition at line 33 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, i1024, i10242048, i2048, i20484096, i2049, i4096, i4097, m_ActiveAdapterId, m_adapters, m_BufferSize, m_failCounter, m_initLocal, m_mapped, m_numberOfRemoteNodes, m_PacketSize, m_remoteNodes, m_RemoteSciNodeId, m_RemoteSciNodeId1, m_reportFreq, m_sciinit, m_sendBuffer, m_SourceSegm, m_StandbyAdapterId, m_swapCounter, m_TargetSegm, NULL, and sciAdapters.
00048 : 00049 Transporter(t_reg, tt_SCI_TRANSPORTER, 00050 lHostName, rHostName, r_port, isMgmConnection, _localNodeId, 00051 _remoteNodeId, serverNodeId, 0, false, chksm, signalId) 00052 { 00053 DBUG_ENTER("SCI_Transporter::SCI_Transporter"); 00054 m_PacketSize = (packetSize + 3)/4 ; 00055 m_BufferSize = bufferSize; 00056 m_sendBuffer.m_buffer = NULL; 00057 00058 m_RemoteSciNodeId = remoteSciNodeId0; 00059 00060 if(remoteSciNodeId0 == 0 || remoteSciNodeId1 == 0) 00061 m_numberOfRemoteNodes=1; 00062 else 00063 m_numberOfRemoteNodes=2; 00064 00065 m_RemoteSciNodeId1 = remoteSciNodeId1; 00066 00067 00068 m_initLocal=false; 00069 m_swapCounter=0; 00070 m_failCounter=0; 00071 m_remoteNodes[0]=remoteSciNodeId0; 00072 m_remoteNodes[1]=remoteSciNodeId1; 00073 m_adapters = nAdapters; 00074 // The maximum number of times to try and create, 00075 // start and destroy a sequence 00076 m_ActiveAdapterId=0; 00077 m_StandbyAdapterId=1; 00078 00079 m_mapped = false; 00080 m_sciinit=false; 00081 00082 sciAdapters= new SciAdapter[nAdapters* (sizeof (SciAdapter))]; 00083 if(sciAdapters==NULL) { 00084 } 00085 m_SourceSegm= new sourceSegm[nAdapters* (sizeof (sourceSegm))]; 00086 if(m_SourceSegm==NULL) { 00087 } 00088 m_TargetSegm= new targetSegm[nAdapters* (sizeof (targetSegm))]; 00089 if(m_TargetSegm==NULL) { 00090 } 00091 m_reportFreq= reportFreq; 00092 00093 //reset all statistic counters. 00094 #ifdef DEBUG_TRANSPORTER 00095 i1024=0; 00096 i2048=0; 00097 i2049=0; 00098 i10242048=0; 00099 i20484096=0; 00100 i4096=0; 00101 i4097=0; 00102 #endif 00103 DBUG_VOID_RETURN; 00104 }
| SCI_Transporter::~SCI_Transporter | ( | ) | [private] |
Destructor. Disconnects the transporter.
Definition at line 873 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, Transporter::doDisconnect(), m_sendBuffer, and NULL.
00873 { 00874 DBUG_ENTER("SCI_Transporter::~SCI_Transporter"); 00875 // Close channel to the driver 00876 doDisconnect(); 00877 if(m_sendBuffer.m_buffer != NULL) 00878 delete[] m_sendBuffer.m_buffer; 00879 DBUG_VOID_RETURN; 00880 } // ~SCI_Transporter()
Here is the call graph for this function:

| bool SCI_Transporter::checkConnected | ( | ) |
Check the status of the remote node, if it is connected or has disconnected
Definition at line 1000 of file SCI_Transporter.cpp.
References m_localStatusFlag, and SCIDISCONNECT.
Referenced by TransporterRegistry::performReceive().
01000 { 01001 if (*m_localStatusFlag == SCIDISCONNECT) { 01002 return false; 01003 } 01004 else 01005 return true; 01006 }
Here is the caller graph for this function:

| void SCI_Transporter::closeSCI | ( | ) |
closeSCI closes the SCI virtual device
Definition at line 885 of file SCI_Transporter.cpp.
References activeSCIDescriptor, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, disconnectLocal(), disconnectRemote(), err, and FLAGS.
00885 { 00886 // Termination of SCI 00887 sci_error_t err; 00888 DBUG_ENTER("SCI_Transporter::closeSCI"); 00889 00890 // Disconnect and remove remote segment 00891 disconnectRemote(); 00892 00893 // Unmap and remove local segment 00894 00895 disconnectLocal(); 00896 00897 // Closes an SCI virtual device 00898 SCIClose(activeSCIDescriptor, FLAGS, &err); 00899 00900 if(err != SCI_ERR_OK) { 00901 DBUG_PRINT("error", ("Cannot close SCI channel to the driver. Error code 0x%x", 00902 err)); 00903 } 00904 SCITerminate(); 00905 DBUG_VOID_RETURN; 00906 } // closeSCI()
Here is the call graph for this function:

| bool SCI_Transporter::connect_client_impl | ( | NDB_SOCKET_TYPE | sockfd | ) | [protected, virtual] |
Implements Transporter.
Definition at line 705 of file SCI_Transporter.cpp.
References buf, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, SocketInputStream::gets(), init_local(), init_remote(), NDB_CLOSE_SOCKET(), SocketOutputStream::println(), and Transporter::remoteNodeId.
00706 { 00707 SocketInputStream s_input(sockfd); 00708 SocketOutputStream s_output(sockfd); 00709 char buf[256]; 00710 DBUG_ENTER("SCI_Transporter::connect_client_impl"); 00711 // Wait for server to create and attach 00712 if (s_input.gets(buf, 256) == 0) { 00713 DBUG_PRINT("error", ("No initial response from server in SCI")); 00714 NDB_CLOSE_SOCKET(sockfd); 00715 DBUG_RETURN(false); 00716 } 00717 00718 if (!init_local()) { 00719 NDB_CLOSE_SOCKET(sockfd); 00720 DBUG_RETURN(false); 00721 } 00722 00723 // Send ok to server 00724 s_output.println("sci client 1 ok"); 00725 00726 if (!init_remote()) { 00727 NDB_CLOSE_SOCKET(sockfd); 00728 DBUG_RETURN(false); 00729 } 00730 // Wait for ok from server 00731 if (s_input.gets(buf, 256) == 0) { 00732 DBUG_PRINT("error", ("No second response from server in SCI")); 00733 NDB_CLOSE_SOCKET(sockfd); 00734 DBUG_RETURN(false); 00735 } 00736 // Send ok to server 00737 s_output.println("sci client 2 ok"); 00738 00739 NDB_CLOSE_SOCKET(sockfd); 00740 DBUG_PRINT("info", ("Successfully connected client to node %d", 00741 remoteNodeId)); 00742 DBUG_RETURN(true); 00743 }
Here is the call graph for this function:

| bool SCI_Transporter::connect_server_impl | ( | NDB_SOCKET_TYPE | sockfd | ) | [protected, virtual] |
Perform a connection between segment This is a client node, trying to connect to a remote segment.
| timeout,the | time the connect thread sleeps before retrying. |
Implements Transporter.
Definition at line 746 of file SCI_Transporter.cpp.
References buf, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, SocketInputStream::gets(), init_local(), init_remote(), NDB_CLOSE_SOCKET(), SocketOutputStream::println(), and Transporter::remoteNodeId.
00747 { 00748 SocketOutputStream s_output(sockfd); 00749 SocketInputStream s_input(sockfd); 00750 char buf[256]; 00751 DBUG_ENTER("SCI_Transporter::connect_server_impl"); 00752 00753 if (!init_local()) { 00754 NDB_CLOSE_SOCKET(sockfd); 00755 DBUG_RETURN(false); 00756 } 00757 // Send ok to client 00758 s_output.println("sci server 1 ok"); 00759 00760 // Wait for ok from client 00761 if (s_input.gets(buf, 256) == 0) { 00762 DBUG_PRINT("error", ("No response from client in SCI")); 00763 NDB_CLOSE_SOCKET(sockfd); 00764 DBUG_RETURN(false); 00765 } 00766 00767 if (!init_remote()) { 00768 NDB_CLOSE_SOCKET(sockfd); 00769 DBUG_RETURN(false); 00770 } 00771 // Send ok to client 00772 s_output.println("sci server 2 ok"); 00773 // Wait for ok from client 00774 if (s_input.gets(buf, 256) == 0) { 00775 DBUG_PRINT("error", ("No second response from client in SCI")); 00776 NDB_CLOSE_SOCKET(sockfd); 00777 DBUG_RETURN(false); 00778 } 00779 00780 NDB_CLOSE_SOCKET(sockfd); 00781 DBUG_PRINT("info", ("Successfully connected server to node %d", 00782 remoteNodeId)); 00783 DBUG_RETURN(true); 00784 }
Here is the call graph for this function:

| sci_error_t SCI_Transporter::createSequence | ( | Uint32 | adapterid | ) |
Creates a sequence for error checking.
| adapterid | the adapter on which to create a new sequence. |
Definition at line 786 of file SCI_Transporter.cpp.
References err, m_TargetSegm, and map.
Referenced by doSend(), and setupRemoteSegment().
00786 { 00787 sci_error_t err; 00788 SCICreateMapSequence((m_TargetSegm[adapterid].rhm[adapterid].map), 00789 &(m_TargetSegm[adapterid].sequence), 00790 SCI_FLAG_FAST_BARRIER, 00791 &err); 00792 00793 00794 return err; 00795 } // createSequence()
Here is the caller graph for this function:

| void SCI_Transporter::disconnectImpl | ( | ) | [protected, virtual] |
We will disconnect if:
Implements Transporter.
Definition at line 108 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, disconnectLocal(), disconnectRemote(), err, FLAGS, getConnectionStatus(), i1024, i10242048, i2048, i20484096, i2049, i4096, i4097, m_adapters, m_initLocal, m_mapped, m_sciinit, m_sendBuffer, ndbout(), Transporter::remoteNodeId, Transporter::report_error(), sciAdapters, setDisconnect(), and TE_SCI_UNABLE_TO_CLOSE_CHANNEL.
00109 { 00110 DBUG_ENTER("SCI_Transporter::disconnectImpl"); 00111 sci_error_t err; 00112 if(m_mapped){ 00113 setDisconnect(); 00114 DBUG_PRINT("info", ("connect status = %d, remote node = %d", 00115 (int)getConnectionStatus(), remoteNodeId)); 00116 disconnectRemote(); 00117 disconnectLocal(); 00118 } 00119 00120 // Empty send buffer 00121 00122 m_sendBuffer.m_dataSize = 0; 00123 00124 m_initLocal=false; 00125 m_mapped = false; 00126 00127 if(m_sciinit) { 00128 for(Uint32 i=0; i<m_adapters ; i++) { 00129 SCIClose(sciAdapters[i].scidesc, FLAGS, &err); 00130 00131 if(err != SCI_ERR_OK) { 00132 report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL); 00133 DBUG_PRINT("error", ("Cannot close channel to the driver. Error code 0x%x", 00134 err)); 00135 } 00136 } 00137 } 00138 m_sciinit=false; 00139 00140 #ifdef DEBUG_TRANSPORTER 00141 ndbout << "total: " << i1024+ i10242048 + i2048+i2049 << endl; 00142 ndbout << "<1024: " << i1024 << endl; 00143 ndbout << "1024-2047: " << i10242048 << endl; 00144 ndbout << "==2048: " << i2048 << endl; 00145 ndbout << "2049-4096: " << i20484096 << endl; 00146 ndbout << "==4096: " << i4096 << endl; 00147 ndbout << ">4096: " << i4097 << endl; 00148 #endif 00149 DBUG_VOID_RETURN; 00150 }
Here is the call graph for this function:

| bool SCI_Transporter::disconnectLocal | ( | ) | [private] |
Make the local segment unavailable, no new connections will be accepted.
Free resources used by a local segment
Definition at line 815 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, err, FLAGS, m_ActiveAdapterId, m_SourceSegm, map, Transporter::report_error(), TE_SCI_UNABLE_TO_REMOVE_SEGMENT, and TE_SCI_UNABLE_TO_UNMAP_SEGMENT.
Referenced by closeSCI(), and disconnectImpl().
00816 { 00817 DBUG_ENTER("SCI_Transporter::disconnectLocal"); 00818 sci_error_t err; 00819 m_ActiveAdapterId=0; 00820 00824 SCIUnmapSegment(m_SourceSegm[0].lhm[0].map,0,&err); 00825 if(err!=SCI_ERR_OK) { 00826 report_error(TE_SCI_UNABLE_TO_UNMAP_SEGMENT); 00827 DBUG_PRINT("error", ("Unable to unmap segment")); 00828 DBUG_RETURN(false); 00829 } 00830 00831 SCIRemoveSegment((m_SourceSegm[m_ActiveAdapterId].localHandle), 00832 FLAGS, 00833 &err); 00834 00835 if(err!=SCI_ERR_OK) { 00836 report_error(TE_SCI_UNABLE_TO_REMOVE_SEGMENT); 00837 DBUG_PRINT("error", ("Unable to remove segment")); 00838 DBUG_RETURN(false); 00839 } 00840 DBUG_PRINT("info", ("Local memory segment is unmapped and removed")); 00841 DBUG_RETURN(true); 00842 } // disconnectLocal()
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SCI_Transporter::disconnectRemote | ( | ) | [private] |
Make the local segment unavailable, no new connections will be accepted.
Segment unmapped, disconnect from the remotely connected segment
Definition at line 845 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, err, FLAGS, m_adapters, m_TargetSegm, map, Transporter::report_error(), TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT, and TE_SCI_UNABLE_TO_UNMAP_SEGMENT.
Referenced by closeSCI(), and disconnectImpl().
00845 { 00846 DBUG_ENTER("SCI_Transporter::disconnectRemote"); 00847 sci_error_t err; 00848 for(Uint32 i=0; i<m_adapters; i++) { 00852 SCIUnmapSegment(m_TargetSegm[i].rhm[i].map,0,&err); 00853 if(err!=SCI_ERR_OK) { 00854 report_error(TE_SCI_UNABLE_TO_UNMAP_SEGMENT); 00855 DBUG_PRINT("error", ("Unable to unmap segment")); 00856 DBUG_RETURN(false); 00857 } 00858 00859 SCIDisconnectSegment(m_TargetSegm[i].rhm[i].remoteHandle, 00860 FLAGS, 00861 &err); 00862 if(err!=SCI_ERR_OK) { 00863 report_error(TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT); 00864 DBUG_PRINT("error", ("Unable to disconnect segment")); 00865 DBUG_RETURN(false); 00866 } 00867 DBUG_PRINT("info", ("Remote memory segment is unmapped and disconnected")); 00868 } 00869 DBUG_RETURN(true); 00870 } // disconnectRemote()
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SCI_Transporter::doSend | ( | ) | [private] |
doSend. Copies the data from the source (the send buffer) to the shared mem. segment. Sequences are used for error checking. If an error occurs, the transfer is retried. If the link that we need to swap to is broken, we will disconnect.
swap from active (0) to standby (1)
swap back from 1 to 0 must check that the link is up
If we end up here, the SCI segment is full.
Definition at line 321 of file SCI_Transporter.cpp.
References createSequence(), DBUG_PRINT, err, failoverShmWriter(), FLAGS, SHM_Writer::getBufferSize(), getLinkStatus(), SHM_Writer::getWriteIndex(), i1024, i10242048, i2048, i20484096, i4096, i4097, m_ActiveAdapterId, m_adapters, m_failCounter, m_sendBuffer, m_StandbyAdapterId, m_swapCounter, m_TargetSegm, map, Transporter::report_error(), startMicro, startSec, startSequence(), stopMicro, stopSec, TE_SCI_UNABLE_TO_CREATE_SEQUENCE, TE_SCI_UNABLE_TO_REMOVE_SEQUENCE, TE_SCI_UNABLE_TO_START_SEQUENCE, TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR, SHM_Writer::updateWritePtr(), SCI_Transporter::targetSegm::writer, and writer.
Referenced by getWritePtr(), and updateWritePtr().
00321 { 00322 #ifdef DEBUG_TRANSPORTER 00323 NDB_TICKS startSec=0, stopSec=0; 00324 Uint32 startMicro=0, stopMicro=0, totalMicro=0; 00325 #endif 00326 sci_error_t err; 00327 Uint32 retry=0; 00328 00329 const char * const sendPtr = (char*)m_sendBuffer.m_buffer; 00330 const Uint32 sizeToSend = 4 * m_sendBuffer.m_dataSize; //Convert to number of bytes 00331 00332 if (sizeToSend > 0){ 00333 #ifdef DEBUG_TRANSPORTER 00334 if(sizeToSend < 1024 ) 00335 i1024++; 00336 if(sizeToSend > 1024 && sizeToSend < 2048 ) 00337 i10242048++; 00338 if(sizeToSend==2048) 00339 i2048++; 00340 if(sizeToSend>2048 && sizeToSend < 4096) 00341 i20484096++; 00342 if(sizeToSend==4096) 00343 i4096++; 00344 if(sizeToSend==4097) 00345 i4097++; 00346 #endif 00347 if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { 00348 DBUG_PRINT("error", ("Start sequence failed")); 00349 report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); 00350 return false; 00351 } 00352 00353 00354 tryagain: 00355 retry++; 00356 if (retry > 3) { 00357 DBUG_PRINT("error", ("SCI Transfer failed")); 00358 report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); 00359 return false; 00360 } 00361 Uint32 * insertPtr = (Uint32 *) 00362 (m_TargetSegm[m_ActiveAdapterId].writer)->getWritePtr(sizeToSend); 00363 00364 if(insertPtr != 0) { 00365 00366 const Uint32 remoteOffset=(Uint32) 00367 ((char*)insertPtr - 00368 (char*)(m_TargetSegm[m_ActiveAdapterId].mappedMemory)); 00369 00370 SCIMemCpy(m_TargetSegm[m_ActiveAdapterId].sequence, 00371 (void*)sendPtr, 00372 m_TargetSegm[m_ActiveAdapterId].rhm[m_ActiveAdapterId].map, 00373 remoteOffset, 00374 sizeToSend, 00375 SCI_FLAG_ERROR_CHECK, 00376 &err); 00377 00378 00379 if (err != SCI_ERR_OK) { 00380 if(err == SCI_ERR_OUT_OF_RANGE) { 00381 DBUG_PRINT("error", ("Data transfer : out of range error")); 00382 goto tryagain; 00383 } 00384 if(err == SCI_ERR_SIZE_ALIGNMENT) { 00385 DBUG_PRINT("error", ("Data transfer : alignment error")); 00386 DBUG_PRINT("info", ("sendPtr 0x%x, sizeToSend = %d", sendPtr, sizeToSend)); 00387 goto tryagain; 00388 } 00389 if(err == SCI_ERR_OFFSET_ALIGNMENT) { 00390 DBUG_PRINT("error", ("Data transfer : offset alignment")); 00391 goto tryagain; 00392 } 00393 if(err == SCI_ERR_TRANSFER_FAILED) { 00394 //(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock(); 00395 if(getLinkStatus(m_ActiveAdapterId)) { 00396 goto tryagain; 00397 } 00398 if (m_adapters == 1) { 00399 DBUG_PRINT("error", ("SCI Transfer failed")); 00400 report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); 00401 return false; 00402 } 00403 m_failCounter++; 00404 Uint32 temp=m_ActiveAdapterId; 00405 switch(m_swapCounter) { 00406 case 0: 00408 if(getLinkStatus(m_StandbyAdapterId)) { 00409 DBUG_PRINT("error", ("Swapping from adapter 0 to 1")); 00410 failoverShmWriter(); 00411 SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0); 00412 m_ActiveAdapterId=m_StandbyAdapterId; 00413 m_StandbyAdapterId=temp; 00414 SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence), 00415 FLAGS, 00416 &err); 00417 if(err!=SCI_ERR_OK) { 00418 report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE); 00419 DBUG_PRINT("error", ("Unable to remove sequence")); 00420 return false; 00421 } 00422 if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { 00423 DBUG_PRINT("error", ("Start sequence failed")); 00424 report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); 00425 return false; 00426 } 00427 m_swapCounter++; 00428 DBUG_PRINT("info", ("failover complete")); 00429 goto tryagain; 00430 } else { 00431 report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); 00432 DBUG_PRINT("error", ("SCI Transfer failed")); 00433 return false; 00434 } 00435 return false; 00436 break; 00437 case 1: 00441 if(getLinkStatus(m_StandbyAdapterId)) { 00442 failoverShmWriter(); 00443 m_ActiveAdapterId=m_StandbyAdapterId; 00444 m_StandbyAdapterId=temp; 00445 DBUG_PRINT("info", ("Swapping from 1 to 0")); 00446 if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { 00447 DBUG_PRINT("error", ("Unable to create sequence")); 00448 report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); 00449 return false; 00450 } 00451 if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { 00452 DBUG_PRINT("error", ("startSequence failed... disconnecting")); 00453 report_error(TE_SCI_UNABLE_TO_START_SEQUENCE); 00454 return false; 00455 } 00456 00457 SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence) 00458 , FLAGS, 00459 &err); 00460 if(err!=SCI_ERR_OK) { 00461 DBUG_PRINT("error", ("Unable to remove sequence")); 00462 report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE); 00463 return false; 00464 } 00465 00466 if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) { 00467 DBUG_PRINT("error", ("Unable to create sequence on standby")); 00468 report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); 00469 return false; 00470 } 00471 00472 m_swapCounter=0; 00473 00474 DBUG_PRINT("info", ("failover complete..")); 00475 goto tryagain; 00476 00477 } else { 00478 DBUG_PRINT("error", ("Unrecoverable data transfer error")); 00479 report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); 00480 return false; 00481 } 00482 00483 break; 00484 default: 00485 DBUG_PRINT("error", ("Unrecoverable data transfer error")); 00486 report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); 00487 return false; 00488 break; 00489 } 00490 } 00491 } else { 00492 SHM_Writer * writer = (m_TargetSegm[m_ActiveAdapterId].writer); 00493 writer->updateWritePtr(sizeToSend); 00494 00495 Uint32 sendLimit = writer->getBufferSize(); 00496 sendLimit -= writer->getWriteIndex(); 00497 00498 m_sendBuffer.m_dataSize = 0; 00499 m_sendBuffer.m_forceSendLimit = sendLimit; 00500 } 00501 00502 } else { 00506 DBUG_PRINT("error", ("the segment is full for some reason")); 00507 return false; 00508 } //if 00509 } 00510 return true; 00511 } // doSend()
Here is the call graph for this function:

Here is the caller graph for this function:

| void SCI_Transporter::failoverShmWriter | ( | ) | [private] |
failoverShmWriter takes the state of the active writer and inserts into the standby writer.
Definition at line 515 of file SCI_Transporter.cpp.
References m_StandbyAdapterId, m_TargetSegm, writer, and SCI_Transporter::targetSegm::writer.
Referenced by doSend().
00515 { 00516 #if 0 00517 (m_TargetSegm[m_StandbyAdapterId].writer) 00518 ->copyIndexes((m_TargetSegm[m_StandbyAdapterId].writer)); 00519 #endif 00520 } //failoverShm
Here is the caller graph for this function:

| Uint32 SCI_Transporter::get_free_buffer | ( | ) | const [virtual] |
Implements Transporter.
Definition at line 1029 of file SCI_Transporter.cpp.
References m_ActiveAdapterId, m_TargetSegm, and writer.
01030 { 01031 return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer(); 01032 }
| bool SCI_Transporter::getConnectionStatus | ( | ) |
Check if the segment are properly connected to each other (remotely and locally).
Definition at line 967 of file SCI_Transporter.cpp.
References m_adapters, m_localStatusFlag, m_remoteStatusFlag, m_remoteStatusFlag2, and SCICONNECTED.
Referenced by disconnectImpl(), and init_remote().
00967 { 00968 if(*m_localStatusFlag == SCICONNECTED && 00969 (*m_remoteStatusFlag == SCICONNECTED || 00970 ((m_adapters > 1) && 00971 *m_remoteStatusFlag2 == SCICONNECTED))) 00972 return true; 00973 else 00974 return false; 00975 }
Here is the caller graph for this function:

Check if there is a link between the adapter and the switch
| adapterNo | the adapter for which to retrieve the link status. |
Definition at line 204 of file SCI_Transporter.cpp.
References DBUG_PRINT, error, and NULL.
Referenced by doSend(), initTransporter(), and setDisconnect().
00205 { 00206 sci_query_adapter_t queryAdapter; 00207 sci_error_t error; 00208 int linkstatus; 00209 queryAdapter.subcommand = SCI_Q_ADAPTER_LINK_OPERATIONAL; 00210 00211 queryAdapter.localAdapterNo = adapterNo; 00212 queryAdapter.data = &linkstatus; 00213 00214 SCIQuery(SCI_Q_ADAPTER,(void*)(&queryAdapter),(Uint32)NULL,&error); 00215 00216 if(error != SCI_ERR_OK) { 00217 DBUG_PRINT("error", ("error %d querying adapter", error)); 00218 return false; 00219 } 00220 if(linkstatus<=0) 00221 return false; 00222 return true; 00223 }
Here is the caller graph for this function:

| adapterNo | the adapter for which to retrieve the node id. |
Definition at line 186 of file SCI_Transporter.cpp.
00187 { 00188 sci_query_adapter_t queryAdapter; 00189 sci_error_t error; 00190 Uint32 _localNodeId; 00191 00192 queryAdapter.subcommand = SCI_Q_ADAPTER_NODEID; 00193 queryAdapter.localAdapterNo = adapterNo; 00194 queryAdapter.data = &_localNodeId; 00195 00196 SCIQuery(SCI_Q_ADAPTER,(void*)(&queryAdapter),(Uint32)NULL,&error); 00197 00198 if(error != SCI_ERR_OK) 00199 return 0; 00200 return _localNodeId; 00201 }
Definition at line 303 of file SCI_Transporter.hpp.
References SHM_Reader::getReadPtr(), and reader.
Referenced by TransporterRegistry::performReceive().
00303 { 00304 reader->getReadPtr(* ptr, * eod); 00305 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implements Transporter.
Definition at line 909 of file SCI_Transporter.cpp.
References doSend(), and m_sendBuffer.
00910 { 00911 00912 Uint32 sci_buffer_remaining = m_sendBuffer.m_forceSendLimit; 00913 Uint32 send_buf_size = m_sendBuffer.m_sendBufferSize; 00914 Uint32 curr_data_size = m_sendBuffer.m_dataSize << 2; 00915 Uint32 new_curr_data_size = curr_data_size + lenBytes; 00916 if ((curr_data_size >= send_buf_size) || 00917 (curr_data_size >= sci_buffer_remaining)) { 00924 if (!doSend()) { 00929 return 0; 00930 } 00931 } 00935 Uint32 sz = m_sendBuffer.m_dataSize; 00936 return &m_sendBuffer.m_buffer[sz]; 00937 }
Here is the call graph for this function:

| bool SCI_Transporter::hasDataToRead | ( | ) | const [inline, private] |
Definition at line 275 of file SCI_Transporter.hpp.
References SHM_Reader::empty(), and reader.
Here is the call graph for this function:

| bool SCI_Transporter::hasDataToSend | ( | ) | const [inline, private] |
Definition at line 279 of file SCI_Transporter.hpp.
References m_sendBuffer.
00279 { 00280 return m_sendBuffer.m_dataSize > 0; 00281 }
The theLocalAdapterId combined with the theRemoteNodeId constructs (SCI ids)* a unique identifier for the local segment
Definition at line 378 of file SCI_Transporter.hpp.
Referenced by initLocalSegment().
Here is the caller graph for this function:

| bool SCI_Transporter::init_local | ( | ) | [private] |
Definition at line 629 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_RETURN, initLocalSegment(), m_initLocal, NdbSleep_MilliSleep(), Transporter::report_error(), and TE_SCI_CANNOT_INIT_LOCALSEGMENT.
Referenced by connect_client_impl(), and connect_server_impl().
00630 { 00631 DBUG_ENTER("SCI_Transporter::init_local"); 00632 if(!m_initLocal) { 00633 if(initLocalSegment()!=SCI_ERR_OK){ 00634 NdbSleep_MilliSleep(10); 00635 //NDB SHOULD TERMINATE AND COMPUTER REBOOTED! 00636 report_error(TE_SCI_CANNOT_INIT_LOCALSEGMENT); 00637 DBUG_RETURN(false); 00638 } 00639 m_initLocal=true; 00640 } 00641 DBUG_RETURN(true); 00642 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SCI_Transporter::init_remote | ( | ) | [private] |
Definition at line 645 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, err, FLAGS, getConnectionStatus(), Transporter::localNodeId, m_adapters, m_BufferSize, m_mapped, m_remoteNodes, m_RemoteSciNodeId, m_TargetSegm, map, NdbSleep_MilliSleep(), NULL, offset, Transporter::remoteNodeId, remoteSegmentId(), Transporter::report_error(), sciAdapters, setConnected(), setupRemoteSegment(), and TE_SCI_CANNOT_MAP_REMOTESEGMENT.
Referenced by connect_client_impl(), and connect_server_impl().
00646 { 00647 DBUG_ENTER("SCI_Transporter::init_remote"); 00648 sci_error_t err; 00649 Uint32 offset = 0; 00650 if(!m_mapped ) { 00651 DBUG_PRINT("info", ("Map remote segments")); 00652 for(Uint32 i=0; i < m_adapters ; i++) { 00653 m_TargetSegm[i].rhm[i].remoteHandle=0; 00654 SCIConnectSegment(sciAdapters[i].scidesc, 00655 &(m_TargetSegm[i].rhm[i].remoteHandle), 00656 m_remoteNodes[i], 00657 remoteSegmentId(localNodeId, remoteNodeId), 00658 i, 00659 0, 00660 0, 00661 0, 00662 0, 00663 &err); 00664 00665 if(err != SCI_ERR_OK) { 00666 NdbSleep_MilliSleep(10); 00667 DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err)); 00668 DBUG_RETURN(false); 00669 } 00670 00671 } 00672 // Map the remote memory segment into program space 00673 for(Uint32 i=0; i < m_adapters ; i++) { 00674 m_TargetSegm[i].mappedMemory = 00675 SCIMapRemoteSegment((m_TargetSegm[i].rhm[i].remoteHandle), 00676 &(m_TargetSegm[i].rhm[i].map), 00677 offset, 00678 m_BufferSize, 00679 NULL, 00680 FLAGS, 00681 &err); 00682 00683 00684 if(err!= SCI_ERR_OK) { 00685 DBUG_PRINT("error", ("Cannot map a segment to the remote node %d. Error code 0x%x",m_RemoteSciNodeId, err)); 00686 //NDB SHOULD TERMINATE AND COMPUTER REBOOTED! 00687 report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT); 00688 DBUG_RETURN(false); 00689 } 00690 } 00691 m_mapped=true; 00692 setupRemoteSegment(); 00693 setConnected(); 00694 DBUG_PRINT("info", ("connected and mapped to segment, remoteNode: %d", 00695 remoteNodeId)); 00696 DBUG_PRINT("info", ("remoteSegId: %d", 00697 remoteSegmentId(localNodeId, remoteNodeId))); 00698 DBUG_RETURN(true); 00699 } else { 00700 DBUG_RETURN(getConnectionStatus()); 00701 } 00702 }
Here is the call graph for this function:

Here is the caller graph for this function:

| sci_error_t SCI_Transporter::initLocalSegment | ( | ) |
Initiate Local Segment: create a memory segment, prepare a memory segment, map the local segment into memory space and make segment available.
Prepare the segment
Make the local segment available
Definition at line 227 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, Transporter::doDisconnect(), err, FLAGS, Transporter::getLocalNodeId(), hostSegmentId(), Transporter::localNodeId, SCI_Transporter::SciAdapter::localSciNodeId, m_adapters, m_BufferSize, m_sciinit, m_SourceSegm, map, SCI_Transporter::sourceSegm::mappedMemory, NULL, offset, Transporter::remoteNodeId, sciAdapters, segmentSize, and setupLocalSegment().
Referenced by init_local().
00227 { 00228 DBUG_ENTER("SCI_Transporter::initLocalSegment"); 00229 Uint32 segmentSize = m_BufferSize; 00230 Uint32 offset = 0; 00231 sci_error_t err; 00232 if(!m_sciinit) { 00233 for(Uint32 i=0; i<m_adapters ; i++) { 00234 SCIOpen(&(sciAdapters[i].scidesc), FLAGS, &err); 00235 sciAdapters[i].localSciNodeId=getLocalNodeId(i); 00236 DBUG_PRINT("info", ("SCInode iD %d adapter %d\n", 00237 sciAdapters[i].localSciNodeId, i)); 00238 if(err != SCI_ERR_OK) { 00239 DBUG_PRINT("error", ("Cannot open an SCI virtual device. Error code 0x%x", 00240 err)); 00241 DBUG_RETURN(err); 00242 } 00243 } 00244 } 00245 00246 m_sciinit=true; 00247 00248 SCICreateSegment(sciAdapters[0].scidesc, 00249 &(m_SourceSegm[0].localHandle), 00250 hostSegmentId(localNodeId, remoteNodeId), 00251 segmentSize, 00252 0, 00253 0, 00254 0, 00255 &err); 00256 00257 if(err != SCI_ERR_OK) { 00258 DBUG_PRINT("error", ("Error creating segment, err = 0x%x", err)); 00259 DBUG_RETURN(err); 00260 } else { 00261 DBUG_PRINT("info", ("created segment id : %d", 00262 hostSegmentId(localNodeId, remoteNodeId))); 00263 } 00264 00266 for(Uint32 i=0; i < m_adapters; i++) { 00267 SCIPrepareSegment((m_SourceSegm[0].localHandle), 00268 i, 00269 FLAGS, 00270 &err); 00271 00272 if(err != SCI_ERR_OK) { 00273 DBUG_PRINT("error", ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n", 00274 err)); 00275 DBUG_RETURN(err); 00276 } 00277 } 00278 00279 00280 m_SourceSegm[0].mappedMemory = 00281 SCIMapLocalSegment((m_SourceSegm[0].localHandle), 00282 &(m_SourceSegm[0].lhm[0].map), 00283 offset, 00284 segmentSize, 00285 NULL, 00286 FLAGS, 00287 &err); 00288 00289 00290 00291 if(err != SCI_ERR_OK) { 00292 DBUG_PRINT("error", ("Cannot map area of size %d. Error code 0x%x", 00293 segmentSize,err)); 00294 doDisconnect(); 00295 DBUG_RETURN(err); 00296 } 00297 00298 00300 for(Uint32 i=0; i < m_adapters; i++) { 00301 SCISetSegmentAvailable((m_SourceSegm[0].localHandle), 00302 i, 00303 FLAGS, 00304 &err); 00305 00306 if(err != SCI_ERR_OK) { 00307 DBUG_PRINT("error", ("Local Segment is not available for remote connections. Error code 0x%x\n", 00308 err)); 00309 DBUG_RETURN(err); 00310 } 00311 } 00312 00313 00314 setupLocalSegment(); 00315 00316 DBUG_RETURN(err); 00317 00318 } // initLocalSegment()
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SCI_Transporter::initSCI | ( | ) | [static, protected] |
Definition at line 1011 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, and init.
Referenced by TransporterRegistry::createSCITransporter().
01011 { 01012 DBUG_ENTER("SCI_Transporter::initSCI"); 01013 if(!init){ 01014 sci_error_t error; 01015 // Initialize SISCI library 01016 SCIInitialize(0, &error); 01017 if(error != SCI_ERR_OK) { 01018 DBUG_PRINT("error", ("Cannot initialize SISCI library.")); 01019 DBUG_PRINT("error", ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x", 01020 error)); 01021 DBUG_RETURN(false); 01022 } 01023 init = true; 01024 } 01025 DBUG_RETURN(true); 01026 }
Here is the caller graph for this function:

| bool SCI_Transporter::initTransporter | ( | ) | [virtual] |
Init the transporter. Allocate sendbuffers and open a SCI virtual device for each adapter.
Implements Transporter.
Definition at line 153 of file SCI_Transporter.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, getLinkStatus(), m_ActiveAdapterId, m_adapters, m_BufferSize, m_PacketSize, m_sendBuffer, m_StandbyAdapterId, MAX_MESSAGE_SIZE, Transporter::report_error(), and TE_SCI_LINK_ERROR.
Referenced by TransporterRegistry::createSCITransporter().
00153 { 00154 DBUG_ENTER("SCI_Transporter::initTransporter"); 00155 if(m_BufferSize < (2*MAX_MESSAGE_SIZE + 4096)){ 00156 m_BufferSize = 2 * MAX_MESSAGE_SIZE + 4096; 00157 } 00158 00159 // Allocate buffers for sending, send buffer size plus 2048 bytes for avoiding 00160 // the need to send twice when a large message comes around. Send buffer size is 00161 // measured in words. 00162 Uint32 sz = 4 * m_PacketSize + MAX_MESSAGE_SIZE;; 00163 00164 m_sendBuffer.m_sendBufferSize = 4 * ((sz + 3) / 4); 00165 m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4]; 00166 m_sendBuffer.m_dataSize = 0; 00167 00168 DBUG_PRINT("info", ("Created SCI Send Buffer with buffer size %d and packet size %d", 00169 m_sendBuffer.m_sendBufferSize, m_PacketSize * 4)); 00170 if(!getLinkStatus(m_ActiveAdapterId) || 00171 (m_adapters > 1 && 00172 !getLinkStatus(m_StandbyAdapterId))) { 00173 DBUG_PRINT("error", ("The link is not fully operational. Check the cables and the switches")); 00174 //reportDisconnect(remoteNodeId, 0); 00175 //doDisconnect(); 00176 //NDB should terminate 00177 report_error(TE_SCI_LINK_ERROR); 00178 DBUG_RETURN(false); 00179 } 00180 00181 DBUG_RETURN(true); 00182 } // initTransporter()
Here is the call graph for this function:

Here is the caller graph for this function:

Calculate the segment id for the remote segment
| localNodeId | - local id (e.g. 1 = mgm , 2 = ndb.2 etc.) | |
| remoteNodeId | - remote id (e.g. 1 = mgm , 2 = ndb.2 etc.) |
Definition at line 389 of file SCI_Transporter.hpp.
Referenced by init_remote().
Here is the caller graph for this function:

| void SCI_Transporter::resetToInitialState | ( | ) | [private] |
| bool SCI_Transporter::sendIsPossible | ( | struct timeval * | timeout | ) | [private] |
It is always possible to send data with SCI!
| void SCI_Transporter::setConnected | ( | ) | [private] |
Set the connect flag in the remote memory segment (write through)
Definition at line 979 of file SCI_Transporter.cpp.
References m_adapters, m_localStatusFlag, m_remoteStatusFlag, m_remoteStatusFlag2, and SCICONNECTED.
Referenced by init_remote().
00979 { 00980 *m_remoteStatusFlag = SCICONNECTED; 00981 if (m_adapters > 1) { 00982 *m_remoteStatusFlag2 = SCICONNECTED; 00983 } 00984 *m_localStatusFlag = SCICONNECTED; 00985 }
Here is the caller graph for this function:

| void SCI_Transporter::setDisconnect | ( | ) | [private] |
Set the disconnect flag in the remote memory segment (write through)
Definition at line 989 of file SCI_Transporter.cpp.
References getLinkStatus(), m_ActiveAdapterId, m_adapters, m_remoteStatusFlag, m_remoteStatusFlag2, m_StandbyAdapterId, and SCIDISCONNECT.
Referenced by disconnectImpl().
00989 { 00990 if(getLinkStatus(m_ActiveAdapterId)) 00991 *m_remoteStatusFlag = SCIDISCONNECT; 00992 if (m_adapters > 1) { 00993 if(getLinkStatus(m_StandbyAdapterId)) 00994 *m_remoteStatusFlag2 = SCIDISCONNECT; 00995 } 00996 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void SCI_Transporter::setupLocalSegment | ( | ) | [private] |
Corresponds to SHM_Transporter::setupBuffers() Initiates the start pointer of the buffer and read pointers. Initiate the localSegment for the SHM reader.
Definition at line 523 of file SCI_Transporter.cpp.
References SHM_Reader::clear(), DBUG_ENTER, DBUG_VOID_RETURN, m_ActiveAdapterId, m_BufferSize, m_localStatusFlag, m_SourceSegm, MAX_MESSAGE_SIZE, and reader.
Referenced by initLocalSegment().
00524 { 00525 DBUG_ENTER("SCI_Transporter::setupLocalSegment"); 00526 Uint32 sharedSize = 0; 00527 sharedSize =4096; //start of the buffer is page aligend 00528 00529 Uint32 sizeOfBuffer = m_BufferSize; 00530 00531 sizeOfBuffer -= sharedSize; 00532 00533 Uint32 * localReadIndex = 00534 (Uint32*)m_SourceSegm[m_ActiveAdapterId].mappedMemory; 00535 Uint32 * localWriteIndex = (Uint32*)(localReadIndex+ 1); 00536 m_localStatusFlag = (Uint32*)(localReadIndex + 3); 00537 00538 char * localStartOfBuf = (char*) 00539 ((char*)m_SourceSegm[m_ActiveAdapterId].mappedMemory+sharedSize); 00540 00541 * localReadIndex = 0; 00542 * localWriteIndex = 0; 00543 00544 const Uint32 slack = MAX_MESSAGE_SIZE; 00545 00546 reader = new SHM_Reader(localStartOfBuf, 00547 sizeOfBuffer, 00548 slack, 00549 localReadIndex, 00550 localWriteIndex); 00551 00552 reader->clear(); 00553 DBUG_VOID_RETURN; 00554 } //setupLocalSegment
Here is the call graph for this function:

Here is the caller graph for this function:

| void SCI_Transporter::setupRemoteSegment | ( | ) | [private] |
Initiate the remoteSegment for the SHM writer
setup a writer. writer2 is used to mirror the changes of writer on the standby segment, so that in the case of a failover, we can switch to the stdby seg. quickly.*
Definition at line 558 of file SCI_Transporter.cpp.
References SHM_Writer::clear(), createSequence(), DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, Transporter::doDisconnect(), SHM_Writer::getBufferSize(), m_ActiveAdapterId, m_adapters, m_BufferSize, m_remoteStatusFlag, m_remoteStatusFlag2, m_sendBuffer, m_StandbyAdapterId, m_TargetSegm, MAX_MESSAGE_SIZE, Transporter::report_error(), TE_SCI_UNABLE_TO_CREATE_SEQUENCE, SCI_Transporter::targetSegm::writer, writer, and writer2.
Referenced by init_remote().
00559 { 00560 DBUG_ENTER("SCI_Transporter::setupRemoteSegment"); 00561 Uint32 sharedSize = 0; 00562 sharedSize =4096; //start of the buffer is page aligned 00563 00564 00565 Uint32 sizeOfBuffer = m_BufferSize; 00566 const Uint32 slack = MAX_MESSAGE_SIZE; 00567 sizeOfBuffer -= sharedSize; 00568 00569 Uint32 *segPtr = (Uint32*) m_TargetSegm[m_ActiveAdapterId].mappedMemory ; 00570 00571 Uint32 * remoteReadIndex = (Uint32*)segPtr; 00572 Uint32 * remoteWriteIndex = (Uint32*)(segPtr + 1); 00573 m_remoteStatusFlag = (Uint32*)(segPtr + 3); 00574 00575 char * remoteStartOfBuf = ( char*)((char*)segPtr+(sharedSize)); 00576 00577 writer = new SHM_Writer(remoteStartOfBuf, 00578 sizeOfBuffer, 00579 slack, 00580 remoteReadIndex, 00581 remoteWriteIndex); 00582 00583 writer->clear(); 00584 00585 m_TargetSegm[0].writer=writer; 00586 00587 m_sendBuffer.m_forceSendLimit = writer->getBufferSize(); 00588 00589 if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) { 00590 report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); 00591 DBUG_PRINT("error", ("Unable to create sequence on active")); 00592 doDisconnect(); 00593 } 00594 if (m_adapters > 1) { 00595 segPtr = (Uint32*) m_TargetSegm[m_StandbyAdapterId].mappedMemory ; 00596 00597 Uint32 * remoteReadIndex2 = (Uint32*)segPtr; 00598 Uint32 * remoteWriteIndex2 = (Uint32*) (segPtr + 1); 00599 m_remoteStatusFlag2 = (Uint32*)(segPtr + 3); 00600 00601 char * remoteStartOfBuf2 = ( char*)((char *)segPtr+sharedSize); 00602 00609 writer2 = new SHM_Writer(remoteStartOfBuf2, 00610 sizeOfBuffer, 00611 slack, 00612 remoteReadIndex2, 00613 remoteWriteIndex2); 00614 00615 * remoteReadIndex = 0; 00616 * remoteWriteIndex = 0; 00617 writer2->clear(); 00618 m_TargetSegm[1].writer=writer2; 00619 if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) { 00620 report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE); 00621 DBUG_PRINT("error", ("Unable to create sequence on standby")); 00622 doDisconnect(); 00623 } 00624 } 00625 DBUG_VOID_RETURN; 00626 } //setupRemoteSegment
Here is the call graph for this function:

Here is the caller graph for this function:

| sci_error_t SCI_Transporter::startSequence | ( | Uint32 | adapterid | ) |
starts a sequence for error checking. The actual checking that a sequence is correct is done implicitly in SCIMemCpy (in doSend).
| adapterid | the adapter on which to start the sequence. |
Perform preliminary error check on an SCI adapter before starting a sequence of read and write operations on the mapped segment.
Definition at line 798 of file SCI_Transporter.cpp.
References err, FLAGS, m_SequenceStatus, and m_TargetSegm.
Referenced by doSend().
00798 { 00799 00800 sci_error_t err; 00804 m_SequenceStatus = SCIStartSequence( 00805 (m_TargetSegm[adapterid].sequence), 00806 FLAGS, &err); 00807 00808 00809 // If there still is an error then data cannot be safely send 00810 return err; 00811 } // startSequence()
Here is the caller graph for this function:

| void SCI_Transporter::updateReceivePtr | ( | Uint32 * | ptr | ) | [inline, private] |
Definition at line 307 of file SCI_Transporter.hpp.
References reader, and SHM_Reader::updateReadPtr().
Referenced by TransporterRegistry::performReceive().
00307 { 00308 reader->updateReadPtr(ptr); 00309 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implements Transporter.
Definition at line 940 of file SCI_Transporter.cpp.
References doSend(), m_PacketSize, and m_sendBuffer.
00940 { 00941 00942 Uint32 sz = m_sendBuffer.m_dataSize; 00943 Uint32 packet_size = m_PacketSize; 00944 sz += ((lenBytes + 3) >> 2); 00945 m_sendBuffer.m_dataSize = sz; 00946 00947 if(sz > packet_size) { 00957 doSend(); 00958 } 00959 }
Here is the call graph for this function:

friend class TransporterRegistry [friend] |
sci_desc_t SCI_Transporter::activeSCIDescriptor [private] |
Uint32 SCI_Transporter::i1024 [private] |
For statistics on transfered packets
Definition at line 170 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::i10242048 [private] |
Definition at line 173 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::i2048 [private] |
Definition at line 171 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::i20484096 [private] |
Definition at line 174 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::i2049 [private] |
Definition at line 172 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), and SCI_Transporter().
Uint32 SCI_Transporter::i4096 [private] |
Definition at line 175 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::i4097 [private] |
Definition at line 176 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), doSend(), and SCI_Transporter().
Uint32 SCI_Transporter::m_ActiveAdapterId [private] |
Definition at line 212 of file SCI_Transporter.hpp.
Referenced by disconnectLocal(), doSend(), get_free_buffer(), initTransporter(), SCI_Transporter(), setDisconnect(), setupLocalSegment(), and setupRemoteSegment().
Uint32 SCI_Transporter::m_adapters [private] |
Definition at line 200 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), disconnectRemote(), doSend(), getConnectionStatus(), init_remote(), initLocalSegment(), initTransporter(), SCI_Transporter(), setConnected(), setDisconnect(), and setupRemoteSegment().
Uint32* SCI_Transporter::m_buffer [private] |
Definition at line 184 of file SCI_Transporter.hpp.
Uint32 SCI_Transporter::m_BufferSize [private] |
Definition at line 253 of file SCI_Transporter.hpp.
Referenced by init_remote(), initLocalSegment(), initTransporter(), SCI_Transporter(), setupLocalSegment(), and setupRemoteSegment().
Uint32 SCI_Transporter::m_dataSize [private] |
Definition at line 185 of file SCI_Transporter.hpp.
Uint32 SCI_Transporter::m_failCounter [private] |
Uint32 SCI_Transporter::m_forceSendLimit [private] |
Definition at line 187 of file SCI_Transporter.hpp.
bool SCI_Transporter::m_initLocal [private] |
Definition at line 161 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), init_local(), and SCI_Transporter().
Uint32 SCI_Transporter::m_LocalAdapterId [private] |
Definition at line 246 of file SCI_Transporter.hpp.
Uint16 SCI_Transporter::m_LocalSciNodeId [private] |
Definition at line 247 of file SCI_Transporter.hpp.
Uint16 SCI_Transporter::m_LocalSciNodeId1 [private] |
Definition at line 248 of file SCI_Transporter.hpp.
volatile Uint32* SCI_Transporter::m_localStatusFlag [private] |
Definition at line 179 of file SCI_Transporter.hpp.
Referenced by checkConnected(), getConnectionStatus(), setConnected(), and setupLocalSegment().
bool SCI_Transporter::m_mapped [private] |
Definition at line 160 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), init_remote(), and SCI_Transporter().
Uint32 SCI_Transporter::m_numberOfRemoteNodes [private] |
Uint32 SCI_Transporter::m_PacketSize [private] |
Definition at line 252 of file SCI_Transporter.hpp.
Referenced by initTransporter(), SCI_Transporter(), and updateWritePtr().
Uint16 SCI_Transporter::m_remoteNodes[2] [private] |
Definition at line 203 of file SCI_Transporter.hpp.
Referenced by init_remote(), and SCI_Transporter().
Uint16 SCI_Transporter::m_RemoteSciNodeId [private] |
Definition at line 249 of file SCI_Transporter.hpp.
Referenced by init_remote(), and SCI_Transporter().
Uint16 SCI_Transporter::m_RemoteSciNodeId1 [private] |
volatile Uint32* SCI_Transporter::m_remoteStatusFlag [private] |
Definition at line 180 of file SCI_Transporter.hpp.
Referenced by getConnectionStatus(), setConnected(), setDisconnect(), and setupRemoteSegment().
volatile Uint32* SCI_Transporter::m_remoteStatusFlag2 [private] |
Definition at line 181 of file SCI_Transporter.hpp.
Referenced by getConnectionStatus(), setConnected(), setDisconnect(), and setupRemoteSegment().
Uint32 SCI_Transporter::m_reportFreq [private] |
bool SCI_Transporter::m_sciinit [private] |
Definition at line 162 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), initLocalSegment(), and SCI_Transporter().
struct { ... } SCI_Transporter::m_sendBuffer [private] |
Referenced by disconnectImpl(), doSend(), getWritePtr(), hasDataToSend(), initTransporter(), SCI_Transporter(), setupRemoteSegment(), updateWritePtr(), and ~SCI_Transporter().
Uint32 SCI_Transporter::m_sendBufferSize [private] |
Definition at line 186 of file SCI_Transporter.hpp.
sci_sequence_status_t SCI_Transporter::m_SequenceStatus [private] |
sourceSegm* SCI_Transporter::m_SourceSegm [private] |
Definition at line 243 of file SCI_Transporter.hpp.
Referenced by disconnectLocal(), initLocalSegment(), SCI_Transporter(), and setupLocalSegment().
Uint32 SCI_Transporter::m_StandbyAdapterId [private] |
Definition at line 213 of file SCI_Transporter.hpp.
Referenced by doSend(), failoverShmWriter(), initTransporter(), SCI_Transporter(), setDisconnect(), and setupRemoteSegment().
Uint32 SCI_Transporter::m_swapCounter [private] |
targetSegm* SCI_Transporter::m_TargetSegm [private] |
Definition at line 244 of file SCI_Transporter.hpp.
Referenced by createSequence(), disconnectRemote(), doSend(), failoverShmWriter(), get_free_buffer(), init_remote(), SCI_Transporter(), setupRemoteSegment(), and startSequence().
SHM_Reader* SCI_Transporter::reader [private] |
Definition at line 190 of file SCI_Transporter.hpp.
Referenced by getReceivePtr(), hasDataToRead(), setupLocalSegment(), and updateReceivePtr().
SciAdapter* SCI_Transporter::sciAdapters [private] |
Definition at line 211 of file SCI_Transporter.hpp.
Referenced by disconnectImpl(), init_remote(), initLocalSegment(), and SCI_Transporter().
SHM_Writer* SCI_Transporter::writer [private] |
Definition at line 191 of file SCI_Transporter.hpp.
Referenced by doSend(), failoverShmWriter(), get_free_buffer(), and setupRemoteSegment().
SHM_Writer* SCI_Transporter::writer2 [private] |
1.4.7

