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.

66AK2E05: pa_emac With SA's ipsec

Part Number: 66AK2E05

Hi !!

so i am trying to explore adding some SA functionality in the PA_emac example. i have looked at the multiple SA examples but they differ significantly from how the setup was done in the emac example.

I want to send a ipsec packet over the ethernet but i am confused at how i should integrate the SA examples with the PA_emac examples

i am using the pdk_k2e_4_0_2 for ARM on K2E device

any help would be appreciated !!

regards,

Hannan

  • Hi Hannan,

    I've notified the Ethernet experts. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Hi,

    There are SA unit test/examples under ti/drv/sa/SaUnitTest that demonstrates how to use PA and SA together.

    Regards, Eric
  • hello Eric !!

    thanks for your reply.

    Now i have already looked at the unit test and the basic Examples for the SA. The problem is that my code is almost similar to the PA_emacexample so i want to send 1 packet onto the wire that has the ipsec ESP payload attached. i was able to successfully initialize the SA as told in the unit test and the SPRUHZ1 (2.16/2.17) but i m unable to send the data onto the wire.

    my question is that what do i need to change after i initialize the SA in order to get the IPsec functionality.

    following is my code to send the packet

       Sa_PktInfo_t   pktInfo;
        Sa_PktDesc_t*  pPktDesc = &pktInfo.pktDesc;
    
        uint32_t       psInfo[10];
        uint16_t       psInfoSize;
        salldSimChannel_t  *pEspChan = &salldSimChn[0];
    
        paCmdNextRoute_t routeCmdEth = {
                                        #ifndef NSS_GEN2
                                        0,              /*  ctrlBitfield */
                                        #else
                                        pa_NEXT_ROUTE_RPT_TX_TIMESTAMP,
                                        #endif
                                        pa_DEST_EMAC,   /* Route - host       */
                                        0,              /* pktType don't care */
                                        0,              /* flow Id              */
                                        0,              /* Queue                */
                                        0x55550000,              /* SWInfo 0             */
                                        0,              /* SWInfo 1 */
                                        0               /* multiRouteIndex (not used) */
                                     };
    
        paRouteInfo_t  route =  {  pa_DEST_HOST,  /* Route - host         */
                                   0,             /* flow Id              */
                                   0,             /* Queue                */
                                   -1,            /* Multi route disabled */
                                   0x55550000,             /* SWInfo 0             */
                                   0,             /* SWInfo 1 */
                                   0,             /* customType : not used */
                                   0,             /* customIndex: not used */
                                   0,             /* pkyType: for SRIO only */
                                   NULL};         /* No commands */
    
    
        routeCmdEth.pktType_emacCtrl = psFlags;
        routeCmdEth.swInfo0 = pa_FORMAT_REPORT_TIMESTAMP_INFO(0x88, 0x5, (uint16_t)gTxCounter);
    
    
        Cppi_DescTag    tag;
        if ((pCppiDesc = Qmss_queuePop (gTxFreeQHnd)) == NULL)
        {
            UART_printf ("No Tx free descriptor. Cant run send/rcv test \n");
            return -1;
        }
    
        pCppiDesc = (Ptr) ((uint32_t) pCppiDesc & 0xFFFFFFF0);
    
        pPktDesc->size = sizeof (pktMatch);
        pPktDesc->segments[0] = (void *)pktMatch;
        pPktDesc->segUsedSizes[0] = pPktDesc->size;
        pPktDesc->payloadOffset = 14;       /* Pointer to IP header */
        pPktDesc->payloadLen = (pPktDesc->size - 14);
        pktInfo.validBitMap = 0;
    
        Sa_chanSendData(pEspChan->salldInst, &pktInfo, FALSE);
    
        dataBufferSize  =   sizeof (pktMatch);
        Cppi_setData (  Cppi_DescType_HOST,
                        (Cppi_Desc *) pCppiDesc,
                        (Ptr)pPktDesc->segments[0],
                        dataBufferSize
                     );
        Cppi_setPacketLen (Cppi_DescType_HOST, (Cppi_Desc *)pCppiDesc, dataBufferSize);
        Cppi_setSoftwareInfo (Cppi_DescType_HOST, (Cppi_Desc *)pCppiDesc, (uint8_t *)pktInfo.swInfo.swInfo);
    
        psInfo[0] = PASAHO_SINFO_FORMAT_CMD(pPktDesc->payloadOffset, pPktDesc->payloadLen);
    
         psInfoSize = sizeof(pasahoNextRoute_t);
     Pa_formatTxRoute (  NULL,                /* IPv4 header checksum */
                                     NULL,                /* No second checksum   */
                                     &routeCmdEth,              /* Internal routing     */
                                     (Ptr)&psInfo[2],     /* Command buffer       */
                                     &psInfoSize);        /* Command size         */
    
        Cppi_setPSData (Cppi_DescType_HOST, (Cppi_Desc *)pCppiDesc, (uint8_t *)psInfo, 8);
    
        Qmss_queuePush (gPaTxQHnd[18], pCppiDesc, dataBufferSize, SIZE_HOST_DESC, Qmss_Location_TAIL);
    

  • basically i want to know that how can i use the SA_basicexample to route the packet directly to ethernet
  • any update on this regard?