aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-07-23 14:11:01 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-26 12:47:05 -0400
commit92d947b77436437f4fe6f9b7b7cd35f1a294fa9d (patch)
tree798daa9cb74a2c4ff132933e3cf08182813b06c4
parenta0c98605d7237fc4bf26a345db5f950f46e69834 (diff)
igbvf: resolve "frees DMA memory with different size" warnings
This change resolves some warnings seen with DMA debugging enabled in which we were mapping skb->data with size + NET_IP_ALIGN and unmapping it with just size. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/igbvf/netdev.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 2bc9d63027db..926c31b47261 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -149,7 +149,6 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
149 bufsz = adapter->rx_ps_hdr_size; 149 bufsz = adapter->rx_ps_hdr_size;
150 else 150 else
151 bufsz = adapter->rx_buffer_len; 151 bufsz = adapter->rx_buffer_len;
152 bufsz += NET_IP_ALIGN;
153 152
154 while (cleaned_count--) { 153 while (cleaned_count--) {
155 rx_desc = IGBVF_RX_DESC_ADV(*rx_ring, i); 154 rx_desc = IGBVF_RX_DESC_ADV(*rx_ring, i);
@@ -173,7 +172,7 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
173 } 172 }
174 173
175 if (!buffer_info->skb) { 174 if (!buffer_info->skb) {
176 skb = netdev_alloc_skb(netdev, bufsz); 175 skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN);
177 if (!skb) { 176 if (!skb) {
178 adapter->alloc_rx_buff_failed++; 177 adapter->alloc_rx_buff_failed++;
179 goto no_buffers; 178 goto no_buffers;
@@ -286,7 +285,7 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter,
286 285
287 if (!skb_shinfo(skb)->nr_frags) { 286 if (!skb_shinfo(skb)->nr_frags) {
288 pci_unmap_single(pdev, buffer_info->dma, 287 pci_unmap_single(pdev, buffer_info->dma,
289 adapter->rx_ps_hdr_size + NET_IP_ALIGN, 288 adapter->rx_ps_hdr_size,
290 PCI_DMA_FROMDEVICE); 289 PCI_DMA_FROMDEVICE);
291 skb_put(skb, hlen); 290 skb_put(skb, hlen);
292 } 291 }