This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

questions about 6678 pa_emacexample



Hello!

when i use the pa_emacexample demo, I change lookback mode to the external mode,Code is as follows:

 Int32 Init_Cpsw (Void)

 {                                                              

 Uint8         myMACAddress [6] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15};   

  uint32_t  i;     uint8_t   backplaneMac[6] = {0x1, 0x1, 0x1, 0x1, 0x1, 0x1}; /* Mask for creating mac address by flipping LSB */   

  uint8_t   cppiMac [6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};  /* MAC address for (CPPI) Port 0 - we made it up*/

 /* we need to create a mac address for the Backplane Ethernet port   * using the Ethernet MAC Adress   */    

 for (i=0; i < 6; i++)

  {      

   backplaneMac[i] |= myMACAddress[i];    

 }  

Init_MAC (0, backplaneMac, RX_MTU);

 /* set the silver port to the stacks ethernet address */

 Init_MAC (1, myMACAddress, RX_MTU);

    /* Setup the Phys by initializing the MDIO - not needed for Simulator*/   

  Init_MDIO ();

    /* Setup the Ethernet switch finally. */   

  Init_Switch (RX_MTU);

    /* This is a little confusing but different APIs use different numbering */  

   Switch_update_addr(0, cppiMac, 0);   

  Switch_update_addr(1, backplaneMac, 0);   

  Switch_update_addr(2, myMACAddress, 0);

    /* CPSW subsystem setup done. Return success */    

 return 0;

 }

 When  PC sends data to the dsp,the program  can  be able to correctly receive data.

But the bandwidth of receiving can only achieve to 12MB/s If the PC sends data more faster,the DSP will begin dropping packets.

 My interrupt threshold is set to 1, the other has not changed.When using the NDK,speed ​​can reach 80MB / S around.

 Normally,directly use the MAC,speed is able to achieve line rate.

whats the reason causes the performance reduced so much?

  • Weifeng,

    In Setup_PASS(), did you change this? That is, you used the PA to classify the packets based on MAC/IP/UDP or you direct all packet to pa_DEST_HOST at the beginning? Let's say you send 10K packets from your PC to EVM at high rate > 12MB/s, the DSP dropped the packets. Do you see all the packets received at the switch but dropped inside DSP? Can you check at register 0x2090b00 if it matches the number you sent?

    Regards, Eric

  • Excuse me. I am now use pa_emacexample demo, too.But I'm a freshman.  I chang it into CPSW_LOOPBACK_NONE mode. It can catch the UDP packages by using software in PC. But I don't know how to receive and send back the packages by C&C++ program. Could you help me? Could you share your program with me. Thank you very much!

  • Colin,

    As you can catch the UDP packets in PC, I believe you already verified the Tx function of DSP. To verify the Rx function, we used the loopback mode. As you disable the loopback, you need some tool to generate packets towards your DSP card. If you want to loopback at PC, you need some program to act as a UDP server, there should be many code examples by searching Internet like "UDP server C example".

    Under ndk package, ndk_2_22_02_16\packages\ti\ndk\winapps, there are several tools that you can send packets out to an IP address (your DSP card), of course they are not loopback but your can also verify the EMAC Rx function.

    Regards, Eric

  • Iding,

    Thank you very much for your attention.I apologized for the late reply to you.
    According to your suggestion, I checked the register 0x2090b00,I found that the PC sent of the packets 
    and 0x2090b00 register value is the same.So, I know that lead to this result is because the reception very slow.
    Finally I found the reason is because the platform_write() function consumes too much time.
    When I commented out all the platform_wirte() function,Now the bandwidth can reach about 70MB/S.
    But the speed is also less than the NDK.
    I have two questions as follows:
    1、If i want to continue to enhance the bandwidth, but also other methods?
    2、In the SendPacket () function,I modified the Qmss_queuePush (gPaTxQHnd[8], pCppiDesc, dataBufferSize, SIZE_HOST_DESC, Qmss_Location_TAIL);
                                                                                 to the Qmss_queuePush (gPaTxQHnd[7], pCppiDesc, dataBufferSize, SIZE_HOST_DESC, Qmss_Location_TAIL);
          Finally,print"No Tx free descriptor. Cant run send/rcv test",
          What is the relationship between the gPaTxQHnd[8] and the gTxFreeQHnd?
    thank you!

  • Weifeng,

    The PA EMAC example is intended for demostrate the EMAC Tx/Rx functionaity, the PA HW can do the L2/L3/L4 classification, then it up to the user host code to handle the Rx queue. The NDK uses the its own stack for L3/L4 handling, this is pure software based and it is slower than PA HW by nature. You can't directly compare the Rx rate between NDK and PA emac example.

    The 648 Queue (gPaTxQHnd[8]) is used for switch. The 646/647 queue is for SA. You can't use 647 in this case.

    Regards, Eric