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.

Use Packet Accelerator(PA) for patching data and calculating checksum

Hi experts,

I'm trying to send udp data via the ethernet out of the DSP.

Until now I used the PA for calculating IP and UDP checksum, which works fine.

Now I tried to use the PA also for patching the udp-Payload to the header(ethernet,IP,UDP) which works fine seperated from the checksumcalculation.

The question is how to combine these two things (Pa_formatTxRoute and Pa_formatRoutePatch ) with the  or is there an other way to add the payload to the header?

Best regards

Frank

  • Hi experts,

    I saw that the patching allows only a maximum of 16 Bytes to patch, so this way would not be a useful solution.

    So do you have a suggestion how to handle a static header of 42 byte and a changing payload of 1476 bytes?

    regards

    Frank

  • Hi Frank.,

     I see that you're trying to do both checksum and patching specifically. When you want to patch the packet, in pa.c you call pa_formatRoutePatch(). When you want to use checksum you call pa_formatTxRoute. Both of these functions call another function named pa_formatTxCmd, that you can get access to. If you want to do both at the same time, you will need to call the pa_formatTxCmd function directly and give it the comands for doing both. Look at the format and it should be easy to understand.

    There is an example for doing on the PA LLD and the SA LLD as well. Check there to see if you can find it and understand it, and get back to me if you're unable to.  

    I hope this answers your question!

    Kat

     

  • Hi Kat,

    the problem is solved.

    My failure was to set two pa_CMD_NEXT_ROUTE commands.

    Now with the following setup it works fine:

    paCmdInfo_t  cmdInfo[4];

    uint8_t index = 0;   

    { /* calculate checksum */
            cmdInfo[index].cmd = pa_CMD_TX_CHECKSUM;
            cmdInfo[index].params.chksum = chk0;
            index++;
            cmdInfo[index].cmd = pa_CMD_TX_CHECKSUM;
            cmdInfo[index].params.chksum = chk1;
            index++;
        }
        { /* patch data */
            cmdInfo[index].cmd    = pa_CMD_NEXT_ROUTE;
            cmdInfo[index].params.route = route_b;
            index++;
            cmdInfo[index].cmd = pa_CMD_PATCH_DATA;
            cmdInfo[index].params.patch = patch;
            index++;
        }

    retval = Pa_formatTxCmd (
                                    index,
                                    cmdInfo,
                                    0,
                                    format_ps_data,
                                    format_ps_data_len);

    best regards Frank