aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2006-01-18 16:01:43 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-18 16:17:58 -0500
commit86c3d59ff54c31f07d0f0483dd3f668107c8cf85 (patch)
treee252d9716ae573fa0d44240ab2793ab3b7504f4d /drivers/net
parent73629bbc84a7d4026ad08edbfefc642eec60f246 (diff)
[PATCH] e1000: fix receive breakage
in attempting to not send the "prefetch" patch, we broke the receive code, this patch fixes that issue. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000/e1000_main.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 98a775be266a..401be1f19119 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -88,8 +88,6 @@
88 * sessions are active and log a message 88 * sessions are active and log a message
89 * 6.2.2 7/21/05 89 * 6.2.2 7/21/05
90 * o used fixed size descriptors for all MTU sizes, reduces memory load 90 * o used fixed size descriptors for all MTU sizes, reduces memory load
91 * 6.2.1 7/21/05
92 * o Performance tweaks, including copybreak and prefetch
93 * 6.1.2 4/13/05 91 * 6.1.2 4/13/05
94 * o Fixed ethtool diagnostics 92 * o Fixed ethtool diagnostics
95 * o Enabled flow control to take default eeprom settings 93 * o Enabled flow control to take default eeprom settings
@@ -3615,8 +3613,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3615{ 3613{
3616 struct net_device *netdev = adapter->netdev; 3614 struct net_device *netdev = adapter->netdev;
3617 struct pci_dev *pdev = adapter->pdev; 3615 struct pci_dev *pdev = adapter->pdev;
3618 struct e1000_rx_desc *rx_desc; 3616 struct e1000_rx_desc *rx_desc, *next_rxd;
3619 struct e1000_buffer *buffer_info; 3617 struct e1000_buffer *buffer_info, *next_buffer;
3620 unsigned long flags; 3618 unsigned long flags;
3621 uint32_t length; 3619 uint32_t length;
3622 uint8_t last_byte; 3620 uint8_t last_byte;
@@ -3629,7 +3627,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3629 buffer_info = &rx_ring->buffer_info[i]; 3627 buffer_info = &rx_ring->buffer_info[i];
3630 3628
3631 while (rx_desc->status & E1000_RXD_STAT_DD) { 3629 while (rx_desc->status & E1000_RXD_STAT_DD) {
3632 struct sk_buff *skb; 3630 struct sk_buff *skb, *next_skb;
3633 u8 status; 3631 u8 status;
3634#ifdef CONFIG_E1000_NAPI 3632#ifdef CONFIG_E1000_NAPI
3635 if (*work_done >= work_to_do) 3633 if (*work_done >= work_to_do)
@@ -3638,6 +3636,13 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
3638#endif 3636#endif
3639 status = rx_desc->status; 3637 status = rx_desc->status;
3640 skb = buffer_info->skb; 3638 skb = buffer_info->skb;
3639 buffer_info->skb = NULL;
3640
3641 if (++i == rx_ring->count) i = 0;
3642 next_rxd = E1000_RX_DESC(*rx_ring, i);
3643 next_buffer = &rx_ring->buffer_info[i];
3644 next_skb = next_buffer->skb;
3645
3641 cleaned = TRUE; 3646 cleaned = TRUE;
3642 cleaned_count++; 3647 cleaned_count++;
3643 pci_unmap_single(pdev, 3648 pci_unmap_single(pdev,
@@ -3769,6 +3774,8 @@ next_desc:
3769 cleaned_count = 0; 3774 cleaned_count = 0;
3770 } 3775 }
3771 3776
3777 rx_desc = next_rxd;
3778 buffer_info = next_buffer;
3772 } 3779 }
3773 rx_ring->next_to_clean = i; 3780 rx_ring->next_to_clean = i;
3774 3781
@@ -3794,13 +3801,13 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3794 struct e1000_rx_ring *rx_ring) 3801 struct e1000_rx_ring *rx_ring)
3795#endif 3802#endif
3796{ 3803{
3797 union e1000_rx_desc_packet_split *rx_desc; 3804 union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
3798 struct net_device *netdev = adapter->netdev; 3805 struct net_device *netdev = adapter->netdev;
3799 struct pci_dev *pdev = adapter->pdev; 3806 struct pci_dev *pdev = adapter->pdev;
3800 struct e1000_buffer *buffer_info; 3807 struct e1000_buffer *buffer_info, *next_buffer;
3801 struct e1000_ps_page *ps_page; 3808 struct e1000_ps_page *ps_page;
3802 struct e1000_ps_page_dma *ps_page_dma; 3809 struct e1000_ps_page_dma *ps_page_dma;
3803 struct sk_buff *skb; 3810 struct sk_buff *skb, *next_skb;
3804 unsigned int i, j; 3811 unsigned int i, j;
3805 uint32_t length, staterr; 3812 uint32_t length, staterr;
3806 int cleaned_count = 0; 3813 int cleaned_count = 0;
@@ -3809,9 +3816,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3809 i = rx_ring->next_to_clean; 3816 i = rx_ring->next_to_clean;
3810 rx_desc = E1000_RX_DESC_PS(*rx_ring, i); 3817 rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
3811 staterr = le32_to_cpu(rx_desc->wb.middle.status_error); 3818 staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
3819 buffer_info = &rx_ring->buffer_info[i];
3812 3820
3813 while (staterr & E1000_RXD_STAT_DD) { 3821 while (staterr & E1000_RXD_STAT_DD) {
3814 buffer_info = &rx_ring->buffer_info[i];
3815 ps_page = &rx_ring->ps_page[i]; 3822 ps_page = &rx_ring->ps_page[i];
3816 ps_page_dma = &rx_ring->ps_page_dma[i]; 3823 ps_page_dma = &rx_ring->ps_page_dma[i];
3817#ifdef CONFIG_E1000_NAPI 3824#ifdef CONFIG_E1000_NAPI
@@ -3819,14 +3826,19 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
3819 break; 3826 break;
3820 (*work_done)++; 3827 (*work_done)++;
3821#endif 3828#endif
3829 skb = buffer_info->skb;
3830
3831 if (++i == rx_ring->count) i = 0;
3832 next_rxd = E1000_RX_DESC_PS(*rx_ring, i);
3833 next_buffer = &rx_ring->buffer_info[i];
3834 next_skb = next_buffer->skb;
3835
3822 cleaned = TRUE; 3836 cleaned = TRUE;
3823 cleaned_count++; 3837 cleaned_count++;
3824 pci_unmap_single(pdev, buffer_info->dma, 3838 pci_unmap_single(pdev, buffer_info->dma,
3825 buffer_info->length, 3839 buffer_info->length,
3826 PCI_DMA_FROMDEVICE); 3840 PCI_DMA_FROMDEVICE);
3827 3841
3828 skb = buffer_info->skb;
3829
3830 if (unlikely(!(staterr & E1000_RXD_STAT_EOP))) { 3842 if (unlikely(!(staterr & E1000_RXD_STAT_EOP))) {
3831 E1000_DBG("%s: Packet Split buffers didn't pick up" 3843 E1000_DBG("%s: Packet Split buffers didn't pick up"
3832 " the full packet\n", netdev->name); 3844 " the full packet\n", netdev->name);
@@ -3908,6 +3920,9 @@ next_desc:
3908 cleaned_count = 0; 3920 cleaned_count = 0;
3909 } 3921 }
3910 3922
3923 rx_desc = next_rxd;
3924 buffer_info = next_buffer;
3925
3911 staterr = le32_to_cpu(rx_desc->wb.middle.status_error); 3926 staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
3912 } 3927 }
3913 rx_ring->next_to_clean = i; 3928 rx_ring->next_to_clean = i;