lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] pbuf_alloc failed after sometime at driver side.


From: jbhoi
Subject: Re: [lwip-users] pbuf_alloc failed after sometime at driver side.
Date: Fri, 10 Oct 2014 23:24:16 -0700 (MST)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]