aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d6f666ae38d3..92b35cfc7a46 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -479,7 +479,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
479 union ixgbe_adv_rx_desc *rx_desc; 479 union ixgbe_adv_rx_desc *rx_desc;
480 struct ixgbe_rx_buffer *bi; 480 struct ixgbe_rx_buffer *bi;
481 unsigned int i; 481 unsigned int i;
482 unsigned int bufsz = rx_ring->rx_buf_len + NET_IP_ALIGN;
483 482
484 i = rx_ring->next_to_use; 483 i = rx_ring->next_to_use;
485 bi = &rx_ring->rx_buffer_info[i]; 484 bi = &rx_ring->rx_buffer_info[i];
@@ -508,8 +507,10 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
508 } 507 }
509 508
510 if (!bi->skb) { 509 if (!bi->skb) {
511 struct sk_buff *skb = netdev_alloc_skb(adapter->netdev, 510 struct sk_buff *skb;
512 bufsz); 511 skb = netdev_alloc_skb(adapter->netdev,
512 (rx_ring->rx_buf_len +
513 NET_IP_ALIGN));
513 514
514 if (!skb) { 515 if (!skb) {
515 adapter->alloc_rx_buff_failed++; 516 adapter->alloc_rx_buff_failed++;
@@ -524,7 +525,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
524 skb_reserve(skb, NET_IP_ALIGN); 525 skb_reserve(skb, NET_IP_ALIGN);
525 526
526 bi->skb = skb; 527 bi->skb = skb;
527 bi->dma = pci_map_single(pdev, skb->data, bufsz, 528 bi->dma = pci_map_single(pdev, skb->data,
529 rx_ring->rx_buf_len,
528 PCI_DMA_FROMDEVICE); 530 PCI_DMA_FROMDEVICE);
529 } 531 }
530 /* Refresh the desc even if buffer_addrs didn't change because 532 /* Refresh the desc even if buffer_addrs didn't change because
@@ -615,7 +617,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_adapter *adapter,
615 617
616 if (len && !skb_shinfo(skb)->nr_frags) { 618 if (len && !skb_shinfo(skb)->nr_frags) {
617 pci_unmap_single(pdev, rx_buffer_info->dma, 619 pci_unmap_single(pdev, rx_buffer_info->dma,
618 rx_ring->rx_buf_len + NET_IP_ALIGN, 620 rx_ring->rx_buf_len,
619 PCI_DMA_FROMDEVICE); 621 PCI_DMA_FROMDEVICE);
620 skb_put(skb, len); 622 skb_put(skb, len);
621 } 623 }