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.

ICMP on C66xx could not work

I want to implement Ping Protocol which include ARP and ICMP.  ARP works fine but ICMP has no response.  The board uses Network Coprocessor which has packet accelerator that contains 4 classification engine and 2 Modify Engine. Based on OSI mode each engine handle different layer.  By theory, since both UDP and ICMP are on Transport layer, if UDP works and define a similar rule for ICMP (without port since UDP require a port) should works as well.   I am using SPRUGS4A and SPRUGZ6 as my reference.  My question is in order for ICMP to happen, what are the requirements?  Is there a better reference document I can use?

  • Is this an NDK application? If so, which version of NDK are you using?

    Alan
  • I am new to CCS. I have been told the CCS is build on top of Eclipse Modeling Framework. I am not sure about NDK. Is there anywhere I can find out if I open CCS?
  • Can you share your CCS project? Is your application derived from an example? If so, which one?

    Which board are you developing with? Which SDK? Which version of CCS are you using?

    Alan

  • Sorry I could not.  However, I got more information from the software lead.  We are no using any NDK or SDK.  We are using PA LLD. 

    We added each of the table entry to LUT1.  For example, ARP, ICMP, UDP are the entries on the Look Up Table(LUT).  By theory, once protocol comes, software will see if this protocol match with the LUT table entry. If it does, then do something.  If not, just ignore it.  Since we have added ICMP entries, but it got ignored,  We suspect we may need to added ICMP into the LUT inside of the "Modify/Multiroute Engine".  So far, we only added entry to "Classified Engine".  We are using CCS v5.

    I see the ICMP coming from Wireshark, but somehow it disappeared inside CCS.

  • I've moved your thread to the device forum.

    Todd
  • Hi Yoyo Lee,
    Can you provide details on how did you add entries for ARP, ICMP entries using PA LLD? Did you go through any of the Pa examples/unit test for details? Also, note that there is an API guide (index.html) under ti\drv\pa\docs\doxygen\html\ folder. This is derived out of top level header interface file pa.h

    -Aravind
  • Hi Aravind,

                    When adding the entries for ARP or ICMP using PA LLD , we are based on the examples from

                     C:\TI\pdk_C6678_1_1_2_6\packages\ti\drv\pa\example\multicoreExample.

                    Below are the PA LLD API calls with parameter values in the order that our code is making them. We based these from example code provided in the
                    PA LLD package.

                   The goal is to add rules that route ARP and ICMP to an accumulator queue (704 in this instance). We know this queue is set up properly because we                  receive ARP just fine but no ICMP.

                   The other rules attempt to match and route UDP packets matching a particular port to a queue. This also works fine.

                  Is there something wrong with the configuration of these PA rules?

                 Thanks!

    // Match IP packets directed to our MAC address
    Pa_addMac(iHandle = 0xC002900,
              index   = -1,
              ethInfo = { src  = {0,0,0,0,0,0},
                          dst  = {0x20, 0xcd, 0x39, 0xXX, 0xXX, 0xXX},
                          vlan = 0,
                          ethertype = 0x0800,
                          mplsTag  = 0,
                          inport   = 0 },
              routeInfo = { dest = 4,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0xffffffff,
                            swInfo0     = 0xfadefade,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              nextRtFail = { dest = 3,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0x0,
                            swInfo0     = 0x0,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              handle   = 0x0C04CD08,   // storage location
              cmd      = 0x0C01CD00,   // storage location
              cmdSize  = { 1536 },     // value stored here is 1536
              reply    = { dest = 6,
                           replyId = 0x55550000,
                           queue   = 908,
                           flowId  = 0x0},
              cmdDest  = { 0 } );

    // Match UDP packets directed to our IP Address
    Pa_addIp(iHandle = 0x0C002900,
             lutInst = -1,
             ipInfo  = { src.ipv4 = { 0, 0, 0, 0 },
                         dst.ipv4 = { 0x0C, 0xA8, 0x01, 0XX },
                         spi      = 0,
                         flow     = 0,
                         ipType   = 4,
                         greProto = 0,
                         proto    = 0x11,
                         tos      = 0,
                         tosCare  = 0,
                         sctpPort = 0 },
             prevLink = 0x0C002A80, // Points to handle setup by Pa_addMac above
             routeInfo = { dest = 5,
                           flowId = 0,
                           queue  = 0,
                           mRouteIndex = 0,
                           swInfo0 = 0xfadefade,
                           swInfo1 = 0x0,
                           customType = 0,
                           customIndex = 0,
                           pktType_emacCtrl = 0,
                           pCmd = 0x0 },
              nextRtFail = { dest = 3,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0x0,
                            swInfo0     = 0x0,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
             retHandle = 0x0C04Cf04 = { 0x0C002E80 // stored on return },
             cmd       = 0x0C01D300,
             cmdSize   = { 1536 },
             reply     = { dest = 6, replyId = 0x55550001, queue = 908, flowId = 0},
             cmdDest   = 0x00817674 } );

    // Match broadcast ARP
    Pa_addMac(iHandle = 0xC002900,
              index   = -1,
              ethInfo = { src  = {0,0,0,0,0,0},
                          dst  = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
                          vlan = 0,
                          ethertype = 0x0806,
                          mplsTag  = 0,
                          inport   = 0 },
              routeInfo = { dest = 6,
                            flowId = 0x0,
                            queue  = 704,
                            mRouteIndex = 0xffffffff,
                            swInfo0     = 0xfadefade,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              nextRtFail = { dest = 3,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0x0,
                            swInfo0     = 0x0,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              handle   = 0x0C04CD00 = { 0x0C002AA0 // value stored on return },
              cmd      = 0x0C01D900,   // storage location
              cmdSize  = { 1536 },     // value stored here is 1536
              reply    = { dest = 6,
                           replyId = 0x55550000,
                           queue   = 908,
                           flowId  = 0x0},
              cmdDest  = { 144 } );

           
    // Match ARP directed at our MAC address
    Pa_addMac(iHandle = 0xC002900,
              index   = -1,
              ethInfo = { src  = {0,0,0,0,0,0},
                          dst  = {0x20, 0xcd, 0x39, 0xXX, 0xXX, 0xXX},
                          vlan = 0,
                          ethertype = 0x0806,
                          mplsTag  = 0,
                          inport   = 0 },
              routeInfo = { dest = 6,
                            flowId = 0x0,
                            queue  = 704,
                            mRouteIndex = 0xffffffff,
                            swInfo0     = 0xfadefade,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              nextRtFail = { dest = 3,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0x0,
                            swInfo0     = 0x0,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
              handle   = 0x0C04CD04 = { 0x0C002AC0 // value stored on return },
              cmd      = 0x0C01DF00,   // storage location
              cmdSize  = { 1536 },     // value stored here is 1536
              reply    = { dest = 6,
                           replyId = 0x55550000,
                           queue   = 908,
                           flowId  = 0x0},
              cmdDest  = { 0 } );

    // Match ICMP packets directed to our IP address
    Pa_addIp(iHandle = 0x0C002900,
             lutInst = -1,
             ipInfo  = { src.ipv4 = { 0, 0, 0, 0 },
                         dst.ipv4 = { 0x0C, 0xA8, 0x01, 0xXX },
                         spi      = 0,
                         flow     = 0,
                         ipType   = 4,
                         greProto = 0,
                         proto    = 0x01,  // ICMP
                         tos      = 0,
                         tosCare  = 0,
                         sctpPort = 0 },
             prevLink = 0x0C002A80, // Points to handle setup by very first Pa_addMac above
             routeInfo = { dest = 6,
                           flowId = 0,
                           queue  = 704,
                           mRouteIndex = 0,
                           swInfo0 = 0x76082711,
                           swInfo1 = 0x0,
                           customType = 0,
                           customIndex = 0,
                           pktType_emacCtrl = 0,
                           pCmd = 0x0 },
              nextRtFail = { dest = 3,
                            flowId = 0x0,
                            queue  = 0,
                            mRouteIndex = 0x0,
                            swInfo0     = 0x0,
                            swInfo1     = 0x0,
                            customType  = 0x0,
                            customIndex = 0x0,
                            pktType_emacCtrl = 0x0,
                            pCmd        = 0x0 },
             retHandle = 0x0C04Cf00 = { 0x0C002EC0 /*handle stored on return*/ },
             cmd       = 0x0C01E500,
             cmdSize   = { 1536 },
             reply     = { dest = 6, replyId = 0x55550001, queue = 908, flowId = 0},
             cmdDest   = 0x008175AC } );

    //Match UDP packet with dst port =
    Pa_addPort ( iHandle = 0x0C2900,
                 portSize = 0,
                 destPort = 52090,
          linkHandle = 0x0C002E80,
                 fReplace = 0,
                 divertQ = 0xffff,
                 routeInfo = {dest = 6, flowId = 0, queue = 926,
                              mRouteIndex = 0xffffffff,
                              swInfo0 = 0xfadefade,
                              swInfo1 = 0x0,
                              customType = 0x0,
                              customIndex = 0x0,
                              pktType_emacCtrl = 0x0,
                              pCmd = 0x0 }
                retHandle = 0xC04D100,
                cmd = 0x0C01F700,
                cmdSize = { 1536 },
                reply   = { dest = 6, replyId = 0x55550002, queue = 908,flowId=0},
                cmdDest = 0x008176E0 );

  • Hi Yoyo,

    I did not see any issue in your rule -

    You are doing correct on setting up the match route rules, for IP packets (type ICMP) you are routing to Host and for IP packets with UDP, you are continuing the LUT parse.

    There is a similar example in Pa Unit Test (test4) that sends the UDP and ICMP packets for the classification. Possibly you can refer to it.

    couple of things.

    1. Can you make sure if the add IP command and all other Pa commands went through fine ? There is a Pa_forwardResult() API in LLD which can interpret the command response. Please refer to Pa Unit test/examples for details and also you can refer to Pa.h for details on the API.

    2. If you are in a controlled environment, you can also dump the 20 32-bit word mail box registers (starting address 0x2000000) for every packet that is received. If you can send the dump for every packet you are receiving, it may help to debug. Please make sure to arrange the dump as below:

    0x2000000: v1 v2 v3 v4

                     : v5  v6 v7 v8

    ......           : ................v20

    where Vn is a 32 bit word.

    3. Instead of XX, XX, XX in your IP and MAC entries, can you provide the actual values?

    4. Can you dump the paCmd that is prepared for add IP for the ICMP?

    5. Can you also dump the response that you got back for this command?

    6. Please provide the MAC/IP header dump of the packet that you are interested in, which did not got to Host for ICMP payload.

    -Br,

    Aravind