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 issue with pa_PATCH_OP_DELETE command in pdk_c6678_1_1_2_5

Eric,

I have an issue with the use of this command. I had this issue earlier (thread included) and you had provided me with a fix whereby when removing UDP header by using the patch command with delete operation, I was also getting additional 8 bytes removed from the end of the packet.

http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/182191.aspx?pi168778=2

I have since updated my mcsdk to 2.1.2.5 which uses pdk 1_1_2_5 which in turn uses PA LLD 1.2.3.3. It seems like I am seeing the same problem happen again whereby at the end of my UDP packet, the last 8 bytes of payload are being removed prior to the checksum (which is removed by the tail command). From the release notes, it would appear that this was fixed in PA LLD 1.2.2.2 but I am not seeing this issue as being fixed. I did not want to use the version of the fix that you provided in case that is incompatible with pdk 1_1_2_5 as that is newer.

Aamir

  • Hi, Aamir:

    I have verified and confirmed that the fix is included at the PA LLD 1.2.3.3. I have also enhanced the unit test to cover this case and verified that it works. In the new test case, we remove 4 bytes after the UDP payload, and then 4 test bytes at the ned of packet.

    Input packet:

    static UInt8 natTPkt2[] = {
     0x00, 0x01, 0x02, 0x03, 0x04, 0xaa, 0x00, 0xe0,
     0xa6, 0x66, 0x57, 0x04, 0x08, 0x00, 0x45, 0x00,
     0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x05, 0x11,
     0x16, 0x78, 0x9e, 0xda, 0x6d, 0x0b, 0xc8, 0xc9,
     0xca, 0x64, 0x80, 0x00, 0x11, 0x94, 0x00, 0x4e,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
     0x00, 0x00, 0x6c, 0x6d, 0x01, 0xc0, 0x01, 0xfa,
     0xce, 0x00, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
     0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
     0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
     0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91,
     0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
     0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1,
     0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
      0xba, 0xbe, 0xfa, 0xce
    };

    Output packet:

    static UInt8 natTPkt2[] = {
     0x00, 0x01, 0x02, 0x03, 0x04, 0xaa, 0x00, 0xe0,
     0xa6, 0x66, 0x57, 0x04, 0x08, 0x00, 0x45, 0x00,
     0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x05, 0x11,
     0x16, 0x78, 0x9e, 0xda, 0x6d, 0x0b, 0xc8, 0xc9,
     0xca, 0x64, 0x80, 0x00, 0x11, 0x94, 0x00, 0x4e,
     0x00, 0x00, 0x01, 0x00,
     0x00, 0x00, 0x6c, 0x6d, 0x01, 0xc0, 0x01, 0xfa,
     0xce, 0x00, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
     0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
     0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
     0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91,
     0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
     0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1,
     0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9
    };

    Test command:

    static  paPatchInfo_t t5PatchCmd3 =
            {
                pa_PATCH_OP_DELETE, /* ctrlBitfield */ 
                4,                  /* nPatchBytes */
                0,                  /* totalPatchSize */
                0,                  /* offset */
                NULL                /* Pointer to the patch data */
            };
         
    static paCmdInfo_t t5CmdSet3[] =
    {
        /* Command: 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 */ 
                }
            }
        }
    };

    Attached please find out the updated test code as part of PA unit test:

    Did you change anything else in your application?

    Best regards,

    Eric

    2671.test5pkts.h1524.test5.c

  • Eric,

    The difference between your test case and my implementation is that I am removing the header first, but since it is custom LUT2, it removes the Ethernet and IP headers only leaving the UDP header. Then I am using the patch to remove the 8 byte UDP header.  I would suspect your test does not adequately capture this use case scenario and so I suspect that there is still a bug in the implementation that is resulting in removing the header and the last 8 bytes of the UDP payload.

    This was working for me when I was using the older mcsdk with the older PA LLD and your fix.

    Are you able to try something similar to my scenario.

  • Eric,

    Further to my last post, I tried the PATCH delete with a non-custom LUT2 so when I request removal of header, it removes the ethernet, IP and UDP header. I also request PATCH delete 8 bytes and it removes 8 bytes from the start of the UDP payload and then 8 bytes at the end of the UDP payload. I was also removing the tail in this case.

    When I try the same test, but without the removal of the tail, I see the PATCH only deletes the 8 bytes at the start of the UDP payload and not the 8 bytes at the end of the playload, so it definitely has something to do with the tail removing additional data.

    Aamir

  • Aamir:

    I can not reproduce the problem you reported at the latest pdk_C6678_1_1_2_6 which also uses PA LLD 1.2.3.3. It works whether or not I add pa_CMD_REMOVE_HEADER command. I know the root cause of the original additional data deletion problem and how the fix works and I have verified the fix does exist at PA LLD 1.2.3.3.

    Is it possible that you can run the updated test code and see whether the problem occurs? You just need to set a breakpoint at function t5ReceiveNatTDataPkts().

      while ((hd = t5GetRxPkt (tf)) != NULL)  {
       
       /* Verify swInfo0 for packet match and packet ID number */
       Cppi_getSoftwareInfo (Cppi_DescType_HOST, (Cppi_Desc *)hd, (UInt8 **)&swInfo);
       
       if ((*swInfo & T5_CMD_SWINFO0_TYPE_MASK) != T5_CMD_SWINFO0_PKT_ID)  {
        System_printf ("%s (%s:%d): Found a packet in the receive packet queue but with incorrect swinfo0 Id: 0x%08x\n",
              tfName, __FILE__, __LINE__, *swInfo);
         testCommonRecycleLBDesc (tf, hd);
        return (-1);
       }
       
       chan = *swInfo & T5_CMD_SWINFO0_ID_MASK;
       <BP>         count++;
       if (chan <= T5_MAX_NAT_T_CHAN)
         actualPktCount[chan] += 1;

    Check the receiving packet at the packet descriptor hd when chan = 11.

    Best regards,

    Eric

     

     

  • Eric,

    Thanks for your assistance. I solved my issue - it was a bug on my side. I was able to get the unit test to work correctly and realised then that I was using the old PA code pam_bin.c from the pdk that came with the older mcsdk as we have all of the code as part of a makefile that builds our application so even though the makefile makes use of parts of the pdk library, the pam_bin.c file are seperately compiled with the pa mgmt code and we were using the older pam_bin.c file.

    Thanks, Aamir

  • Eric,

    Pinging you for your thoughts on a post about SRIo and PA interaction. Thanks, Aamir

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/271072/973135.aspx#973135