From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20086 invoked by alias); 20 Nov 2003 12:35:30 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 20078 invoked from network); 20 Nov 2003 12:35:29 -0000 Received: from unknown (HELO blackstar.vidisys.com) (194.25.115.114) by sources.redhat.com with SMTP; 20 Nov 2003 12:35:29 -0000 Received: from doms.vidisys.com (doms.vidisys.com [192.168.3.4]) by blackstar.vidisys.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id hAKAN3403795 for ; Thu, 20 Nov 2003 11:23:03 +0100 Received: (from larice@localhost) by doms.vidisys.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id hAKCYnK17016 for ecos-discuss@sources.redhat.com; Thu, 20 Nov 2003 13:34:49 +0100 From: Larice Robert Message-Id: <200311201234.hAKCYnK17016@doms.vidisys.com> To: ecos-discuss@sources.redhat.com Date: Thu, 20 Nov 2003 12:35:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [ECOS] mbuf leakage in if_i82559.c ? X-SW-Source: 2003-11/txt/msg00263.txt.bz2 Hello, i think there is possible mbuf leakage in if_i82559.c could you please verify this ? as far as i understand this, eth_drv.c hands over responsibility for mbufs to if_i82559.c with the parameter key of the function i82559_send(...key...) later if_i82599.c gives them back to eth_drv.c with the parameter key of the function eth_drv_tx_done(...key...) BUT, when i82559_send thinks its queue is full, it will simply drop this key. is this ok ? is there somewhere another cleanup mechanism which i've not seen so far ? Robert Larice ---------------------------------------------------------------------- file packages/devs/eth/intel/i82559/current/src/if_i82559.c TxDone(struct i82559* p_i82559) { ... while(1) { ... unsigned long key = p_i82559->tx_keys[ tx_descriptor_remove ]; ... (sc->funs->eth_drv->tx_done)( sc, key, 1 /* status */ ); ... } } static void i82559_send(struct eth_drv_sc *sc, struct eth_drv_sg *sg_list, int sg_len, int total_len, unsigned long key) { ... if ( p_i82559->tx_queue_full ) { ... // nothing done with key // !!!!! I think an mbuf is lost here !!!! ... } else { ... p_i82559->tx_keys[tx_descriptor_add] = key; ... } ... } file packages/io/eth/current/src/net/eth_drv.c static void eth_drv_tx_done(struct eth_drv_sc *sc, CYG_ADDRESS key, int status) { ... struct mbuf *m0 = (struct mbuf *)key; ... if (m0) { mbuf_key = m0; m_freem(m0); } ... } -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss