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.

NDK throughput

hi

i am trying to benchmark Ethernet reception on EVM6678 by using MCSDK 02_00_09_21 HUA demo example.

i am able to achieve only 66Mbps.

How can I improve my reception throughput.

Pratik jain

  • Pratik

     I am getting the experts to take a look. Can you power cycle the EVM between the tests and re-try. Also can you describe your test setup.

     

  •  

    hi varada

    i am benchmarking 6678evm ethrnet reception with following setup

    i have modified MCSDK example helloworld for receiving UDP packet and  I am send packet from my linux PC through a test program which is tested for 880Mbps across the PCs.

    When I try to increase the Transmission speed I start losing packet.

    Can you tell up to what speed this EVM is tested.

  • Hi Pratik,

     Our internal tests, which are hooked with test equipments show much higher t-put for UDP and TCP receive operations. We also tested with iperf utility.

     What is the size of the packets ?

     Can you be specific about which MCSDK example you modified for checking the RX speed?

     

  • Pratik,

    One more thing. If you still see slow receive speeds, can you check the statistics registerd of the EMAC, to look for clues as to what is happening. What priority is your task running at ?

  • Hi varada

     There was boot mode switch issue in EVM initially( I was not running in no boot mode)

    Now I have tested it for UDP throughput of  560M for Rx for 1500bytes payload .

    But my requirement is about 800mbps can you tell me how I can improve it.

    I have modified MCSDK HAU demo for UDP test.

    Can you shear you results and test setup it will be helpful.

    Pratik jain

  • Pratik,

    Good to know that with corrected boot-pin settings, now can see higher t-put on your setup

    We too are seeing about similar results from initial tests.

    The benchmarking team suggest you to run Network Loopback test to obtain throughput number, if you have access to a network traffic generator. IPERF is free software.

    The source they used is at  \..\mcsdk_nn_nn_nn_nn\demos\hua\src\benchmark\ndkloopback.c

    Keep us updated.

     

  • Another point Pratik, the latest MCSDK that you have uses ndk_2_21_00_32, which apparently used a -ms2 compiler option when building the libraries.  It is showing some degraded performance over past releases.  You can download the latest ndk_2_21_01_38 at: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/index.html

    This version has this corrected (as well as some other bug fixes) and should show better results if you recompile the HUA demo.

    Regards,

    Travis

  • hi

    Thanks

    i have tested for 760Mbps UDP Rx throughput for higher packet size of 4Kbyate was that expected ?

    But i am not able to receive fragmented packets and also not able to fragmentize packet while sending. Is any option in NDK for this?

    Now i am testing Multicast packet reception is any example provided for this test.

    Pratik jain

  • Hi Pratik,

     For re-assembly, can you check the settings of the following configurations part of _ipcfg strcuture on your setup.

    IpReasmMaxSize

    IpReasmMaxTime

     One other thing, if your system is running low on memory, check if this function is being called ExecLowResource()

    You can get more info, as per the document : SPRU524, the NDK API reference guide. http://www.ti.com/tool/ndktcpip

     

     

    Also NDK supports the multicast, here is some old discussion, from other users using NDK.

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/t/11370.aspx?pi24527=2

    What issue are you seeing ?

  • hi Varad

    Thanks now I am able to re assemble fragmented packets by increasing IpReasmMaxSize value to 16K.

     Now i am testing Multicast reception.  i have added the multicast address as given in suggested  link but i am still not able to receive multicast packets.

    i have added multicast address used following segment in my UDP reception code 

     

    mc_group.imr_multiaddr.s_addr = inet_addr(MulticastAddr);

    mc_group.imr_interface.s_addr = inet_addr(LocalIPAddr);

    setsockopt (sudp, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mc_group, sizeof(mc_group));

     

    With this I am able join multicast group and packets are also forwarded to EMV but reception Task is not receiving any packet.  

     Is any other configuration needed ?

    When I try for example codes / Document on multicast all of them where using IGMPJoinHostGroup( ) function

    But now NDK don’t support this function. So can you send me any example code or document which can tell me how to enable multicast.

    Pratik jain

  • Hello Pratik,

     While I am looking to see if there is any NDK specific setup for mcast recv, can you please check the Ethernet statistics registers to check if the hardware port received the packets. 

    The register of interest would be ‘RXMCASTFRAMES’

  • hi

    i have checked  'RXMCASTFRAMES' count  it  is  not increasing but Ethernet LDE indicate packet Reception.

                                                                                                                                            Pratik jain

  • Hi Pratik,

     

    We do not have any MCAST recv example. Did you mean that “  …..'RXMCASTFRAMES' count it is not increasing but Ethernet LED indicate packet Reception.

     

    I am wondering if the packet got dropped by the NetCP hardware. Can you tell me if the other statistics are incremented. That would give a clearer picture.

     

    Thanks

  • hi Varada

     I have check all EMAC register after Tx 100000 packets

    [C66xx_0] ------------------------------------------------
    [C66xx_0]   RxGoodFrames    :   6  
    [C66xx_0]   RxOctets        :   408  
    [C66xx_0]   RxBCastFrames   :   2  
    [C66xx_0]   RxMCastFrames   :   4  
    [C66xx_0]   RxCRCErrors     :   0  
    [C66xx_0]   RxAlignCodeErrors   :   0  
    [C66xx_0]   RxOversized     :   0  
    [C66xx_0]   RxJabber        :   0  
    [C66xx_0]   RxUndersized    :   0  
    [C66xx_0]   RxFragments     :   0  
    [C66xx_0]   RxSOFOverruns   :   0  
    [C66xx_0]   RxMOFOverruns   :   11  
    [C66xx_0]   RxDMAOverruns   :   0  
    [C66xx_0]   TxGoodFrames    :   100351  
    [C66xx_0]   TxOctets        :   151045694  
    [C66xx_0]   TxBCastFrames   :   168  
    [C66xx_0]   TxMCastFrames   :   100183  
    [C66xx_0]   TxDeferred      :   0  
    [C66xx_0]   TxCollision     :   0  
    [C66xx_0]   TxSingleColl    :   0
    [C66xx_0]   TxMultiColl     :   0  
    [C66xx_0]   TxExcessiveColl   :   0
    [C66xx_0]   TxLateColl      :   0  
    [C66xx_0]   TxUnderrun       :   0  
    [C66xx_0]   TxCarrierSLoss   :   0

       it seems that when i send packet form EVM  'RxMCastFrames' and 'RxGoodFrames ' count increase and when i receive then  'TxMCastFrames ' and 'TxGoodFrames' increases.

      this same behavior i see when i run MCSDK Demo codes.

     Pratik jain

  •  Pratik, 

    So RECV MCAST number is getting bumped.  It is highly unlikely that RX and TX statistics counts would be swapped, as other TX and RX statistics look inline. 

     Could you also check the NDK statistics.

    See snapshot below :

  • hi varada

     i have  checked udps values the count are not increasing for multicast reception.

    i run my code with a break point at ip.c file in function which receives IP packets but multicast packet are not reaching there.

    is the packets are getting filtered at IP layer ?

    Which function does the IP filtering?

    Is my multicast add is not getting register in IP layer?

    One more thing Igmp packet should be send periodically but IP_ADD_MEMBERSHIP send it only ones.

    pratik jain

  • pratik jain,

    What is the context that your code is running in that you are trying to receive multicast packets in?  What I mean is, are you running your Multicast code in a Task (created with NDK API TaskCreate() or SYS/BIOS Task_create()) or are you running an NDK Daemon?

    I helped a customer a while back who could only receive broadcast packets in a daemon created task.  I traced the problem of down to some filtering code and provided a fix for him for broadcast.  You can see the details on that here if you like:

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/439/p/122182/525392.aspx#525392

    I suspect the issue may be the same for multicast, but not sure.  If you can try receiving in a daemon created task and tell us what happens, this will help.

    Also, I came across this document.  I'm sorry that we didn't get this to you sooner, as it contains a multi cast example (albeit for a very old version of the NDK):

    http://www.ti.com/lit/an/spraai3/spraai3.pdf

    Steve

  • hi steven

     

    i am creating NDK Task and Setting up a socket by calling "socket" and using "setsockopt" and "bind" etc. This code is called from the "NetworkIPAddr ()".

    then in Task after seting the socket i add multicast addres

     

     group.imr_multiaddr.s_addr = inet_addr("230.1.50.210");

     group.imr_interface.s_addr = NA.IPAddr;

     

     int multicastOptResult = setsockopt (sudp , IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&group, sizeof(group));

     

    then wait for Packet receive in while loop but no packet receive in multicast but i am able to receive packets in unicast and broadcast packets.

    is any more setting needed for multicast?

    i checked document it ask for 'IGMPJoinHostGroup()' which in not supported in NDK 2.21 .

    i tried the multcastTest() example form ... \ti\ndk\example\tools\common\console\contest.c but that also show similar result.

    I will try with Demon task and check with your link

    Pratik jain

    .

  • hi steven

     i tried wtih  NDK Daemon Function but then i am not able to send igmp join function.

    i am using following tack for receving Multicast packets

    static void MulticastTest (void)
    {
        SOCKET           sudp1 = INVALID_SOCKET;
        //SOCKET           sudp2 = INVALID_SOCKET;
        struct sockaddr_in sin1;
        char             buffer[1000];
        int              reuse = 1;
        struct ip_mreq    group;
        fd_set          msockets;
        int             iterations = 0;
        int             cnt;
        CI_IPNET        NA;

        printf ("=== Executing Multicast Test on Interface 1 ===\n");

        /* Allocate the file environment for this task */
        fdOpenSession( TaskSelf() );

        // Create our UDP Multicast socket1

        sudp1 = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
        if( sudp1 == INVALID_SOCKET )
        {
            printf ("Error: Unable to create socket\n");
            return;
        }

        // Create our UDP Multicast socket1
     //   sudp2 = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
     //   if( sudp2 == INVALID_SOCKET )
        {
     //       printf ("Error: Unable to create socket\n");
      //      return;
        }

        // Set Port = 4040, leaving IP address = Any
        bzero( &sin1, sizeof(struct sockaddr_in) );
        sin1.sin_family = AF_INET;
        sin1.sin_len    = sizeof( sin1 );
        sin1.sin_port   = htons(4040);

        /* Print the IP address information only if one is present. */
        if (CfgGetImmediate( 0, CFGTAG_IPNET, 1, 1, sizeof(NA), (UINT8 *)&NA) != sizeof(NA))
        {
            printf ("Error: Unable to get IP Address Information\n");
            fdClose (sudp1);
       //     fdClose (sudp2);
            return;
        }

        /* Set the Reuse Ports Socket Option for both the sockets.  */
        if (setsockopt(sudp1, SOL_SOCKET, SO_REUSEPORT, (char *)&reuse, sizeof(reuse)) < 0)
        {
            printf ("Error: Unable to set the reuse port socket option\n");
            fdClose (sudp1);
          //  fdClose (sudp2);
            return;
        }
        /* Reuse the ports; since multiple multicast clients will be executing. */
    //    if (setsockopt(sudp2, SOL_SOCKET, SO_REUSEPORT, (char *)&reuse, sizeof(reuse)) < 0)
        {
      //      printf ("Error: Unable to set the reuse port socket option\n");
      //      fdClose (sudp1);
          //  fdClose (sudp2);
            return;
        }

        /* Now bind both the sockets. */
        if (bind (sudp1, (PSA) &sin1, sizeof(sin1)) < 0)
        {
            printf ("Error: Unable to bind the socket.\n");
            fdClose (sudp1);
           // fdClose (sudp2);
            return;
        }
     /*   if (bind (sudp2, (PSA) &sin1, sizeof(sin1)) < 0)
        {
            printf ("Error: Unable to bind the socket.\n");
            fdClose (sudp1);
            fdClose (sudp2);
            return;
        }
    */
        /* Now we join the groups for socket1
         *  Group: 224.1.2.4
         *  Group: 224.1.2.5 */
        group.imr_multiaddr.s_addr = inet_addr("224.1.2.4");
        group.imr_interface.s_addr = NA.IPAddr;
        if (setsockopt (sudp1, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&group, sizeof(group)) < 0)
        {
            printf ("Error: Unable to join multicast group\n");
            fdClose (sudp1);
           // fdClose (sudp2);
            return;
        }
    /*    group.imr_multiaddr.s_addr = inet_addr("224.1.2.5");
        group.imr_interface.s_addr = NA.IPAddr;
        if (setsockopt (sudp1, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&group, sizeof(group)) < 0)
        {
            printf ("Error: Unable to join multicast group\n");
            fdClose (sudp1);
            fdClose (sudp2);
            return;
        }*/
        printf ("-----------------------------------------\n");
        printf ("Socket Identifier %d has joined the following:-\n", sudp1);
        printf (" - Group 224.1.2.4\n");
       // printf (" - Group 224.1.2.5\n");
        printf ("-----------------------------------------\n");

        /* Now we join the groups for socket2
         *  Group: 224.1.2.5
         *  Group: 224.1.2.6 */
        /*group.imr_multiaddr.s_addr = inet_addr("224.1.2.5");
        group.imr_interface.s_addr = NA.IPAddr;
        if (setsockopt (sudp2, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&group, sizeof(group)) < 0)
        {
            printf ("Error: Unable to join multicast group\n");
            fdClose (sudp1);
            fdClose (sudp2);
            return;
        }
        group.imr_multiaddr.s_addr = inet_addr("224.1.2.6");
        group.imr_interface.s_addr = NA.IPAddr;
        if (setsockopt (sudp2, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&group, sizeof(group)) < 0)
        {
            printf ("Error: Unable to join multicast group\n");
            fdClose (sudp1);
            fdClose (sudp2);
            return;
        }
        printf ("-----------------------------------------\n");
        printf ("Socket Identifier %d has joined the following:-\n", sudp2);
        printf (" - Group 224.1.2.5\n");
        printf (" - Group 224.1.2.6\n");
        printf ("-----------------------------------------\n");*/

        while (iterations < 4)
        {
            /* Initialize the FD Set. */
            FD_ZERO(&msockets);
            FD_SET(sudp1, &msockets);
            //FD_SET(sudp2, &msockets);

            /* Wait for the multicast packets to arrive. */
         //   cnt = fdSelect( (int)sudp2, &msockets, 0, 0 , 0);

            if(FD_ISSET(sudp1, &msockets))
            {
                cnt = (int)recv (sudp1, (void *)&buffer, sizeof(buffer), 0);
                if( cnt >= 0 )
                    printf ("Socket Identifier %d received %d bytes of multicast data\n", sudp1, cnt);
                else
                    printf ("Error: Unable to receive data\n");

                /* Increment the iterations. */
                iterations++;
            }
           /* if(FD_ISSET(sudp2, &msockets))
            {
                cnt = (int)recv (sudp2, (void *)&buffer, sizeof(buffer), 0);
                if( cnt >= 0 )
                    printf ("Socket Identifier %d received %d bytes of multicast data\n", sudp2, cnt);
                else
                    printf ("Error: Unable to receive data\n");

                /* Increment the iterations.
                iterations++;
            }*/
        }

        /* Once the packet has been received. Leave the Multicast group! */
    /*    if (setsockopt (sudp2, IPPROTO_IP, IP_DROP_MEMBERSHIP, (void *)&group, sizeof(group)) < 0)
        {
            printf ("Error: Unable to leave multicast group\n");
            fdClose (sudp1);
            fdClose (sudp2);
            return;
        }
    */
        /* Leave only one of the multicast groups through the proper API. */
        NtIPN2Str (group.imr_multiaddr.s_addr, &buffer[0]);
        printf ("Leaving group %s through IP_DROP_MEMBERSHIP\n", buffer);

        /* Once we get out of the loop close socket2; this should internally leave all the groups. */
        fdClose (sudp1);
      //  fdClose (sudp2);
        printf("== End Multicast Test ==\n\n");


        fdCloseSession( TaskSelf() );
           TaskExit();
    }

    i am testing TMDXEVM6678LE  kit and using  NDK_2_20_06_35 , pdk_C6678_1_0_0_20 ,mcsdk_2_00_08_20 version. can u tell what is worng in this.

    i am able to receive multicat and broadcast packets but not muticast.

    Pratik jain



  • Pratik,

    I hope multicast issue is resolved by now. If not, I had a few Qs

    1. Can you provide dump of both sets of statistics (STATSA and STATSB).
    2. How is the ALE setup ? Can you confirm that Mcast TX packets are coming out of the device.
    3. If only Mcast RX not happening, then can you try after putting ALE in bypass.

    Expert suggests : 

    "All ports must have their ALE Port Control State set to forwarding for multicast packets to be forwarded."

    Thanks

  • hi varada

    still i am not able to enable multicast.

    i can confirm that muticast packets are forwarded by switch. 

    can u please explain me how to setup or check ALE ?

    pratik jain

  • Hi Pratik,

    Base of ALE is at offset ‘0x02090E00’ in the NetCP’s gigabit ethernet switch subsystem.

     http://www.ti.com/lit/ug/sprugv9b/sprugv9b.pdf

     Can you try these settings.

                ALE_PORTCTL0            = 0x00000003;                           // Configure Port0 in Forwarding mode

                ALE_PORTCTL1            = 0x00000003;                           // Configure Port1 in Forwarding mode

                ALE_PORTCTL2            = 0x00000003;                           // Configure Port2 in Forwarding mode

                 ALE_CONTROL             = 0xC0000000;                          // Clearing ALE table for Init and Enabling ALE

                -or-

                ALE_CONTROL             = 0xC0000010;                          // Clearing ALE table for Init and Enabling ALE, enable bypass

     

    There is also Multicast table entry in ALE. But we can first try the above settings.

    Hope this helps.

  • hi varada

    i tryde with above seting but still i am not able to receive multicast packet.

    pratik jain

  • Pratik,

    From your stats, it seems like the emac itself did not receive any MCAST packet. Are you sure you send multicast? The EMAC is the entry point of the device for ethernet packets. please make sure that you indeed sending the MCAST packets.

    Thanks,

    Arun.

  • hi Arun

    Thanks for looking at my problem

     i am using a linux application for sending multicast packets. i verify the reception by receive this packets through another Linux application and i am using a L3 maneged switch  there also i can observe that multicast packets are forwarded to TMS6678 port..

    and i have print of EMAC register

     I have check all EMAC register after Tx 100000 packets

    [C66xx_0] ------------------------------------------------
    [C66xx_0]   RxGoodFrames    :   6  
    [C66xx_0]   RxOctets        :   408  
    [C66xx_0]   RxBCastFrames   :   2  
    [C66xx_0]   RxMCastFrames   :   4  
    [C66xx_0]   RxCRCErrors     :   0  
    [C66xx_0]   RxAlignCodeErrors   :   0  
    [C66xx_0]   RxOversized     :   0  
    [C66xx_0]   RxJabber        :   0  
    [C66xx_0]   RxUndersized    :   0  
    [C66xx_0]   RxFragments     :   0  
    [C66xx_0]   RxSOFOverruns   :   0  
    [C66xx_0]   RxMOFOverruns   :   11  
    [C66xx_0]   RxDMAOverruns   :   0  
    [C66xx_0]   TxGoodFrames    :   100351  
    [C66xx_0]   TxOctets        :   151045694  
    [C66xx_0]   TxBCastFrames   :   168  
    [C66xx_0]   TxMCastFrames   :   100183  
    [C66xx_0]   TxDeferred      :   0  
    [C66xx_0]   TxCollision     :   0  
    [C66xx_0]   TxSingleColl    :   0
    [C66xx_0]   TxMultiColl     :   0  
    [C66xx_0]   TxExcessiveColl   :   0
    [C66xx_0]   TxLateColl      :   0  
    [C66xx_0]   TxUnderrun       :   0  
    [C66xx_0]   TxCarrierSLoss   :   0

       it seems that when i send packet form EVM  'RxMCastFrames' and 'RxGoodFrames ' count increase and when i receive then  'TxMCastFrames ' and 'TxGoodFrames' increases.

    can  you shear any standard code for testing multicast (Tx and Rx ).?

    Pratik jain

    .

  • Hi Pratik,

    I just went through this thread and noticed that i too am facing similar problem.

    In my case i m able to receive only 40% of the sent packet, and remaining packets are dropped.

    In network statics register it is observed that CRCError are getting bumped for few packets. But in the packet sent there is no CRC/FSC appended.

    Could you please suggest me on this.

    Regards,

    Pradeep

  • How is it now?