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.

PA_SimpleExample (c6670) questions,

Hi All,

         PC based udp packet generator   <====Ethernet connection====> [c6670 EVM running PA_SimpleExample project].

I have a PC based udp packet generator which is generating UDP packets [the packet contents is/are SAME as provided in the PA_SimpleExample project]. Here are the steps i am following 

1.I have done few modifications for the Project to delay a bit more [kind of a large delay wait state] just before findPacket().

2. I commented the function sendPacket().

3. Following are my settings 

Int cpswLpbkMode = CPSW_LOOPBACK_NONE; //CPSW_LOOPBACK_PA;
Int cpswSimTest = 0;

4. My aim/objective is to generate a single UDP packet [which is same in contents as the packet in the PA_Simpleexample project] and to make the EVM running the project receive the packet.

5. i made the switch 2 of SW9 to be off [this if i understand makes static IP Configuration] to make it accept a STATIC IP address. Is this correct ?.

6. My laptop/PC is on static IP Configuration [Note this IP is local to IP configured on the evm board through Pa_addIp() ].

Finally, what i see is there is no packet being received on the evm board. As far as i have seen all my steps are complete/fullest, please let me know if i am missing anything.

c6670 EVM board is connected to pc/laptop through Ethernet straight cable.

software configuration: - 

ccsv5 : - .69

mcsdk : - .21

Thanks

RC Reddy

  • Hi, RC:

    Let's discuss what you want to do at first. I believe that you want to modify the PA_SimpleExample project to recerive some packets generated and sent by PC, right?
    - Have you configured PASS to receive such packet?
    - Have you configured the CPSW ALE table to receive such packet?
    - Can you show me the packet taht you intend to send and receive?
    - You can dump the CPSW statistics at address 0x2090b00 and 0x2090c00.

    Best regards,

    Eric

     

     


     

     

  • Hi Eric,

                 Many a Thanks for quick reply. Yes, my aim is to receive the udp packets generated by the pc.

    1. PASS configuration yes though setupPa().

    2. CPSW ALE Table. here my understanding is nill, i assume Init_Cpsw() will do the stuff.

    3. 

    10 11 12 13 14 15 00 0e a6 66 57 04 08 00 45 00
    00 6c 00 00 00 00 05 11 a5 97 9e da 6d 0a 01 02
    03 04 12 34 00 00 00 58 e1 98 32 33 34 35 36 37
    38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47
    48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57
    58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67
    68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77
    78 79 7a 7b 7c 7d 7e 7f 80 81

    4. I will get you the dump in immediate next post [little time from now].

    Thanks

    RC Reddy

  • Hi, Reddy:

    I am not sure which version of PDK that you are using. We do not program ALE table unless cpswSimTest is set at tle latest version of PDK.
    Besides, please provide dump before and after you send packets from PC. I will recommend you to confim that you are able to receive packet from EVM at first. Then you can write a PC program to swap the MAC address of the received packet and send it back to EVM.

    Best regards,

    Eric

     

     

     

  • Hi Eric,

             PDK version : -  pdk_C6670_1_0_0_21

             NDK version : - ndk_2_21_00_32

             CCSV5 : - .69 [Version: 5.2.0.00069]

             MCSDK : - .21 [mcsdk_2_00_09_21]

    I will be sending the dump now itself [few mintues from now].

    Thanks

    RC Reddy

  • Hi Eric,

                 I see the values from 0x2090b00 to 0x2090c00 [in memory brower] being zeros. I see the wireshark capture shows the packets being sent out [i mean atleast they are leaving the ethernet port of laptop/pc].

    1. In the example project, the destination ip is being set to 1.2.3.4 and i am setting my laptop ip to 1.2.3.3 [255.255.255.0]. let me know if i am incorrect here ?

    2. I am running this example on core0 [c6670] only.

    Thanks

    RC Reddy

  • Hi Eric,

                the other observation is,

    even in the normal mode [i mean in the example, with purely no changes], i see ZERO values in taht range of address 0x2090b00 to 0x2090c00 .

    1. i am looking at the values after putting breakpoint at 

      System_printf ("Test Completed successfully\n");

    let me know, there is any other appropriate places for the breakpoint.

    Thanks

    RC Reddy


  • Hi, Reddy:

    The simpleExample use internal PASS loopback by deafult. In other words, it does not send the packet out. You should run the same test by using emacExample.

    Best regards,

    Eric

     

     

  • Hi Eric,

               Please confirm the following in simple words

    1. The PA_simpleExample CANT do any ethernet packet communication with external world [laptop/pc].

    2. "In other words, it does not send the packet out" ==> W.R.T to what you told, probably i am not clear in explaining myself. I WANT PC/Laptop to send UDP packet to EVM board.

    PC[rj 45 connector]  ==udp sendpacket==> c6670 evm [rj45 connector]

    do you mean that the PA config does not allow you to send packet inside. can you please reason out why?

    Thanks

    RC Reddy

  • Hi, RC:

    1. The PA_simpleExample CANT do any ethernet packet communication with external world [laptop/pc].
    [Eric] The PA_simpleEXample does not send packet to the ethernet port (CPSW) by default. 
               Int cpswLpbkMode = CPSW_LOOPBACK_PA;

      /* Send the packet out the mac. It will loop back to PA if the mac/switch have been
       * configured properly */ 
      if(cpswLpbkMode == CPSW_LOOPBACK_PA)
        Qmss_queuePush (gvTxQ[0], hd, len4, CONFIG_SIZE_DESC, Qmss_Location_TAIL);
      else
        Qmss_queuePush (gvTxQ[8], hd, len4, CONFIG_SIZE_DESC, Qmss_Location_TAIL);

    You need to change the cpswLpbk_mode to other values.

    /* Define LoopBack modes */ 
    #define CPSW_LOOPBACK_NONE           0
    #define CPSW_LOOPBACK_INTERNAL       1
    #define CPSW_LOOPBACK_EXTERNAL       2
    #define CPSW_LOOPBACK_PA             3

    Which mode do you use to send and receive packet? Can you do the same CPSW dump before and after you run the test successfully?

    Best regards,

    Eric

     

     

     

     

  • Hi Eric,

              If you happen to read my first post [in this same thread], i have already mentioned the info

    3. Following are my settings 

    Int cpswLpbkMode = CPSW_LOOPBACK_NONE; //CPSW_LOOPBACK_PA;
    Int cpswSimTest = 0;

    i have put diagram and statement also to explain what i am trying to achieve. I assume this diagram itself tells i DONT want any loop back

    PC based udp packet generator   <====Ethernet connection====> [c6670 EVM running PA_SimpleExample project].

    My aim/objective is to generate a single UDP packet [which is same in contents as the packet in the PA_Simpleexample project] and to make the EVM running the project receive the packet.

    with above statements, i MEAN I DONT WANT ANY LOOPBACK, i WANT ONLY PC to EVM connection though ethernet cable.

    As i reiterate again, the CPSW dump before and after is all zeros 

    If you read my above two posts again, i did following experiments

    1. I did run the ccs project [here project means PA_SimpleExample project] on evm board c6670 as is [as is means i didnt modify anything in the code] and when i see dump at the address [you mentioned],its all zeros.

    2. I asked you in my earlier post, which is the appropriate place to view the dump and i told at what point i am viewing the dump.

    [i am looking at the values after putting breakpoint at 

      System_printf ("Test Completed successfully\n");] ]

    3. finally, whether i run the PA_Simpleexample in evm board c6670,i am not seeing any values in the address range you mentioned, kindly let me know is there any structure [structure means data structure] which i can view in the expressions windows for the cpsw  stats.

    4. Also let me reiterate again and again, i am running the project on c6670 evm board.

    Hi Eric,

                My kind request is to please go through my previous posts [in THIS same thread/chain] and please see if i am missing anything. 

    Thanks

    RC Reddy

  • HI Eric,

              after much debugging and going through all possible documents, i found that i am doing a simple silly mistake [too bad on my part, i accept it] and the mistake was i was using simulator based .ccxml [Though i was running on the c6670 board]. sorry for earlier incorrect cpsw stats, here are the new stats

    but my project is still not coming to successfull completion.

    Thanks

    RC Reddy

  • Hi, RC:

    We are geting there. Can you show me the rx and tx statistics of CPPI port (0x2090b00)? Please dump the following memory location in 32-bit format:
             0x2000000-0x200005f (24 32-bit words) after you forward the packet.

    Is it possible to use a private (controlled) network, so that we know what and how many packets are delivered to the EVM board.

    Best regards,

    Eric

     

  • Hi Eric,

                Thanks for your reply.

           w.r.t to you question [Is it possible to use a private (controlled) network, so that we know what and how many packets are delivered to the EVM board.]

    Yes, my network is private controlled, i mean i have pc/laptop connected to EVM [c6670] board through a straight cable [its a point to point connection].

    from udp packet generator, i sent 2 packets and here i am attaching the captures 

    =============output logs===============

    [C66xx_0] function findPacket: Timeout waiting for data packet
    [C66xx_0] --- PA STATS ---
    C1 number of packets: 6
    C1 number IPv4 packets: 0
    C1 number IPv6 packets: 0
    C1 number custom packets: 0
    C1 number SRIO packets: 0
    C1 number llc/snap fail: 0
    C1 number table matched: 0
    [C66xx_0] C1 number failed table matched: 3
    C1 number Ingress IP frags: 0
    C1 number IP depth overflow: 0
    C1 number vlan depth overflow: 0
    C1 number gre depth overflow: 0
    C1 number mpls packets: 0
    C1 number of parse fail: 0
    C1 number invalid [C66xx_0] IPv6 opts: 0
    C1 number of Egress IP frags: 0
    C1 number of silent discard: 3
    C1 number of invalid control: 0
    C1 number of invalid states: 0
    C1 number of system fails: 0

    [C66xx_0] C2 number of packets: 5
    C2 number of UDP packets: 0
    C2 number of TCP packets: 0
    C2 number of custom packets: 0
    C2 number of silent discard: 0
    C2 number of invalid control: 0

    [C66xx_0] Modify number of command file: 0

    [C66xx_0] Function findPacket failed

    =============================udp tool packet vals =====

    10 11 12 13 14 15 00 0e a6 66 57 04 08 00 45 00
    00 6c 00 00 01 00 05 11 a5 97 9e da 6d 0a 01 02
    03 04 12 34 00 00 00 58 e1 98 32 33 34 35 36 37
    38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47
    48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57
    58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67
    68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77
    78 79 7a 7b 7c 7d 7e 7f 80 81

    =================================================

    i have a doubt, the address 0x2090b00 belongs to [EMAC port 0 = SGMII_0 = switch port 1 = AMC backplane lines]

    i have a doubt, the address 0x2090c00 belongs to [EMAC port 1 = SGMII_1 = switch port 2 = RJ45 connector] ? please confirm/correct my understanding.

    Thanks

    RC Reddy

  • Also Eric,

                   one more information i wanted to provide. I have added udp port based classification custom rules [but if i understand, that are at Level 4, here what i see is Level 2 MAC itself is failing].

    The other part is udp port classification [256 ports per queue] works in loopback and it classifies 

    Port Range start          Port Range End          QueueNumber

       0x0000                         0x00FF                        904

       0x0100                         0x01FF                        905

       0x0200                         0x02FF                        906

       0x0300                         0x03FF                        907

    so the example works in loopback mode, so i assume the code which i added [w.r.t to ports based classification is not coming in the PC<=>EVM board connection based testing]. please let me know if i am doing anything incorrect.

    Thanks

    RC Reddy

  • Hi Eric,

               based on your suggestion, i made the changes as below

    //if(cpswLpbkMode != CPSW_LOOPBACK_NONE)
    CSL_CPSW_3GF_enableAleBypass();

    Now with above changes, i pumped in 10 packets [in which only 5 packets are correct and remaining 5 packets are incorrect, this is due to bug in packet generator tool :-( ], so based on that 5 packets will be custom packets which will reach the Rxqueue [host queue]  after all classification checks.

    ==============outputs=============

    [C66xx_0] function findPacket: Timeout waiting for data packet
    [C66xx_0] --- PA STATS ---
    C1 number of packets: 23
    C1 number IPv4 packets: 10
    C1 number IPv6 packets: 0
    C1 number custom packets: 0
    C1 number SRIO packets: 0
    C1 number llc/snap fail: 0
    C1 number table matched: [C66xx_0] 20
    C1 number failed table matched: 0
    C1 number Ingress IP frags: 5
    C1 number IP depth overflow: 0
    C1 number vlan depth overflow: 0
    C1 number gre depth overflow: 0
    C1 number mpls packets: 0
    C1 number of parse fail: 0
    C1 number inval[C66xx_0] id IPv6 opts: 0
    C1 number of Egress IP frags: 0
    C1 number of silent discard: 5
    C1 number of invalid control: 0
    C1 number of invalid states: 0
    C1 number of system fails: 0

    [C66xx_0] C2 number of packets: 10
    C2 number of UDP packets: 0
    C2 number of TCP packets: 0
    C2 number of custom packets: 5
    C2 number of silent discard: 0
    C2 number of invalid control: 0

    [C66xx_0] Modify number of command file: 0

    [C66xx_0] Function findPacket failed

    with the code changes above, the example works for 5 packets [which is inline with my expectations]. Thanks Eric and now i have to investigate why and how this ALEBypass condition affected my project.

    Thanks

    RC Reddy

  • Hi, RC:

    It is better to disable CPSW functionality at your use case since you just want to connect EMAC port 1 (CPSW port 2) to CPPI port  (CPSW port 0).
    - Disable ALE learning (optionally). Switch_update_addr(): alePortControlCfg.noLearnModeEnable = 1;
    - Enable ALE Bypass: Init_Switch(): CSL_CPSW_3GF_enableAleBypass();
    - Specify the output port number at all egress packets. emacExample/cppi_qmss_mgmt.c/SendPacket()
      char            psFlags = pa_EMAC_PORT_1;

        /* Force the packet to the specific EMAC port if loopback is enabled */
       Cppi_setPSFlags(Cppi_DescType_HOST, (Cppi_Desc *)pCppiDesc, psFlags);

    If you want to use CPSW as normal switch and you do not want to send any packet from EVM to PC at first, you need to add the desired MAC address into the ALE table. The CPSW does not deliver unicast packets from EMAC port 0/1 to CPPI port unless the destination MAC addess is at the ALE table.

    You can write a function similar to Switch_update_addr ()

    int Switch_update_addr (Uint32 portNum, UInt8 macAddress[6], Uint16 add)
    {
        Uint32                              i;
        //CSL_CPSW_3GF_ALE_PORTCONTROL        alePortControlCfg;
        CSL_CPSW_3GF_ALE_UNICASTADDR_ENTRY  ucastAddrCfg;

    #if 0 // Do this only if the port is not enabled yet
        /* Configure the address in "Learning"/"Forward" state */
        alePortControlCfg.portState             =   ALE_PORTSTATE_FORWARD;
        alePortControlCfg.dropUntaggedEnable    =   0;
        alePortControlCfg.vidIngressCheckEnable =   0;
        alePortControlCfg.noLearnModeEnable     =   (cpswLpbkMode != CPSW_LOOPBACK_NONE)?1:0;
        alePortControlCfg.mcastLimit            =   0;
        alePortControlCfg.bcastLimit            =   0;

        CSL_CPSW_3GF_setAlePortControlReg (portNum, &alePortControlCfg);
    #endif

        
        /*
         * The following code is required for device simulator only.
         * It is also served as an example of adding MAC address to the ALE table manually
         */
       // Remove the condition

    #if 0   

    if (cpswSimTest)
        {

    #endif
            /* Program the ALE with the MAC address.
            *
            * The ALE entries determine the switch port to which any
            * matching received packet must be forwarded to.
            */
            /* Get the next free ALE entry to program */
            for (i = 0; i < CSL_CPSW_3GF_NUMALE_ENTRIES; i++)
            {
                if (CSL_CPSW_3GF_getALEEntryType (i) == ALE_ENTRYTYPE_FREE)
                {
                    /* Found a free entry */
                    break;                   
                }
            }
            if (i == CSL_CPSW_3GF_NUMALE_ENTRIES)
            {
                /* No free ALE entry found. return error. */           
                return -1;           
            }
            else
            {
                /* Found a free ALE entry to program our MAC address */           
                memcpy (ucastAddrCfg.macAddress, macAddress, 6);    // Set the MAC address
                ucastAddrCfg.ucastType      =      ALE_UCASTTYPE_UCAST_NOAGE;   // Add a permanent unicast address entryALE_UCASTTYPE_UCAST_NOAGE.
                ucastAddrCfg.secureEnable   =      FALSE;  
                ucastAddrCfg.blockEnable    =      FALSE;  
                ucastAddrCfg.portNumber     =      portNum;   // Add the ALE entry for this port

                /* Setup the ALE entry for this port's MAC address */
                CSL_CPSW_3GF_setAleUnicastAddrEntry (i, &ucastAddrCfg);           
            }

    #if 0
        }

    #endif
        
        /* Done with upading address */
        return 0;
    }

    If we run the example with CPSW_LOOPBACK_NONE,  it will send the canned packet out through CPPI port and the source MAC address will be added into ALE table and the packet will be delivered to both EMAC port 0/1 since the switch has not learned its destination address. We will expect that the PC program which receives the packet to swap the source and destination MAC address and send the packet back. The packet will be delivered to the CPPI port because its destination MAC address will match the entry in the ALE table.

    EVM to PC:        0x10, 0x11, 0x12, 0x13, 0x14, 0x15,                      /* Dest MAC */
                                0x00, 0xe0, 0xa6, 0x66, 0x57, 0x04,                      /* Src MAC  */
                                0x08, 0x00,                                                                 /* Ethertype = IPv4 */

    ALE: port 0, address 0x00, 0xe0, 0xa6, 0x66, 0x57, 0x04

    PC to EVM:       0x00, 0xe0, 0xa6, 0x66, 0x57, 0x04,                       /* Dest MAC */
                               0x10, 0x11, 0x12, 0x13, 0x14, 0x15,                      /*  Src MAC */
                               0x08, 0x00,                                                                /* Ethertype = IPv4 */
    ALE: port 1 address   0x10, 0x11, 0x12, 0x13, 0x14, 0x15

    Where   PC MAC address 0x10, 0x11, 0x12, 0x13, 0x14, 0x15
                   EVM MAC address    0x00, 0xe0, 0xa6, 0x66, 0x57, 0x04

    Please note that you need to program the EVM MAC address into PASS. The same principal should be applied to IP address as well. Please refer to emacExample.

    If I have answered your question, please click "verify answer" buttom.

    Best regards,

    Eric


     

     

     

  • Hi Eric/All,

    [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA] is the assumption in this whole discussion.

    Please confirm my understanding on PA [after i went through your and other's Ti e2e posts]. I read your reply and trying to understand/dig/digest what you told in the post.

    Here is my understanding, please confirm

    1. [Host Port = CPPIPort= switch port 0]

    2. [EMAC port 0 = SGMII_0 = switch port 1 = AMC backplane lines]

    3. [EMAC port 1 = SGMII_1 = switch port 2 = RJ45 connector]

    ==================================================
    CASE SIMULATOR MODE [note: simulator mode means running on simulator.ccxml on PC/laptop [without c6670 board] or evm_board.ccxml on EVM C6670 board]

    i will use short form for switch port as SW

    Aim/objective : - To do loopback
    Packet --> SW0 --> SW 1/2 [Forward Path ]

    and then SW1/2 --> SW 0 [Return Path]

    assuming case of SW 0 to SW 1/2 [Forward Path]

    For simulator, the ALE Table has to be filled/populated/entered with parameters explicity,

    a)during that time, it is set to noLearningMode = 1

    b)ALETable has to be filled extensively.

    the above two steps are required only/extensively for Forward Path

    assuming case of SW 1/2 to SW 0 [Return Path]

    For simulator, ALEBypass has to be enabled

    c) CSL_CPSW_3GF_enableAleBypass : - Enabling this function packets CSL_CPSW_3GF_enableAleBypass, all packets reaching SW 1/2 are delivered to SW 0. So in essence, this function CSL_CPSW_3GF_enableAleBypass has EFFECT only in Return Path i.e.
    SW 1/2 to SW 0 only ?


    =======================================GOING DEEPER (PA_SimpleExample) [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA]======
    {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; /* MAC address for (CPPI) Port 0 */
    {0x10, 0x11, 0x12, 0x13, 0x14, 0x15}; /* MAC address for (EMAC1) Port 1 */
    {0x20, 0x21, 0x22, 0x23, 0x24, 0x25}; /* MAC address for (EMAC2) Port 2 */


    EMAC port 0 {0x10, 0x11, 0x12, 0x13, 0x14, 0x15} henceforth i will refer this port to AMC lines
    EMAC port 1 {0x10, 0x11, 0x12, 0x13, 0x14, 0x15} henceforth i will refer this port to RJ45 Connector


    if(cpswLpbkMode == CPSW_LOOPBACK_NONE)
    Switch_update_addr(0, macAddress0, 0);
    else
    Switch_update_addr(0, macAddress1, 0); //STEP X

    Switch_update_addr(1, macAddress1, 0); //STEP Y
    Switch_update_addr(2, macAddress2, 0); //STEP Z

    STEP X,Y,Z all are set in ALE_PORTSTATE_FORWARD, which means all packets entering this port to be forwarded to other CPSW ports [This statement i took from your Ti e2e post], can you please enumerate/explain more on this [which port is forwarding to which port]?

    Thanks
    RC Reddy

  • Hi Eric,

              For purpose of clarity on

    1. loopback mode.

    2. Non LoopBack mode [PC to evm] [through RJ 45] 

    3. Non LoopBack mode [evm to PC] [through RJ 45]

    4. Non LoopBack mode AMC to evm. [evm board x to evm board y] [from board x perspective].

    5. Non LoopBack mode evm to AMC [evm board y to evm board x]. [from board x perspective].

    6. General PA questions and understanding.

    i will be opening 5 different threads

    before that, i did read through and i have an understanding of each of the above five cases and will be discussing five cases. I want to setup all the five cases and make them work. I want to understand each case differently. In the above post of yours, there are two cases involved case 2 and 3, which i want to discuss independently each one. Will be posting all 5 cases within little time from now.

    Sorry for more posts, but i am getting confused between these configurations for simulator, loopback, non loopback, non simulator, learning, forwarding,bypass, non bypass, and other terminologies.

    Thanks

    RC Reddy

  • Dear RC:

    I am sorry that the paSimpleExample is little misleading.The paSimpleExample is designed to demonstrate how to configure and use the PASS without CPSW. That is why the default setting is CPSW_LOOPBACK_PA. Please refer to emacExample for CPSW related configuration and operation.

    In my opinion it is not normal to loopback packet through any switch. I do not think that you can loopback  packets  through a normal switch and it is not a useful application. The purpose of our example is to demonstrate the basic CPSW configuration and provide a standalone test case.

    I believe that you might over-complicate the matter and create unnecessary tasks. The key object is to understand how to configure the PASS abd CPSW to achieve your real use cases. The acual CPSW is the same as a normal switch with one exception that it does not broadcast the unicast packets from switch port 1/2 to the CPPI port. Therefore, we will need to program the EVM MAC address to the ALE table if we expect to receive packets prior to sending any packet out. I believe that it is just like the common practice to configure the EMAC receiver with device mac address.

    Unfortunately the CPSW simulator behaves a little different from the actual CPSW (IP).  We need to program the ALE table since the ALE learning is not working. I will not recommend our customers to spend too much time on simulator except at the early development when the silicon and EVM is not available.

    Best regards,

    Eric

     

     

     

     

  • [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA] is the assumption in this whole discussion.

    [Eric] The egress packet is sent to PASS without CPSW when cpswLpbkMode = CPSW_LOOPBACK_PA.

    Please confirm my understanding on PA [after i went through your and other's Ti e2e posts]. I read your reply and trying to understand/dig/digest what you told in the post.

    Here is my understanding, please confirm

    1. [Host Port = CPPIPort= switch port 0] Yes

    2. [EMAC port 0 = SGMII_0 = switch port 1 = AMC backplane lines] Yes. Note it is not available without the AMC chasis.

    3. [EMAC port 1 = SGMII_1 = switch port 2 = RJ45 connector] Yes

    ==================================================
    CASE SIMULATOR MODE [note: simulator mode means running on simulator.ccxml on PC/laptop [without c6670 board] or evm_board.ccxml on EVM C6670 board]

    [Eric] Not applicable to EVM board.

    i will use short form for switch port as SW

    Aim/objective : - To do loopback
    Packet --> SW0 --> SW 1/2 [Forward Path ]

    and then SW1/2 --> SW 0 [Return Path]

    Note: The loopback is provided outsite the switch through the PC NIC card or the SGMII connection at the simulator configuratiuon file. (refer to readme.txt)

    assuming case of SW 0 to SW 1/2 [Forward Path]

    For simulator, the ALE Table has to be filled/populated/entered with parameters explicity, Yes

    a)during that time, it is set to noLearningMode = 1 [It is applicable to both simulator and silicon, it is not good to learn the source MAC address when we send the same packet to the CPSW from two different ports.]

    b)ALETable has to be filled extensively.

    the above two steps are required only/extensively for Forward Path [No, it is for both.]

    assuming case of SW 1/2 to SW 0 [Return Path]

    For simulator, ALEBypass has to be enabled [It is applicable for both simulator and EVM.]

    c) CSL_CPSW_3GF_enableAleBypass : - Enabling this function packets CSL_CPSW_3GF_enableAleBypass, all packets reaching SW 1/2 are delivered to SW 0. So in essence, this function CSL_CPSW_3GF_enableAleBypass has EFFECT only in Return Path i.e.
    SW 1/2 to SW 0 only ? Yes.

    It is much simpler than you think.
    Recommended configuration for packet loopback test:
    - Disable ALE learning
    - Specify desired output  port number at psFlags of each egress traffic
    - Enable ALEByss

    It is optional to add MAC addesses into ALE table with recommended configuration.

    Recommended configuration for normal operation (non-loopback mode)
    - Program the ALE table of the EVM MAC addresses.

     

     

     




    =======================================GOING DEEPER (PA_SimpleExample) [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA]======
    {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; /* MAC address for (CPPI) Port 0 */
    {0x10, 0x11, 0x12, 0x13, 0x14, 0x15}; /* MAC address for (EMAC1) Port 1 */
    {0x20, 0x21, 0x22, 0x23, 0x24, 0x25}; /* MAC address for (EMAC2) Port 2 */


    EMAC port 0 {0x10, 0x11, 0x12, 0x13, 0x14, 0x15} henceforth i will refer this port to AMC lines
    EMAC port 1 {0x10, 0x11, 0x12, 0x13, 0x14, 0x15} henceforth i will refer this port to RJ45 Connector


    if(cpswLpbkMode == CPSW_LOOPBACK_NONE)
    Switch_update_addr(0, macAddress0, 0);
    else
    Switch_update_addr(0, macAddress1, 0); //STEP X

    Switch_update_addr(1, macAddress1, 0); //STEP Y
    Switch_update_addr(2, macAddress2, 0); //STEP Z

    STEP X,Y,Z all are set in ALE_PORTSTATE_FORWARD, which means all packets entering this port to be forwarded to other CPSW ports [This statement i took from your Ti e2e post], can you please enumerate/explain more on this [which port is forwarding to which port]?
    [Eric] It simply enables the port to forward incoming packets, the destination port is based on the destination MAC address.

    Thanks
    RC Reddy

  • Hi Eric,

               Sorry i am still not able to come out of these issues, Can you please explain in detail.

    ===========================================

    [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA] is the assumption in this whole discussion.

    [Eric] The egress packet is sent to PASS without CPSW when cpswLpbkMode = CPSW_LOOPBACK_PA.

    RCReddy: - Please see the image below, it says CPSW is involved, i AM NOT ABLE to understand in what way you are saying the CPSW is not being involved


    ===========================================

    b)ALETable has to be filled extensively.

    the above two steps are required only/extensively for Forward Path [No, it is for both.]

    RCReddy: - But in Return Path, its your bypass mode, which is helping right, how the two steps are helping. In the two steps you are NOT SETTING ANY MAC ADDRESS in the ALE Table 

    /*
    * The following code is required for device simulator only.
    * It is also served as an example of adding MAC address to the ALE table manually
    */

    if (cpswSimTest) // cpswSimTest == 0
    {

    }

    Also how is this code helping the ALE set the port and macaddress??

    assuming case of SW 1/2 to SW 0 [Return Path]

    For simulator, ALEBypass has to be enabled [It is applicable for both simulator and EVM.]

    ===========================================

    It is much simpler than you think.
    Recommended configuration for packet loopback test:
    - Disable ALE learning
    - Specify desired output  port number at psFlags of each egress traffic
    - Enable ALEByss

    It is optional to add MAC addesses into ALE table with recommended configuration.

    Recommended configuration for normal operation (non-loopback mode)
    - Program the ALE table of the EVM MAC addresses.

    RCReddy: - so when/what situation is the ALE learning enabled, in what cases?

    Can you take an example when you enable ALE Learning and when you disable ALE Learning. Also please explain in detail.

    ===========================================

    STEP X,Y,Z all are set in ALE_PORTSTATE_FORWARD, which means all packets entering this port to be forwarded to other CPSW ports [This statement i took from your Ti e2e post], can you please enumerate/explain more on this [which port is forwarding to which port]?
    [Eric] It simply enables the port to forward incoming packets, the destination port is based on the destination MAC address.

    when this code itself is disabled, how it will forward the packet to destination port as i understand we havent set any mac addres to a port in ALE Table

    if (cpswSimTest)
    {
    /* Program the ALE with the MAC address.
    *
    * The ALE entries determine the switch port to which any
    * matching received packet must be f

    }

    Thanks

    RC Reddy

  • Hi RC:

    Please note that all special (unusual) configurations are either for packet loopback mode or simulator.

    As I said, it is unusual and only valid for special test case

    Packet Loopback:
    1. Disable learning
    2. Enable ALE bypass
    3. Specify psFlags at each egress packet.

    If you do all above, you do not need to program ALE table manually.

    Only for simulator:
    LE entry manually.

    Receieve only: need to add local MAC to ALE table.

    Please tell me that all above do not cover your test case.
    Please refer to EMAC example for CPSW related operation.

     

     

     

     

    Hi Eric,

               Sorry i am still not able to come out of these issues, Can you please explain in detail.

    ===========================================

    [cpswSimTest=0,cpswLpbkMode = CPSW_LOOPBACK_PA] is the assumption in this whole discussion.

    [Eric] The egress packet is sent to PASS without CPSW when cpswLpbkMode = CPSW_LOOPBACK_PA.

      if(cpswLpbkMode == CPSW_LOOPBACK_PA) 
        Qmss_queuePush (gvTxQ[0], hd, len4, CONFIG_SIZE_DESC, Qmss_Location_TAIL); ==> The packet is sent to PASS PDSP0 (queue 640) directly
      else
        Qmss_queuePush (gvTxQ[8], hd, len4, CONFIG_SIZE_DESC, Qmss_Location_TAIL);

     

    RCReddy: - Please see the image below, it says CPSW is involved, i AM NOT ABLE to understand in what way you are saying the CPSW is not being involved


    ===========================================

    b)ALETable has to be filled extensively.

    the above two steps are required only/extensively for Forward Path [No, it is for both.]

    RCReddy: - But in Return Path, its your bypass mode, which is helping right, how the two steps are helping. In the two steps you are NOT SETTING ANY MAC ADDRESS in the ALE Table  [

    [Eric] I

    /*
    * The following code is required for device simulator only.
    * It is also served as an example of adding MAC address to the ALE table manually
    */

    if (cpswSimTest) // cpswSimTest == 0
    {

    }

    Also how is this code helping the ALE set the port and macaddress??

    ALEbypass is sufficient. I just give you the general principle..

     

    assuming case of SW 1/2 to SW 0 [Return Path]

    For simulator, ALEBypass has to be enabled [It is applicable for both simulator and EVM.]

    ===========================================

    It is much simpler than you think.
    Recommended configuration for packet loopback test: (Not normal operation)
    - Disable ALE learning
    - Specify desired output  port number at psFlags of each egress traffic
    - Enable ALEByss

    It is optional to add MAC addesses into ALE table with recommended configuration. (As I said, it is optional, i.e. not required)

    Recommended configuration for normal operation (non-loopback mode)
    - Program the ALE table of the EVM MAC addresses.

    RCReddy: - so when/what situation is the ALE learning enabled, in what cases? In all cases except the loopback case.

     

    Can you take an example when you enable ALE Learning and when you disable ALE Learning. Also please explain in detail.

     

    ===========================================

    STEP X,Y,Z all are set in ALE_PORTSTATE_FORWARD, which means all packets entering this port to be forwarded to other CPSW ports [This statement i took from your Ti e2e post], can you please enumerate/explain more on this [which port is forwarding to which port]?
    [Eric] It simply enables the port to forward incoming packets, the destination port is based on the destination MAC address.

    when this code itself is disabled, how it will forward the packet to destination port as i understand we havent set any mac addres to a port in ALE Table

    if (cpswSimTest)
    {
    /* Program the ALE with the MAC address.
    *
    * The ALE entries determine the switch port to which any
    * matching received packet must be f

    }

    Thanks

    RC Reddy

  • Hi Eric,

                Now i am getting little clarity on the points you told

    =============================================================

    Packet Loopback: 
    1. Disable learning

    [done in the code]
    2. Enable ALE bypass

    [done in the code]
    3. Specify psFlags at each egress packet.

    [Where is this being done ??]

    If you do all above, you do not need to program ALE table manually.

    Only for simulator:
    LE entry manually.

    when you said simulator, you mean this "Int cpswSimTest = 1;"

    Receive only: need to add local MAC to ALE table.

    Receive only means, Int cpswSimTest = 1; [Is this kind of filling the ALE Table apriori to make sure that the CPSW forwards the packets based on its destination address]

    Please tell me that all above do not cover your test case.
    Please refer to EMAC example for CPSW related operation.

    Eric, Here are my test cases which i need to build [I am NOT INTERESTED IN LOOPBACK], my main aim is to achieve the following and in the process i need to UNDERSTAND WHAT IS THAT IS NEEDED TO DO THE BELOW STUFF [points 1,2,3,4]

    1. Non LoopBack mode [PC to evm] [through RJ 45] 

    2. Non LoopBack mode [evm to PC] [through RJ 45]

    3. Non LoopBack mode AMC to evm. [evm board x to evm board y] [from board x perspective].

    4. Non LoopBack mode evm to AMC [evm board y to evm board x]. [from board x perspective].

    Thanks

    RC Reddy

  • Packet Loopback: 
    1. Disable learning

    [done in the code]
    2. Enable ALE bypass

    [done in the code]
    3. Specify psFlags at each egress packet.

    [Where is this being done ??]
    emacExample:cppi_qmss_mgmt.c:SendPacket().

    If you do all above, you do not need to program ALE table manually.

    Only for simulator:
    LE entry manually.

    when you said simulator, you mean this "Int cpswSimTest = 1;"
    Yes

     

    Receive only: need to add local MAC to ALE table.

    Receive only means, Int cpswSimTest = 1; [Is this kind of filling the ALE Table apriori to make sure that the CPSW forwards the packets based on its destination address] Yes, it is for the silicon as well.

    Please tell me that all above do not cover your test case.
    Please refer to EMAC example for CPSW related operation.

    Eric, Here are my test cases which i need to build [I am NOT INTERESTED IN LOOPBACK], my main aim is to achieve the following and in the process i need to UNDERSTAND WHAT IS THAT IS NEEDED TO DO THE BELOW STUFF [points 1,2,3,4]

    1. Non LoopBack mode [PC to evm] [through RJ 45] 
    [Eric] Just need to add EVM MAC address to the ALE table.

    2. Non LoopBack mode [evm to PC] [through RJ 45]
    [Eric] Nothing special. The packet will be broadcasted to both EVM ports.

    3. Non LoopBack mode AMC to evm. [evm board x to evm board y] [from board x perspective].
    [Eric] Just need to add EVM MAC address to the ALE table.

    4. Non LoopBack mode evm to AMC [evm board y to evm board x]. [from board x perspective].
    [Eric] Just need to add EVM MAC address to the ALE table.

    All suggestions assume that you plan to use CPSW as normal switch and both EMAC ports are used.
    If you just want to establish point-to-point connections, then just enable ALEBypass and use psFlags to specify the destination port (1: EMAC_PORT_0; 2: EMAC_PORT_1).

    Best regards,

    Eric

     

  • Hi Eric,

              Thanks for your reply. I was able to send packets from PC udp gen to evm c6670 without BYPASSING ALE and in return from evm to pc.

    Thanks

    RC Reddy