public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] eth_drv_send() called recursively
@ 2007-05-24  9:43 Xiaochen Zhou
  2007-05-24 12:30 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaochen Zhou @ 2007-05-24  9:43 UTC (permalink / raw)
  To: ecos-discuss

Hi,everyone:

Here is ethernet packet sending flow in our ecos application:

1. eth_drv_send() call my_eth_driver_send()
2. my_eth_driver_send() call eth_drv_tx_done()
3. eth_drv_tx_done() call eth_drv_send()

eth_drv_send() and eth_drv_tx_done() are implemented in
io/eth/current/src/net/eth_drv.c

eth_drv_tx_done(struct eth_drv_sc *sc, CYG_ADDRESS key, int status)
{
    ....
    eth_drv_send(ifp);
    ....

eth_drv_send(struct ifnet *ifp)
{
    ....
    while ((sc->funs->can_send)(sc) > 0) {
        IF_DEQUEUE(&ifp->if_snd, m0);
        if (m0 == 0) {
            break;
        }
    ....
}

If sending queue has many mbufs (we using queue for QOS application),
sending thread will call eth_drv_send() recursively, the stack of packet
sending thread will overflow.

Can anyone tell me why call eth_drv_send() in eth_drv_tx_done()? In
eth_drv_send(), there are a loop to call IF_DEQUEUE(), so I think it is
useless and harmful. Can I delete "eth_drv_send(ifp)" line in
eth_drv_tx_done()?

Thanks!

Xiaochen Zhou

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-24  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24  9:43 [ECOS] eth_drv_send() called recursively Xiaochen Zhou
2007-05-24 12:30 ` Nick Garnett

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).