Received: with ECARTIS (v1.0.0; list netdev); Thu, 24 Jun 2004 16:24:27 -0700 (PDT) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i5ONOPgi021416 for ; Thu, 24 Jun 2004 16:24:25 -0700 Received: by ozlabs.org (Postfix, from userid 1010) id 1EA072BD71; Fri, 25 Jun 2004 09:24:19 +1000 (EST) Date: Fri, 25 Jun 2004 09:23:11 +1000 From: Anton Blanchard To: netdev@oss.sgi.com Cc: cramerj@intel.com, john.ronciak@intel.com, ganesh.venkatesan@intel.com Subject: e1000_clean_tx_ring Message-ID: <20040624232311.GG22495@krispykreme> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040523i X-archive-position: 6321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anton@samba.org Precedence: bulk X-list: netdev Hi, I was looking over the e1000 driver and noticed what I think is a bug in e1000_clean_tx_ring. We wouldnt call pci_unmap_page on tx ring entries that didnt have ->skb filled, eg zero copy packets. This is on latest 2.6 BK. Anton ===== e1000_main.c 1.120 vs edited ===== --- 1.120/drivers/net/e1000/e1000_main.c Sat Jun 19 10:00:00 2004 +++ edited/e1000_main.c Thu Jun 24 02:16:42 2004 @@ -1070,14 +1070,19 @@ for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if(buffer_info->skb) { + if (buffer_info->dma) { pci_unmap_page(pdev, buffer_info->dma, buffer_info->length, PCI_DMA_TODEVICE); - dev_kfree_skb(buffer_info->skb); + buffer_info->dma = NULL; + } + + if (buffer_info->skb) { + + dev_kfree_skb_any(buffer_info->skb); buffer_info->skb = NULL; }