• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Multicore DSP » Keystone Multicore Forum (C66, 66A, AM5) » PA LLD next failure route question
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 1 day ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 2 days ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...
    • $core_v2_blog.Current.Name

      It’s our second anniversary, but you get the present!

      Posted 9 days ago
      by Lindsey Bare
      It’s hard to believe it’s already been two years...

    Forums

    PA LLD next failure route question

    This question is answered
    Aamir Husain
    Posted by Aamir Husain
    on Apr 12 2012 18:03 PM
    Expert2350 points

    Eric,

    I am trying to make a change to my design to be able to do the steps described below but am running into problems. The example below is on a single core but of course I intend to extend the idea to multicore.

    For IPv4 and UDP packets, I want the PA after matching on MAC address and then IP address and protocol type and ip type matching to be directed to a regular LUT2 port # matching, if it fails then I want it to be directed to a custom LUT2 entry with a arange of UDP ports. So for example UDP port 0x8000 could be the port # I am trying to match on using the pa_addPort command and then if it fails then I want to setup in the pa_addIp to have the nextrtFail set to use custom LUT2 with a range of UDP ports. I am trying to do this so that I can have the PA differentiate between say port 0x8000 and ports 0x8001-0x80FF and can then have the PA tag them with different swInfo words and also possible remove the ethernet and other headers for those packets received on port 0x8000.

    Is what I am trying feasible? I cannot see any reason why it should not be the case but...

    When I tried setting up by using the pa_addIp command with routeInfo set to {DEST_CONTINUE_LUT2, no custom type} and ntFailInfo set to {DEST_CONTINUE_LUT2, custom LUT2 type and custom Index = 1), the PA LLD returned error -10 which is errconfig. Looking through the pa LLD code for pa_addIp it points to only two cases when this happens:

    1. if the ipInfo fields spi, greProto, sctpPort are non-zero which is not the case for my ipInfo structure.

    2. if the iptype is not IPV4 or IPv6 which is again not the case for me.

    Thanks, Aamir

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Aamir Husain
      Posted by Aamir Husain
      on May 11 2012 15:35 PM
      Expert2350 points

      Eric,

      Thanks for the suggestion. I will in the future ping you on an existing thread and point to the new post. The forum should have an ability to direct a new thread email to a particular person. Currently it talks of BCC to a friend. Anyways I will suggest this to the E2E organizers. Thanks.

      As for my issues:

      I have resolved issue 1, it was due to incorrect multicore etc legacy code. Basically when a desciptor is popped of the Tx free Q and its length field (word 3 in the descriptor) is modified to specify the actual length of the Tx packet sent to the PA, when it is freed back after use and pushed back to the Tx Free Q it does not reset the length field to be the same as word 6 of the descriptor which is should do. So when it makes use of that buffer descriptor again in the future in the setup my code (and also legacy TI code in a function such as Add_Port etc) it sets the cmdSize to be equal to the descriptor buffer length (which has not been reset) and so the pa_addCustomLUt2 fails as the length is no longer sufficient.

      I fixed this by resetting the word 3 field in the descriptor if the host receives a reply back from the PA prior to popping the descriptor into the variable pHostDesc i.e. Just after the "if Qmss)getQueueEntryCOunt (gPaCfgCmdRespQHand) > 0).

      As for issue 2 I am not sure if you mean that you think there is an issue with how TI is implementing the delete capability or how I am implementing the use of it? Basically there is nothing complicated about the actual packet vs received packet. I am sending a short UDP packet over Ethernet to the EVM. The PA is stripping of the Ethernet and IP headers and the DRC at the end and is keeping the UDP header 8 bytes (0x8000 0x8000 0x0012 0x0178 and the body 10 bytes (0x00010203040506070809). I can share my code with you offline or you can try removing UDP headers.

      Thanks, Aamir

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Eric Ruei
      Posted by Eric Ruei
      on May 11 2012 18:38 PM
      Intellectual1960 points

      Hi, Aamir:

      As for issue 2 I am not sure if you mean that you think there is an issue with how TI is implementing the delete capability or how I am implementing the use of it? Basically there is nothing complicated about the actual packet vs received packet. I am sending a short UDP packet over Ethernet to the EVM. The PA is stripping of the Ethernet and IP headers and the DRC at the end and is keeping the UDP header 8 bytes (0x8000 0x8000 0x0012 0x0178 and the body 10 bytes (0x00010203040506070809). I can share my code with you offline or you can try removing UDP headers.

      [Eric] I have verified the current implementation and believed that the commad shall remove the UDP header successfully. However, there is some issue how we handle the end of payload offset after deletion operation. Therefore, it will delete some extra bytes prior to CRC. If this is the observed behavior, I can send you the firmware patches since the offical fix will not be available in the near future.  If you may provide the memory dump of the descriptor and data buffer of the received packet, I should be able to see whether there are other problems.

      Best regards,

      Eric

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Aamir Husain
      Posted by Aamir Husain
      on May 14 2012 17:47 PM
      Expert2350 points

      Hi Eric,

      I am not observing any deletion of the UDP header so I am not seeing your behaviour.

      This is the memory dump (in words - descriptor is 64 bytes) starting at an example descriptor at 0xc0124c0

      0000002C 00000000 800002E1 00000100 0C001300 00000000 00000100 0C001300
      00000000 55550004 33334444 00000000 00000000 00000000 00000000 00000000

      This is the memory dump (in words only show the first 64 bytes) starting at an example buffer at 0xc001300

      00800080 2DB82600 03020100 07060504 11100908 15141312 19181716 23222120
      27262524 00002928 00000000 00000000 00000000 00000000 00000000 00000000

      Can you share with my an example code that shows your use of the CMD_PATCH_DATA with the delete option (PA_PATCH_OP_DELETE)

      Thanks, Aamir

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Aamir Husain
      Posted by Aamir Husain
      on May 14 2012 17:53 PM
      Expert2350 points

      Eric,

      Sorry I did a memory dump of the descriptor prior to updating some of the elements of the descriptor. It should have read as follows:

      0E000026 00000000 860002E1 00000026 0C001300 00000000 00000100 0C001300
      00000000 CCCCCCCC 00000000 00000000 B8400000 00260440 0E000000 81360102

      Thanks, Aamir

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Eric Ruei
      Posted by Eric Ruei
      on May 15 2012 08:02 AM
      Intellectual1960 points

      Hi, Aamir:

      Here is some sample code:

      static  paPatchInfo_t t5PatchCmd2 =
              {
                  pa_PATCH_OP_DELETE, /* ctrlBitfield */ 
                  8,                  /* nPatchBytes */
                  0,                  /* totalPatchSize */
                  0,                  /* offset */
                  NULL                /* Pointer to the patch data */
              };

      static paCmdInfo_t t5CmdSet2[] =
      {
          /* Command 0: Remove header */
          {
              pa_CMD_REMOVE_HEADER,
              {
                  {
                      0,                            /* ctrlBitfield */
                      0,                            /* dest */
                      0,                            /* pktType */
                      0,                            /* flowId */ 
                      0,                            /* queue */
                      0,                            /* swInfo0 */
                      0,                            /* swInfo1 */
                      0                             /* multiRouteIndex */ 
                  }
              }
          },
         
          /* Command 1: Delete Bytes */
          {
              pa_CMD_PATCH_DATA,
              {
                  {
                      0,                            /* ctrlBitfield */
                      0,                            /* dest */
                      0,                            /* pktType */
                      0,                            /* flowId */ 
                      0,                            /* queue */
                      0,                            /* swInfo0 */
                      0,                            /* swInfo1 */
                      0                             /* multiRouteIndex */ 
                  }
              }
          },
         
          /* Command 2: Remove Tail */
          {
              pa_CMD_REMOVE_TAIL,
              {
                  {
                      0,                            /* ctrlBitfield */
                      0,                            /* dest */
                      0,                            /* pktType */
                      0,                            /* flowId */ 
                      0,                            /* queue */
                      0,                            /* swInfo0 */
                      0,                            /* swInfo1 */
                      0                             /* multiRouteIndex */ 
                  }
              }
          }
         
      };

      static paCmdInfo_t t5CmdSetCmd2 =
          {
              pa_CMD_CMDSET,
              {
                  
                  {
                      T5_CMDSET_2_INDEX             /* Command set index */
                  }                  
              }   
          };

      ...

          t5CmdSet2[1].params.patch  = t5PatchCmd2;  
          t5CmdSetCmd2.params.cmdSet.index = T5_CMDSET_2_INDEX;

      Best regards,

      Eric

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Aamir Husain
      Posted by Aamir Husain
      on May 15 2012 13:54 PM
      Expert2350 points

      Eric,

      I think I am essentially doing the same thing although your example does not actually show how you are making use of the command set within the pa_addPort or pa_addCustomLUt2 etc. Can you confirm the steps that I am doing are correct and have outlined in a previous posting on this same thread? I will repeat them here again as I cannot understand why it does not work for me.

      I first configure the PA making use of the pa_configCmdSet function call with the following parameters:

      Pa_configCmdSet (gPaInstHand, index=0, nCmd=3, headerAndTailCmdSet, pHostDesc->bufPtr, &cmdSize, &cmdReplyInfo, &cmdDest)

      where headerAndTailCmdSet is an array of 3 commands similar to what you have in t5CmdSet2[] above except that I have replaced the innermost {} in the middle command in the array

              pa_CMD_PATCH_DATA,
              {
                  {
                      0,                            /* ctrlBitfield */
                      0,                            /* dest */
                      0,                            /* pktType */
                      0,                            /* flowId */ 
                      0,                            /* queue */
                      0,                            /* swInfo0 */
                      0,                            /* swInfo1 */
                      0                             /* multiRouteIndex */ 
                  }
              }

      with

               {

                 pa_PATCH_OP_DELETE, /* ctrlBitfield */ 
                  8,                  /* nPatchBytes */
                  0,                  /* totalPatchSize */
                  0,                  /* offset */
                  NULL                /* Pointer to the patch data */
              };

      The intent being that this is the command set to remove header, 8 bytes of remaining UDP header and tail. There are 3 commands as part of this set hence nCmds=3. The index of this command set is taken to be zero.

      Finally, when configuring the PA when using the pa_addCustomLUT2 function, need to configure the routeInfo.pCmd field within the routeInfo array in the  Pa_addCustomLUT2 call to make use of this command set index. This is done similar to what you have above by setting routeInfo.pCmd=t5CmdSetCmd2. This then implies that for this particular PA rule, process through the Cmdset 0 which includes remove headers, UDP headers and tail prior to sending to host.

      static paCmdInfo_t t5CmdSetCmd2 =
          {
              pa_CMD_CMDSET,
              {
                  
                  {
                      0             /* Command set index */
                  }                  
              }   
          };

      Aamir

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Eric Ruei
      Posted by Eric Ruei
      on May 15 2012 14:07 PM
      Intellectual1960 points

      Hi, Aamir:

      The initialization table does not seem to work since the command parameters paCmdInfo_t.params is an Union and there is no way the compiler will know which element should be used.

      You need to initialize the patch parameters with the following code as I pointed out at the previous response:

         t5CmdSet2[1].params.patch  = t5PatchCmd2;  
          t5CmdSetCmd2.params.cmdSet.index = T5_CMDSET_2_INDEX;

      Best regards,

      Eric

       

       

       

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Aamir Husain
      Posted by Aamir Husain
      on May 15 2012 15:05 PM
      Verified Answer
      Verified by Aamir Husain
      Expert2350 points

      Eric,

      Thanks!

      I had actually tried what you suggested with the red highlighted part prior to my earlier posting but did not realize it was kind of working as my packet was too small (10 bytes long) to realize what had happened. I tried it again and it does work except that in addition to removing the 8 byte header it also removes the 8 bytes from the end of the packet which you alluded to in an earlier post. Can you send me the patch for this problem. Thanks for your help.

      Aamir

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Eric Ruei
      Posted by Eric Ruei
      on May 15 2012 15:13 PM
      Intellectual1960 points

      1526.pam_bin.c

      Hi, Aamir:

      Please try the firmware patch attached.

      Best regards,

      Eric

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Aamir Husain
      Posted by Aamir Husain
      on May 15 2012 15:25 PM
      Expert2350 points

      Thanks, it works!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use