Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

AM6422: SDK11.2 ENET rx dma channel

Part Number: AM6422
Other Parts Discussed in Thread: SYSCONFIG

Hello,

    We are using SDK 11.2. In the configuration, the number of DMA transmit channels is set to 8. Due to the GPTP feature, we are using 2 transmit and 2 receive channels. Both transmit channel counts are set to 8, and both receive channel counts are set to 16. Now we would like to change receive channel 0 to 32 or more, but we get an error during initialization. The code enters 

LwipifEnetAppCb_getRxHandleInfo and fails in the for loop when allocating pPktInfo .

for (i = 0U; i < rxChInfo.maxNumRxPkts; i++)
{
    pPktInfo = EnetMem_allocEthPkt(&inArgs->cbArg,
                       ENETDMA_CACHELINE_ALIGNMENT,
                       ENET_ARRAYSIZE(scatterSegments),
                       scatterSegments);
    EnetAppUtils_assert(pPktInfo != NULL);
    ...
}
The assertion fails because EnetMem_allocEthPkt returns NULL. How should we modify the configuration? to enlarge the receive buffer pool? image.png
  • Hi,

    Can you share the sysconfig file of the application that you are having the issue? This will be helpful in understanding the complete configuration and identify the issue.

    Thanks and regards,
    Teja.

  • Hello,

        I will send you the configuration file we are using. We would like to increase the number of DMA receptions based on the current setup.6685.example.rar

  • Hi,

    Thank you for the input, I will check the config and update you shortly

    Regards,
    Teja.

  • Hi,

    I have observed that this sysconfig file doesn't have any native issues with the DMA configurations. I am interested to know how you are initialising the 2nd DMA channel and how you are allocating packets for it, since you are not doing it natively in the default application. If the packet allocation logic is not handled correctly in your application, then it will empty the packets from the pool, and will result in the error you are observing.

    Please share more details on the application so that I can understand your DMA initialization sequence.

    Regards,
    Teja.

  • Hello,

        We are using the gptp_lwip_cpsw example program. Based on the default configuration, after we increased the number of DMA_rx channels to 32, the mentioned message is printed after power-on and running. By tracing the program, we found that the function entered is the one shown in the figure below. For this number of RX channels, what is the maximum that can be set?

  • Hi,

    The application can have a maximum of 196 packets combined accross all Tx and Rx channels, and your application is well below the maximum. 

    The root cause is that the TSN stack is allocating the DMA packets from the same pool for both Tx and Rx. So, the Packet Pool Config should have additional large packet allocations to account for the Tx packet allocations, in this case, which is 8.

    So, increasing the large pool packet count from 40 to 48 will fix this issue.

    I will track this internally, and follow up with corresponding actions to capture this.

    Thanks and regards,
    Teja.

  • Hello,

        Okay, we currently want to increase it to the maximum. You mentioned 192, so can our receive be set to 128? We hope you can later provide us with the specific modification plan to meet our requirements. Thank you very much.

  • Hi,

    You can increase the packet count to 128 for the Rx channel, but it will start to give diminishing returns beyond 32 packets. The additional memory load and per packet processing time start to take more load compared gain from increased packet buffers.

    I would suggest starting at 32 buffers, and increasing the count as you see fit based on your tests.

    Thanks and regards,
    Teja.

  • Hello,

        Okay, we can start with 32 first. As long as the error that occurred during use does not appear at 32 and the program can run normally, that will be fine. How can we modify it for this?

  • Hi,

    In sysconfig-GUI tool, Navigate to ENET-CPSW module, and open Packet Pool Config section. In the fields visible under it, find the large pool packet count. The default application config should show it to be set as 40. Now, increase it to 48 to address this issue.

    Regards,
    Teja.

  • Hello,

        My current configuration is 48. With this value set to 48, an error occurs when I change the RX count to 32.

  • Hi,

    For the default config, the large pool packet count would be 40. In your case, If you are increasing to the number shared in the sysconfig shared earlier, you should increase it to 48 (24+16+8).

    If you are increasing the Rx Packet pool to 32, then you should increase Large pool Packet count to 56 (32+16+8).

    The 8 represents the packet count allocated to the PTP Tx channel. So, if you change it later, you have to update that accordingly

    Regards,
    Teja.

  • Hello,

        Currently, we can only change it to a maximum of 32. If it exceeds 32, the corresponding packet pool will fail at runtime even if it is modified.

  • Hi,

    Let me check this behaviour from my side as well

    Regards,
    Teja.

  • Hi,

    With Rx buffers set to 64 + 16, and Tx buffers set to 8+8, and the large pool packet count set to 88, I am able to get the application working without issues. Similarly with 128 buffers with packet count set as 152, given that corresponding Linker changes are also included to accommodate larger application requirements.

    Can you please check and make sure that there are no other changes in your baseline SDK?

    Thanks and regards,
    Teja.

  • Hello,

        Thank you very much for your reply. We set it up according to your method and it works fine. I think we underestimated the number of transmissions when setting the size, which resulted in insufficient resources.

  • Hi,

    If there are no further queries in this topic, can we close this ticket now? If yes, please select the response which helped you solve the issue.

    Thanks and regards,
    Teja.