From: Fred <haydar.oezel@web.de>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] pbuf_alloc in the eth_drc.c returns Zero
Date: Thu, 04 Apr 2013 14:59:00 -0000 [thread overview]
Message-ID: <1365087544027-227390.post@n7.nabble.com> (raw)
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
next reply other threads:[~2013-04-04 14:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-04 14:59 Fred [this message]
2013-04-06 8:16 ` [ECOS] " Fred
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365087544027-227390.post@n7.nabble.com \
--to=haydar.oezel@web.de \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).