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 (C6678) loopback problem



Hello all,

On my custom board which is having C6678 device, trying to understand PA concept. [PDK: pdk_C6678_1_1_2_5]

As of now i tried to run PA_simpleExample in loopback mode,

i found these three settings are need to be done, [from this post :  https://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/205299/730658#pi316458=3]

1. Disable learning  [ i did "alePortControlCfg.noLearnModeEnable     =   1; " in function Switch_update_addr()]
2. Enable ALE bypass [

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

]
3. Specify psFlags at each egress packet. [ dont know where i have to set this]

My UDP packet is,(which is being transmitted from PC to DSP)

00 0E A6 66 57 04 10 11 12 13 14 15 08 00 45 00 00 6C 00 00 00 00 05 11 A5 97 9E DA 6D 0A 01 02 03 04 12 34 05 55 00 58 E1 AC 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. 

Con sole msg is,

function findPacket: Timeout waiting for data packet
--- PA STATS ---
C1 number of packets: 3
C1 number IPv4 packets: 0                                 im expecting some value here
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
C1 number failed table matched: 1                    what does it mean??   
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 IPv6 opts: 0
C1 number of Egress IP frags: 0
C1 number of silent discard: 1                              what does it mean??
C1 number of invalid control: 0
C1 number of invalid states: 0
C1 number of system fails: 0

C2 number of packets: 1
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

Modify number of command file: 0

Function findPacket failed.

Why im not getting packets in console message??

Dump file is also attached.

pls let me know where i did mistake. Kindly help me to resolve these issues...

thanks,

Gourav jain

  • Hi TI experts,

    Why you guys are not taking up this query ... waiting for your prompt reply..

    thanks,
    Gourav
  • Hi,
    Response may be delayed due to holidays in India. Thank you for your patience.
  • Hi Raja,

    Thanks for your reply..

    Im from bangalore India and here we dont have any holidays after new year...Pls assign this query to TI expert.  im waiting for it since long time. My another thread is also not answered still open.

    Looking for fast reply from your team members.

    Thanks,

    Gourav

  • Dear Gourav,

    Sorry for the delay in response due to Pongal holidays in Chennai.

    I haven't change anything, I'm getting the following log in CCS console.


    [C66xx_0] function findPacket: Correct packet found
    --- PA STATS ---
    C1 number of packets: 4
    C1 number IPv4 packets: 1
    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: 2
    C1 number failed table matched: 0
    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 IPv6 opts: 0
    C1 number of Egress IP frags: 0
    C1 number of silent discard: 0
    C1 number of invalid control: 0
    C1 number of invalid states: 0
    C1 number of system fails: 0

    C2 number of packets: 2
    C2 number of UDP packets: 1
    C2 number of TCP packets: 0
    C2 number of custom packets: 0
    C2 number of silent discard: 0
    C2 number of invalid control: 0

    Modify number of command file: 0

    Test Completed successfully

  • Hi Titus S. ,


    Thanks you so much for your prompt reply.
    Could you pls share your working code( full projects files) so i can compare in my setup.

    thanks,
    Gourav
  • Dear Gourav,
    I haven't not changed any code in my project, just I imported fresh project, rebuild and run.

    C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\exampleProjects\PA_simpleExample_exampleProject


    As of now i tried to run PA_simpleExample in loopback mode,

    i found these three settings are need to be done, [from this post : https://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/205299/730658#pi316458=3]

    You don't want to change any code for PA loopback mode, as name, its just do PA loopback (internal)
  • but what about this link,

    Did so many changes in my code so will be difficult to get it original code. pls share ur code.  In that code i think only one packet is being transmitted using send_packet(). but how your are getting here

    C1 number of packets: 4

     

    --

    gourav

  • Here, I have attached the complete source code not project.

    PA_example.zip

  • thanks for sharing code. let me run on my setup. I'll get back to you tomorrow.

    thanks a lot for your support.

    --
    gourav
  • Hi Titus S. ,

    Now this loopback code is working in my setup. I had to change some portion in Init_SGMII() since in my card DSP is connected to VSC7421 ethernet switch in SERDES to SERDES configuration.

    Some questions are still in my mind, need your help to understand..

    1) Do we need to configure Main and pass PLL here?? I have not seen any where PLL functions..
    2) Cant we go inside of the function Pa_formatStatsReply () ??
    3) Got the print like,


    C1 number of packets: 4 ,
    C1 number IPv4 packets: 1
    My interpretation is "L1 classify engine got 4 packets in which 1 is IPv4 "
    C2 number of packets: 2
    C2 number of UDP packets: 1

    My interpretation is " L2 classify engine got 2 packets in which i is UDP " pls correct me if i'm wrong.

    Now i need to implement Ping from DSP to PC and wanted to catch data on PA so that i can perform filtering over there.
    Could you pls suggest me should i continue with this project or any other projects are available which is close to my task. (found Pa_EmacExample similar to this project).

    4) How Pa_simpleExaple is different from Pa_EmacExample project??

    thanks,
    Gourav

  • Hi Titus S. ,

    Waiting for your reply...

    thanks,
    Gourav
  • Hey Titus S. ,

    again you disappeared....waiting for your quick reply...

    1 more question i want to add in above list :

    How to add multiple MAC address in PA??
    Lets say PA is keep getting packets from GBE switch. Is it possible to send some packets directly to host after L2, some packets from L3 and some packets from L4 engine?

    thanks,
    Gourav
  • Dear Gourav,

    Sorry for the delay in responding.

    1) Do we need to configure Main and pass PLL here?? I have not seen any where PLL functions..

    This packet accelerator example doesn't use DDR and assumed gel file would do the PLL initialization etc.,

    2) Cant we go inside of the function Pa_formatStatsReply () ??

    Yes, you can add prints in the following source file for "Pa_formatStatsReply" and rebuild the driver.

    C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\pa\src\pa.c

    Rebuild the PA driver:

    cd C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\pa

    gmake all


    3) Got the print like,

    C1 number of packets: 4 ,

    C1 number IPv4 packets: 1

    My interpretation is "L1 classify engine got 4 packets in which 1 is IPv4 "

    C2 number of packets: 2

    C2 number of UDP packets: 1

    My interpretation is " L2 classify engine got 2 packets in which i is UDP " pls correct me if i'm wrong.

    Now i need to implement Ping from DSP to PC and wanted to catch data on PA so that i can perform filtering over there.

    Could you pls suggest me should i continue with this project or any other projects are available which is close to my task. (found Pa_EmacExample similar to this project).

    Just try to run the same example multiple times and check you are getting the same result every time.

    4) How Pa_simpleExaple is different from Pa_EmacExample project??

    It both demonstrate the PA,QMSS,CPPI,EMAC with small difference.

    Please refer to the top of the C source files. ( cpsw_singlecore.c & paExample.c)

  • Hey Titus S. ,
      1 ) Yes im getting the same prints,

    3) Got the print like,

    C1 number of packets: 4 ,

    C1 number IPv4 packets: 1

    My interpretation is "L1 classify engine got 4 packets in which 1 is IPv4 "

    C2 number of packets: 2

    C2 number of UDP packets: 1

    My interpretation is " L2 classify engine got 2 packets in which i is UDP " pls correct me if i'm wrong.

     

     

    2 ) Now i need to implement Ping from DSP to PC and wanted to catch data on PA so that i can perform filtering over there.

    Could you pls suggest me should i continue with this project or any other projects are available which is close to my task. (found Pa_EmacExample similar to this project).

    Just try to run the same example multiple times and check you are getting the same result every time.



    3) How to add multiple MAC address in PA??
    Lets say PA is keep getting packets from GBE switch. Is it possible to send some packets directly to host after L2, some packets from L3 and some packets from L4 engine?

    thanks,
    Gourav

  • Hi Titus S.  ,

    I want to add 1more question in the above list. pls reply all 4.

    4) Is there any TI TCP/IP stack available?? If yes, how to add it with PA??

    thanks,

    Gourav

  • Hi Titus S. ,

    waiting for your reply...

    -

    gourav

  • I'm checking with PA experts and he is on vocation.
    I let you know once I have answers. Thanks for your patience.
  • hi Titus,

    Thanks for the updates...

    Actually my main 2 task

    1) Integration of TCP/IP stack with PA

    2) How to filter out packets from L2/L3/L4 and send to host

    have been stopped until you provide help from your end. So kindly try to get answers from your team AEAP.

    thanks,

    Gourav

  • Dear Gourav,
    Sure, I requested PA experts to support on this post, surely he will respond once he back to office and also I follow up with him.

    Thanks for your patience.

    To address the Q1, we have the answer in the following wiki.

    Either you can use the PA LLD or NDK stack, you can't use both. And you have to write your own stack if you want to integrate the PA with TCP/IP stack.

    processors.wiki.ti.com/.../NDK,_PA_Resource_Wiki_for_Keystone_Devices
  • The PA EMAC example doesn't support TCP/IP stack. If you need to do this, you can use NDK package, it has layer 3 and layer4 supports, while layer 2 (MAC) classification is done by underlying NIMU driver, which is essentially PA. Check \mcsdk_2_01_02_06\examples\ndk.

    Regards, Eric

  • hi Eric,

    1) Do you want to say that integration of PA and TCP/IP stack(TI) is not possible like Titus said in above post???

    2) How to add multiple MAC address in PA??

    In Add_MACAddress, cant we give more than one MAC address as a src mac??

    Int32 Add_MACAddress (Void)
    {
    Int32 j;
    UInt16 cmdSize;
    Qmss_Queue cmdReplyQInfo;
    paEthInfo_t ethInfo = { { 0x64, 0x31, 0x50, 0x90, 0x73, 0x47 }, /* Src mac = dont care */
    {0x20, 0x21, 0x22, 0x23, 0x25, 0x24 }, /* Dest mac */
    //{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
    0, /* vlan = dont care */
    0,//0x0800, /* ether type = IPv4 */
    0, /* MPLS tag = don't care */
    pa_EMAC_PORT_1 /* Input EMAC port */
    };



    paRouteInfo_t routeInfo = { pa_DEST_HOST, //pa_DEST_CONTINUE_PARSE_LUT1,/* Continue parsing */
    0, /* Flow Id = dont care */
    704, //0, /* queue 0= dont care */
    -1, //0 /* multi route = dont care */
    0xaaaaaaaa, //0 /* swinfo0 = dont care */
    0, /* SwInfo 1 is dont care */
    0, /* customType = pa_CUSTOM_TYPE_NONE */ \
    0, /* customIndex: not used */ \
    0, /* pkyType: for SRIO only */ \
    NULL /* No commands */
    };
    paRouteInfo_t nFailInfo = { pa_DEST_DISCARD, /* Toss the packet */
    0, /* Flow Id = dont care */
    0, /* queue = dont care */
    0, //-1, /* mutli route = dont care */
    0, /* swinfo0 = dont care */
    0, /* SwInfo 1 is dont care */
    0, /* customType = pa_CUSTOM_TYPE_NONE */ \
    0, /* customIndex: not used */ \
    0, /* pkyType: for SRIO only */ \
    NULL /* No commands */
    };
    paCmdReply_t cmdReplyInfo = { pa_DEST_HOST, /* Replies go to the host */
    0, /* User chosen ID to go to swinfo0 */
    0, /* Destination queue */
    0 /* Flow ID */
    };

    3) Lets say PA is keep getting packets from GBE switch. Is it possible to send some packets directly to host after L2, some packets from L3 and some packets from L4 engine?

    currently we can make only one path, Add_MACAddress--> Add_IPAddress-->Add_Port for all the ingress packets. Is there any option by which we can filter out some packets from  Add_MACAddress and directly send to host and some packets after Add_MACAddress--> Add_IPAddress to host??

    regards,

    Gourav