From patchwork Tue Sep 30 23:08:48 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Brandeburg X-Patchwork-Id: 2146 X-Patchwork-Delegate: jgarzik@pobox.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 6F6C7DDF1F for ; Wed, 1 Oct 2008 09:09:05 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754076AbYI3XIv (ORCPT ); Tue, 30 Sep 2008 19:08:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754065AbYI3XIv (ORCPT ); Tue, 30 Sep 2008 19:08:51 -0400 Received: from mga02.intel.com ([134.134.136.20]:40831 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739AbYI3XIu (ORCPT ); Tue, 30 Sep 2008 19:08:50 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 30 Sep 2008 16:02:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,340,1220252400"; d="scan'208";a="342348992" Received: from plxs0284.pdx.intel.com ([10.7.76.148]) by orsmga002.jf.intel.com with ESMTP; 30 Sep 2008 16:08:32 -0700 Received: from jbrandeb-desk.amr.corp.intel.com (jbrandeb-desk.amr.corp.intel.com [134.134.3.128]) by plxs0284.pdx.intel.com (8.12.11.20060308/8.12.10/MailSET/Hub) with ESMTP id m8UN8m1U011994; Tue, 30 Sep 2008 16:08:48 -0700 Date: Tue, 30 Sep 2008 16:08:48 -0700 (Pacific Daylight Time) From: "Brandeburg, Jesse" To: Breno Leitao cc: e1000-devel@lists.sourceforge.net, netdev , jesse.brandeburg@intel.com, Rafael Lorandi Subject: Re: Regression: ixgb warning on MTU change In-Reply-To: <48DAAFE2.1050607@linux.vnet.ibm.com> Message-ID: References: <48DAAFE2.1050607@linux.vnet.ibm.com> ReplyTo: "Brandeburg, Jesse" X-X-Sender: jesse.brandeburg@intel.com@imap.glb.intel.com MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 24 Sep 2008, Breno Leitao wrote: > I just found an issue related to ixgb that seems to be a regression. > After the interface is up and running (packets already transmitted), if > I try to change the MTU, running "ifconfig ethX mtu 70", for example, > causes the following warning[1]. > > Bisecting I found that the commit that caused this warning is > fc2d14e36c69a8d44a2f5230835b54e95025363e. Reverting it solves the > problem, ie, no more warnings. > > Digging further, I found that just removing the following line added > by fc2d14e36c69a8d44a2f5230835b54e95025363e's patch > "buffer_info->dma = 0;", also solves the problem. > Thanks for the report, I think this patch should fix it. Please test and let us know. This was compile tested only. ---- From: Jesse Brandeburg ixgb: fix bug when freeing resources It was pointed out by Breno Leitao that ixgb would crash on PPC when an IOMMU was in use, if change_mtu was called. It appears to be a pretty simple issue in the driver that wasn't discovered because most systems don't run with an IOMMU. The driver needs to only unmap buffers that are mapped (duh). CC: Breno Leitao Signed-off-by: Jesse Brandeburg --- drivers/net/ixgb/ixgb_main.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index aa75385..be3c7dc 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -977,15 +977,17 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter) for (i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - if (buffer_info->skb) { - + if (buffer_info->dma) { pci_unmap_single(pdev, buffer_info->dma, buffer_info->length, PCI_DMA_FROMDEVICE); + buffer_info->dma = 0; + buffer_info->length = 0; + } + if (buffer_info->skb) { dev_kfree_skb(buffer_info->skb); - buffer_info->skb = NULL; } }