From patchwork Tue Jun 9 17:11:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wright X-Patchwork-Id: 28342 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 7BA2CB7087 for ; Wed, 10 Jun 2009 03:13:18 +1000 (EST) Received: by ozlabs.org (Postfix) id 2C8ABDDD1C; Wed, 10 Jun 2009 03:13:18 +1000 (EST) 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 D4202DDD1B for ; Wed, 10 Jun 2009 03:13:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755592AbZFIRNG (ORCPT ); Tue, 9 Jun 2009 13:13:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753775AbZFIRNE (ORCPT ); Tue, 9 Jun 2009 13:13:04 -0400 Received: from sous-sol.org ([216.99.217.87]:35368 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753321AbZFIRND (ORCPT ); Tue, 9 Jun 2009 13:13:03 -0400 Received: from sequoia.sous-sol.org (sequoia.sous-sol.org [127.0.0.1]) by sequoia.sous-sol.org (8.14.2/8.14.2) with ESMTP id n59HBp2S009675; Tue, 9 Jun 2009 10:11:51 -0700 Received: (from chrisw@localhost) by sequoia.sous-sol.org (8.14.2/8.14.2/Submit) id n59HBpBt009674; Tue, 9 Jun 2009 10:11:51 -0700 Date: Tue, 9 Jun 2009 10:11:51 -0700 From: Chris Wright To: jeffrey.t.kirsher@intel.com Cc: netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net, andy@greyhouse.net Subject: [PATCH] ixgbe: fix mismatched dma map/unmap size Message-ID: <20090609171151.GM20823@sequoia.sous-sol.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on sequoia.sous-sol.org X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org DMA buffer is mapped w/ NET_IP_ALIGN accounted, unmapped w/out. Dma debugging generates this warning. Simple fix below. [ 76.356509] ixgbe 0000:04:00.0: DMA-API: device driver frees DMA memory with different size [device address=0x00000000fff7f022] [map size=1524 bytes] [unmap size=1522 bytes] ... [ 76.440333] [] ixgbe_clean_rx_irq+0x123/0x41b [ixgbe] ... [ 76.551151] Mapped at: [ 76.553582] [] debug_dma_map_page+0x4d/0xf8 [ 76.559584] [] ixgbe_alloc_rx_buffers+0x204/0x2af [ixgbe] Signed-off-by: Chris Wright --- Fix is against v2.6.30-rc8-73-g3af968e, but still applies to net-next. drivers/net/ixgbe/ixgbe_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 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/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 07e778d..43aa62d 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -669,7 +669,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, if (len && !skb_shinfo(skb)->nr_frags) { pci_unmap_single(pdev, rx_buffer_info->dma, - rx_ring->rx_buf_len, + rx_ring->rx_buf_len + NET_IP_ALIGN, PCI_DMA_FROMDEVICE); skb_put(skb, len); } @@ -2440,7 +2440,7 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, rx_buffer_info = &rx_ring->rx_buffer_info[i]; if (rx_buffer_info->dma) { pci_unmap_single(pdev, rx_buffer_info->dma, - rx_ring->rx_buf_len, + rx_ring->rx_buf_len + NET_IP_ALIGN, PCI_DMA_FROMDEVICE); rx_buffer_info->dma = 0; }