I don't think the issue related to the driver because driver have pass after
checking the eth type of the pakcet it pass to the upper layer stack. And
now upper laye stack have resposibilty to free this packat after it no
longer in use.

Here peace of drive code

        /* move received packet into a new pbuf */
        p = lpc_low_level_input(netif);
        if (p == NULL) {
                return;
        }

        /* points to packet payload, which starts with an Ethernet header */
        ethhdr = p->payload;

        switch (htons(ethhdr->type)) {
        case ETHTYPE_IP:
        case ETHTYPE_ARP:
#if PPPOE_SUPPORT
        case ETHTYPE_PPPOEDISC:
        case ETHTYPE_PPPOE:
#endif /* PPPOE_SUPPORT */
                /* full packet send to tcpip_thread to process */
                if (netif->input(p, netif) != ERR_OK) {
                        LWIP_DEBUGF(NETIF_DEBUG,
                                                ("lpc_enetif_input: IP input 
error\n"));
                        /* Free buffer */
                        pbuf_free(p);
                        p=NULL;
                }
                break;

        default:
                /* Return buffer */
                pbuf_free(p);
                p=NULL;
                break;
        }


Here `netif->input` mapped to tcpip_input function of lwip stack which store
packet in queue and tcp ip running thread will pass it io next phase like
ip_input and from that it call tcp_input or udp_input or other and it will
free that packet.



--
View this message in context: 
http://lwip.100.n7.nabble.com/pbuf-alloc-failed-after-sometime-at-driver-side-tp23381p23388.html
Sent from the lwip-users mailing list archive at Nabble.com.

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to