Commit 92d947b7 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0c98605
...@@ -149,7 +149,6 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring, ...@@ -149,7 +149,6 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
bufsz = adapter->rx_ps_hdr_size; bufsz = adapter->rx_ps_hdr_size;
else else
bufsz = adapter->rx_buffer_len; bufsz = adapter->rx_buffer_len;
bufsz += NET_IP_ALIGN;
while (cleaned_count--) { while (cleaned_count--) {
rx_desc = IGBVF_RX_DESC_ADV(*rx_ring, i); 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,7 +172,7 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring,
} }
if (!buffer_info->skb) { if (!buffer_info->skb) {
skb = netdev_alloc_skb(netdev, bufsz); skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN);
if (!skb) { if (!skb) {
adapter->alloc_rx_buff_failed++; adapter->alloc_rx_buff_failed++;
goto no_buffers; goto no_buffers;
...@@ -286,7 +285,7 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter, ...@@ -286,7 +285,7 @@ static bool igbvf_clean_rx_irq(struct igbvf_adapter *adapter,
if (!skb_shinfo(skb)->nr_frags) { if (!skb_shinfo(skb)->nr_frags) {
pci_unmap_single(pdev, buffer_info->dma, pci_unmap_single(pdev, buffer_info->dma,
adapter->rx_ps_hdr_size + NET_IP_ALIGN, adapter->rx_ps_hdr_size,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
skb_put(skb, hlen); skb_put(skb, hlen);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment