From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1530 invoked by alias); 24 May 2007 08:29:31 -0000 Received: (qmail 1521 invoked by uid 22791); 24 May 2007 08:29:31 -0000 X-Spam-Check-By: sourceware.org Received: from h3cml01-in.huawei-3com.com (HELO huawei-3com.com) (210.21.230.96) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 24 May 2007 08:29:28 +0000 Received: from huawei-3com.com (localhost [127.0.0.1]) by h3cml01-in.huawei-3com.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0JIJ00JQCECKJV@h3cml01-in.huawei-3com.com> for ecos-discuss@sources.redhat.com; Thu, 24 May 2007 16:31:32 +0800 (CST) Received: from smtp1.h3c.com ([172.19.1.38]) by h3cml01-in.huawei-3com.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0JIJ00EEMECKPB@h3cml01-in.huawei-3com.com> for ecos-discuss@sources.redhat.com; Thu, 24 May 2007 16:31:32 +0800 (CST) Received: from unknown (HELO sohoserverbak) ([10.165.122.174]) by smtp1.h3c.com with ESMTP; Thu, 24 May 2007 16:25:38 +0800 Date: Thu, 24 May 2007 09:43:00 -0000 From: Xiaochen Zhou To: ecos-discuss@sources.redhat.com Message-id: <009501c79dde$685e4ea0$ae7aa50a@h3c.huawei3com.com> MIME-version: 1.0 X-Mailer: Microsoft Outlook, Build 10.0.2627 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT 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 Subject: [ECOS] eth_drv_send() called recursively X-SW-Source: 2007-05/txt/msg00121.txt.bz2 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