From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27852 invoked by alias); 4 Apr 2013 14:59:09 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 27842 invoked by uid 89); 4 Apr 2013 14:59:08 -0000 X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,TW_DR autolearn=ham version=3.3.1 Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 04 Apr 2013 14:59:05 +0000 Received: from tom.nabble.com ([192.168.236.105]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UNld2-0004oY-2S for ecos-discuss@ecos.sourceware.org; Thu, 04 Apr 2013 07:59:04 -0700 Date: Thu, 04 Apr 2013 14:59:00 -0000 From: Fred To: ecos-discuss@ecos.sourceware.org Message-ID: <1365087544027-227390.post@n7.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [ECOS] pbuf_alloc in the eth_drc.c returns Zero X-SW-Source: 2013-04/txt/msg00003.txt.bz2 Hi Guys I am using the Lwip Stack with ecos and get following problem when i make a Broadcast storm on my device. In the eth_drv.c the eth_drv_recv() function it is not possible to allocate any pbuf anymore and my ethernet device does not react anymore. I see that i get receive interrupts but can't process it because the ownership bits of my buffer queue pointer addresses are not getting reseted which would be done in the (sc->funs->recv) (sc, sg_list, sg_len); recv() function of my driver. But due to the failed pbuf_alloc my drivers recv() function is not called anymore the function returns with nothing. static void eth_drv_recv(struct eth_drv_sc *sc, int total_len) { struct eth_drv_sg sg_list[MAX_ETH_DRV_SG]; struct netif *netif = &sc->sc_arpcom.ac_if; struct pbuf *p, *q; int sg_len = 0; CYGARC_HAL_SAVE_GP(); if ((total_len > MAX_ETH_MSG) || (total_len < 0)) { total_len = MAX_ETH_MSG; } p = pbuf_alloc(PBUF_RAW, total_len, PBUF_POOL); if (p == NULL) { LWIP_DEBUGF(0, ("ecosif_input: low_level_input returned NULL\n")); return; } for (q = p; q != NULL; q = q->next) { sg_list[sg_len].buf = (CYG_ADDRESS) q->payload; sg_list[sg_len++].len = q->len; } (sc->funs->recv) (sc, sg_list, sg_len); ecosif_input(netif, p); CYGARC_HAL_RESTORE_GP(); } How can i handle this problem? I did not found any solution here in the older topics, where this problem was also mentioned. I can't raise the pbuf number or size because i don't have enough memory on my device for it. Is there any way to say to the stack that it should reset the buffers or something like this? I have activated the SYS_ARCH_PROTECT defines in the lwip stack for critical parts so it is thread save. Regards Fred -- View this message in context: http://sourceware-org.1504.n7.nabble.com/pbuf-alloc-in-the-eth-drc-c-returns-Zero-tp227390.html Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss