industrialNETworXnetx

pwhiteis

pwhiteis

NRAO

| 31.08.2010 | 17:58 | 1 reply

Slow Access times to cifx50re card

Hello,

 

   We are currently using your cifx50re PCI cards in a Linux workstation as EtherCAT Master nodes.  We have fairly tight timing requirements: we need to initiate cyclical data exchange with 16 slaves every 1mSec.  We've discovered that the time spent copying data from the cifX50re card (via IORead) is much longer than expected. Its taking us over 720uSec to copy back 768 Bytes of data.  We've determined that the bottleneck is the OS_Memcpy operation in the IORead call.  

This is an effective transfer rate 8 MBit / Sec.  I find it odd that the PCI data copy operation is far slower than the 100 MBit/Sec advertised for EtherCAT.  Is there any way to improve this?  

 

Thanks,

 

-Pete-

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 21.09.2010 | 12:51

Hi Pete,

I have an idea. Maybe the function OS_Memcpy is the bottle neck.
The function copies all data's in a for(;;) loop.

/*****************************************************************************/
/*! Memcopy wrapper
* \param pvDest Destination pointer
* \param pvSrc Source pointer
* \param ulSize Size to copy */
/*****************************************************************************/
void OS_Memcpy(void* pvDest, void* pvSrc, uint32_t ulSize) {
unsigned int i = 0;
#ifdef VERBOSE
/* printf("%s() called\n", __FUNCTION__); */
#endif
/* TODO: Check why memcpy does not work on odd length
memcpy(pvDest, pvSrc, ulSize); */
for(; i < ulSize; i++)
*((uint8_t*)(pvDest + i)) = *((uint8_t*)(pvSrc + i));

}

This loop was used, because there where problems during the copy procedure of memory areas which are not WORDor DWORD aligned.
If those "none aligned" memory areas are copied does the "standard" memcpy() function not take care about and the result are WORD or DWORD accesses to unequal addresses. The result would be that parts of the data's are not copied.
maybe it will help to check the pointers and in case of WORD or DWORD alignments of the memory areas to use the memcpy() function and to use for the other accesses a for(;;) loop.

Regards
AJ

Login