diff mbox

ixgbe: fix mismatched dma map/unmap size

Message ID 20090609171151.GM20823@sequoia.sous-sol.org
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Chris Wright June 9, 2009, 5:11 p.m. UTC
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]  [<ffffffffa000247f>] ixgbe_clean_rx_irq+0x123/0x41b [ixgbe]
...
[   76.551151] Mapped at:
[   76.553582]  [<ffffffff811bd745>] debug_dma_map_page+0x4d/0xf8
[   76.559584]  [<ffffffffa00012d4>] ixgbe_alloc_rx_buffers+0x204/0x2af [ixgbe]

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
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

Comments

David Miller June 11, 2009, 10:20 a.m. UTC | #1
From: Chris Wright <chrisw@sous-sol.org>
Date: Tue, 9 Jun 2009 10:11:51 -0700

> 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]  [<ffffffffa000247f>] ixgbe_clean_rx_irq+0x123/0x41b [ixgbe]
> ...
> [   76.551151] Mapped at:
> [   76.553582]  [<ffffffff811bd745>] debug_dma_map_page+0x4d/0xf8
> [   76.559584]  [<ffffffffa00012d4>] ixgbe_alloc_rx_buffers+0x204/0x2af [ixgbe]
> 
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
> Fix is against v2.6.30-rc8-73-g3af968e, but still applies to net-next.

I'll leave this for Jeff to suck into his queue.   Thanks Chris.
--
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
Kirsher, Jeffrey T June 11, 2009, 9:38 p.m. UTC | #2
On Thu, Jun 11, 2009 at 3:20 AM, David Miller<davem@davemloft.net> wrote:
> From: Chris Wright <chrisw@sous-sol.org>
> Date: Tue, 9 Jun 2009 10:11:51 -0700
>
>> 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]  [<ffffffffa000247f>] ixgbe_clean_rx_irq+0x123/0x41b [ixgbe]
>> ...
>> [   76.551151] Mapped at:
>> [   76.553582]  [<ffffffff811bd745>] debug_dma_map_page+0x4d/0xf8
>> [   76.559584]  [<ffffffffa00012d4>] ixgbe_alloc_rx_buffers+0x204/0x2af [ixgbe]
>>
>> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
>> ---
>> Fix is against v2.6.30-rc8-73-g3af968e, but still applies to net-next.
>
> I'll leave this for Jeff to suck into his queue.   Thanks Chris.
> --

I have this in my queue, thanks.
diff mbox

Patch

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;
 		}