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: Checksum verification for PA_emac

Part Number: 66AK2E05


Hi !!

I have been working to establish how to implement checksum verification on ingress packets in the PA_emac ARM example.

i looked at multiple unit tests mainly the test-3 (from which i found how to implement checksum on egress) & test-5 to develop my own version for ingress but i wasn't able to silently discard packets with incorrect checksum.

below is my code that i was using (but failed) inside the setup_pass() function

int32_t PA_RXconfig (void)
{
    int32_t                       j;
    uint16_t                      cmdSize;
    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 */
                                                };
    paReturn_t         retVal;
    paEntryHandle_t    retHandle;
    int32_t              handleType, cmdDest;
    uint32_t           psCmd       =   ((uint32_t)(4 << 5) << 24);
    Cppi_HostDesc*     pHostDesc;
    paReturn_t *paret;

    paCmdInfo_t CmdSet_RX;

    /* Get a Tx free descriptor to send a command to the PA PDSP */
    if ((pHostDesc = Qmss_queuePop (gTxFreeQHnd)) == NULL)
    {
        UART_printf ("Error obtaining a Tx free descriptor \n");
        return -1;
    }

    /* The descriptor address returned from the hardware has the
     * descriptor size appended to the address in the last 4 bits.
     *
     * To get the true descriptor pointer, always mask off the last
     * 4 bits of the address.
     */
    pHostDesc = (Ptr) ((uint32_t) pHostDesc & 0xFFFFFFF0);

    VerifyPktErrCmd1.queue         = Qmss_getQIDFromHandle(gRxQHnd);
    VerifyPktErrCmd1.flowId        =   (uint8_t)Cppi_getFlowId(gRxFlowHnd);
    CmdSet_RX.params.verifyPktErr = VerifyPktErrCmd1;

    cmdSize                 =   pHostDesc->buffLen;

    *paret= Pa_configCmdSet (gPAInstHnd,
                                  2,
    					          1,
								  &CmdSet_RX,
								  (paCmd_t) pHostDesc->buffPtr,
								  &cmdSize,
								  &cmdReplyInfo,
								  &cmdDest);
    /* Set the buffer length to the size used. It will be restored when the descriptor
      * is returned
      */
     Cppi_setPacketLen (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, cmdSize);
     pHostDesc->buffLen  =   cmdSize;

     /* Mark the packet as a configuration packet */
     Cppi_setPSData (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, (uint8_t *)&psCmd, 4);

     /* Send the command to the PA and wait for the return */
     Qmss_queuePush (gPaTxQHnd[cmdDest],
                     (uint32_t *)Convert_CoreLocal2GlobalAddr((uint32_t)pHostDesc),
                     pHostDesc->buffLen,
                     SIZE_HOST_DESC,
                     Qmss_Location_TAIL
                    );

     return 0;
}

what might me the problem here? also is there a way that i can utilize the CPPI Error Flags to silently discard packets?

also i would like to know that is CRC verification done in the PA_EMAC example by default?

regards,

Hannan