Message ID | alpine.WNT.2.00.0906160907580.6076@jbrandeb-desk1.amr.corp.intel.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
On Tue, Jun 16, 2009 at 09:33:15AM -0700, Brandeburg, Jesse wrote: > On Tue, 16 Jun 2009, Joerg Roedel wrote: > > today I got this dma-debug warning with the ixgbe driver with a kernel > > near 2.6.30-rc8. > > Hi Joerg, thanks for the report, I thought we had fixed all of these > already but we must have missed this one. > > > ------------[ cut here ]------------ > > WARNING: at /data/repos/linux-2.6-iommu/lib/dma-debug.c:806 > > check_unmap+0x214/0x5c3() > > Hardware name: Toonie > > ixgbe 0000:02:00.0: DMA-API: device driver frees DMA memory with > > different size [device address=0x0000000000045c12] [map size=258 > > bytes] [unmap size=256 bytes] > > The following patch should fix it, compile tested only, but it is pretty > straight forward. Thanks for the quick answer :) But I tested the patch and the warning is still there. Joerg
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index a551a96..01c2193 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -563,7 +563,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, union ixgbe_adv_rx_desc *rx_desc; struct ixgbe_rx_buffer *bi; unsigned int i; - unsigned int bufsz = rx_ring->rx_buf_len + NET_IP_ALIGN; i = rx_ring->next_to_use; bi = &rx_ring->rx_buffer_info[i]; @@ -593,7 +592,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, if (!bi->skb) { struct sk_buff *skb; - skb = netdev_alloc_skb(adapter->netdev, bufsz); + skb = netdev_alloc_skb(adapter->netdev, + (rx_ring->rx_buf_len + + NET_IP_ALIGN)); if (!skb) { adapter->alloc_rx_buff_failed++; @@ -608,7 +609,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, skb_reserve(skb, NET_IP_ALIGN); bi->skb = skb; - bi->dma = pci_map_single(pdev, skb->data, bufsz, + bi->dma = pci_map_single(pdev, skb->data, + rx_ring->rx_buf_len, PCI_DMA_FROMDEVICE); } /* Refresh the desc even if buffer_addrs didn't change because