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.

LiWP and RM48 ethernet receive path hangs due to failure in pbuf_alloc

Hi,

I am trying to use TI LwIP demo for FreeRTOS and I am seeing a broken receive path through the stack.

Issue only  occurs under periods of load where we are seeing many broadcasts or trying to do some TCP.

Pbuf_alloc in receive path of the interrupt fails (hdkif_rx_handler) and at some point leads to the rxch->active_head being set to NULL. And due to the fact the processing loop checking the receive buffers does not check for a curr_bd of NULL this leads to treating the memery at 0 as a pBuf and the effect where er hang in the loop in the ISR.

I have added a check to the processing loop for a curr_bd for NULL and to break and exit the ISR.

But my question is "Where in LwIP will we make those Pbuff_allocs to replenish the receive ISRs buffers if it is not done from the ISR?

This is a normal processing case; we have no ore resources for the receive DMA; we drop packets. At some point in the future buffers are freed up and allocated for the receive DMA.......but where?

Somebody must have seen such issues?
Have any of you got a fix?

Kind Regards,

Owain

  • Hello Owain,

    What is RM48?. Though TM4C supports Ethernet LwIP but I am not sure how this thread applies to TM4C

    Regards
    Amit
  • RM48 is one of TI's Safety Microcontrollers with an ethernet port.
    I just did a search under microcontrollers for similar problems. I have a problem with the LiWP driver for the RM48; but I think many people have had similar issues with other drivers and trying a allocate pbufs from the ISR and this failing.

    It's more of a question of whats the correct way to do this with LiWP; if a pbuf alloc fails in the ISR where the EMAC buffers are being replenished; how/where does LiWP then replenish these buffers to recover from the starvation and continue.
  • Hello Owain,

    You should have put it to the TI Safety uC forum., However the other thread that you did raise has the fix (at least from TM4C it worked)

    e2e.ti.com/.../360798

    Regards
    Amit