aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2006-03-02 21:21:57 -0500
committerroot <root@jk-desktop.jf.intel.com>2006-03-02 21:21:57 -0500
commit30320be88fb9cae888eacf1f1eaae95a03720128 (patch)
tree359ba46e6c3d17d1a6fc11b97eea2ad1bc71cca7 /drivers/net/e1000/e1000_main.c
parentdc7c6add3493cdc71475a006b7afc3732e55abd8 (diff)
e1000: Added a performance enhancement - prefetch
- this implementation of prefetch was tested on new and old hardware Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d641fbc7a6e1..b572a1218c81 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3569,10 +3569,15 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3569 skb = buffer_info->skb; 3569 skb = buffer_info->skb;
3570 buffer_info->skb = NULL; 3570 buffer_info->skb = NULL;
3571 3571
3572 prefetch(skb->data - NET_IP_ALIGN);
3573
3572 if (++i == rx_ring->count) i = 0; 3574 if (++i == rx_ring->count) i = 0;
3573 next_rxd = E1000_RX_DESC(*rx_ring, i); 3575 next_rxd = E1000_RX_DESC(*rx_ring, i);
3576 prefetch(next_rxd);
3577
3574 next_buffer = &rx_ring->buffer_info[i]; 3578 next_buffer = &rx_ring->buffer_info[i];
3575 next_skb = next_buffer->skb; 3579 next_skb = next_buffer->skb;
3580 prefetch(next_skb->data - NET_IP_ALIGN);
3576 3581
3577 cleaned = TRUE; 3582 cleaned = TRUE;
3578 cleaned_count++; 3583 cleaned_count++;
@@ -3668,6 +3673,7 @@ next_desc:
3668 cleaned_count = 0; 3673 cleaned_count = 0;
3669 } 3674 }
3670 3675
3676 /* use prefetched values */
3671 rx_desc = next_rxd; 3677 rx_desc = next_rxd;
3672 buffer_info = next_buffer; 3678 buffer_info = next_buffer;
3673 } 3679 }
@@ -3710,9 +3716,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3710 i = rx_ring->next_to_clean; 3716 i = rx_ring->next_to_clean;
3711 rx_desc = E1000_RX_DESC_PS(*rx_ring, i); 3717 rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
3712 staterr = le32_to_cpu(rx_desc->wb.middle.status_error); 3718 staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
3713 buffer_info = &rx_ring->buffer_info[i];
3714 3719
3715 while (staterr & E1000_RXD_STAT_DD) { 3720 while (staterr & E1000_RXD_STAT_DD) {
3721 buffer_info = &rx_ring->buffer_info[i];
3716 ps_page = &rx_ring->ps_page[i]; 3722 ps_page = &rx_ring->ps_page[i];
3717 ps_page_dma = &rx_ring->ps_page_dma[i]; 3723 ps_page_dma = &rx_ring->ps_page_dma[i];
3718#ifdef CONFIG_E1000_NAPI 3724#ifdef CONFIG_E1000_NAPI
@@ -3722,10 +3728,16 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3722#endif 3728#endif
3723 skb = buffer_info->skb; 3729 skb = buffer_info->skb;
3724 3730
3731 /* in the packet split case this is header only */
3732 prefetch(skb->data - NET_IP_ALIGN);
3733
3725 if (++i == rx_ring->count) i = 0; 3734 if (++i == rx_ring->count) i = 0;
3726 next_rxd = E1000_RX_DESC_PS(*rx_ring, i); 3735 next_rxd = E1000_RX_DESC_PS(*rx_ring, i);
3736 prefetch(next_rxd);
3737
3727 next_buffer = &rx_ring->buffer_info[i]; 3738 next_buffer = &rx_ring->buffer_info[i];
3728 next_skb = next_buffer->skb; 3739 next_skb = next_buffer->skb;
3740 prefetch(next_skb->data - NET_IP_ALIGN);
3729 3741
3730 cleaned = TRUE; 3742 cleaned = TRUE;
3731 cleaned_count++; 3743 cleaned_count++;
@@ -3787,9 +3799,8 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3787 } 3799 }
3788 3800
3789 for (j = 0; j < adapter->rx_ps_pages; j++) { 3801 for (j = 0; j < adapter->rx_ps_pages; j++) {
3790 if (!(length = le16_to_cpu(rx_desc->wb.upper.length[j]))) 3802 if (!(length= le16_to_cpu(rx_desc->wb.upper.length[j])))
3791 break; 3803 break;
3792
3793 pci_unmap_page(pdev, ps_page_dma->ps_page_dma[j], 3804 pci_unmap_page(pdev, ps_page_dma->ps_page_dma[j],
3794 PAGE_SIZE, PCI_DMA_FROMDEVICE); 3805 PAGE_SIZE, PCI_DMA_FROMDEVICE);
3795 ps_page_dma->ps_page_dma[j] = 0; 3806 ps_page_dma->ps_page_dma[j] = 0;
@@ -3837,6 +3848,7 @@ next_desc:
3837 cleaned_count = 0; 3848 cleaned_count = 0;
3838 } 3849 }
3839 3850
3851 /* use prefetched values */
3840 rx_desc = next_rxd; 3852 rx_desc = next_rxd;
3841 buffer_info = next_buffer; 3853 buffer_info = next_buffer;
3842 3854