diff options
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 6d3d41934503..da62db897426 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; | |||
36 | #else | 36 | #else |
37 | #define DRIVERNAPI "-NAPI" | 37 | #define DRIVERNAPI "-NAPI" |
38 | #endif | 38 | #endif |
39 | #define DRV_VERSION "7.1.9-k2"DRIVERNAPI | 39 | #define DRV_VERSION "7.1.9-k4"DRIVERNAPI |
40 | char e1000_driver_version[] = DRV_VERSION; | 40 | char e1000_driver_version[] = DRV_VERSION; |
41 | static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; | 41 | static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; |
42 | 42 | ||
@@ -1068,7 +1068,7 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
1068 | 1068 | ||
1069 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); | 1069 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); |
1070 | 1070 | ||
1071 | adapter->rx_buffer_len = MAXIMUM_ETHERNET_FRAME_SIZE; | 1071 | adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE; |
1072 | adapter->rx_ps_bsize0 = E1000_RXBUFFER_128; | 1072 | adapter->rx_ps_bsize0 = E1000_RXBUFFER_128; |
1073 | hw->max_frame_size = netdev->mtu + | 1073 | hw->max_frame_size = netdev->mtu + |
1074 | ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; | 1074 | ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; |
@@ -3148,7 +3148,6 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3148 | adapter->rx_buffer_len = E1000_RXBUFFER_16384; | 3148 | adapter->rx_buffer_len = E1000_RXBUFFER_16384; |
3149 | 3149 | ||
3150 | /* adjust allocation if LPE protects us, and we aren't using SBP */ | 3150 | /* adjust allocation if LPE protects us, and we aren't using SBP */ |
3151 | #define MAXIMUM_ETHERNET_VLAN_SIZE 1522 | ||
3152 | if (!adapter->hw.tbi_compatibility_on && | 3151 | if (!adapter->hw.tbi_compatibility_on && |
3153 | ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) || | 3152 | ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) || |
3154 | (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))) | 3153 | (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))) |
@@ -3387,8 +3386,8 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) | |||
3387 | E1000_WRITE_REG(hw, IMC, ~0); | 3386 | E1000_WRITE_REG(hw, IMC, ~0); |
3388 | E1000_WRITE_FLUSH(hw); | 3387 | E1000_WRITE_FLUSH(hw); |
3389 | } | 3388 | } |
3390 | if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) | 3389 | if (likely(netif_rx_schedule_prep(netdev))) |
3391 | __netif_rx_schedule(&adapter->polling_netdev[0]); | 3390 | __netif_rx_schedule(netdev); |
3392 | else | 3391 | else |
3393 | e1000_irq_enable(adapter); | 3392 | e1000_irq_enable(adapter); |
3394 | #else | 3393 | #else |
@@ -3431,34 +3430,26 @@ e1000_clean(struct net_device *poll_dev, int *budget) | |||
3431 | { | 3430 | { |
3432 | struct e1000_adapter *adapter; | 3431 | struct e1000_adapter *adapter; |
3433 | int work_to_do = min(*budget, poll_dev->quota); | 3432 | int work_to_do = min(*budget, poll_dev->quota); |
3434 | int tx_cleaned = 0, i = 0, work_done = 0; | 3433 | int tx_cleaned = 0, work_done = 0; |
3435 | 3434 | ||
3436 | /* Must NOT use netdev_priv macro here. */ | 3435 | /* Must NOT use netdev_priv macro here. */ |
3437 | adapter = poll_dev->priv; | 3436 | adapter = poll_dev->priv; |
3438 | 3437 | ||
3439 | /* Keep link state information with original netdev */ | 3438 | /* Keep link state information with original netdev */ |
3440 | if (!netif_carrier_ok(adapter->netdev)) | 3439 | if (!netif_carrier_ok(poll_dev)) |
3441 | goto quit_polling; | 3440 | goto quit_polling; |
3442 | 3441 | ||
3443 | while (poll_dev != &adapter->polling_netdev[i]) { | 3442 | /* e1000_clean is called per-cpu. This lock protects |
3444 | i++; | 3443 | * tx_ring[0] from being cleaned by multiple cpus |
3445 | BUG_ON(i == adapter->num_rx_queues); | 3444 | * simultaneously. A failure obtaining the lock means |
3445 | * tx_ring[0] is currently being cleaned anyway. */ | ||
3446 | if (spin_trylock(&adapter->tx_queue_lock)) { | ||
3447 | tx_cleaned = e1000_clean_tx_irq(adapter, | ||
3448 | &adapter->tx_ring[0]); | ||
3449 | spin_unlock(&adapter->tx_queue_lock); | ||
3446 | } | 3450 | } |
3447 | 3451 | ||
3448 | if (likely(adapter->num_tx_queues == 1)) { | 3452 | adapter->clean_rx(adapter, &adapter->rx_ring[0], |
3449 | /* e1000_clean is called per-cpu. This lock protects | ||
3450 | * tx_ring[0] from being cleaned by multiple cpus | ||
3451 | * simultaneously. A failure obtaining the lock means | ||
3452 | * tx_ring[0] is currently being cleaned anyway. */ | ||
3453 | if (spin_trylock(&adapter->tx_queue_lock)) { | ||
3454 | tx_cleaned = e1000_clean_tx_irq(adapter, | ||
3455 | &adapter->tx_ring[0]); | ||
3456 | spin_unlock(&adapter->tx_queue_lock); | ||
3457 | } | ||
3458 | } else | ||
3459 | tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[i]); | ||
3460 | |||
3461 | adapter->clean_rx(adapter, &adapter->rx_ring[i], | ||
3462 | &work_done, work_to_do); | 3453 | &work_done, work_to_do); |
3463 | 3454 | ||
3464 | *budget -= work_done; | 3455 | *budget -= work_done; |
@@ -3466,7 +3457,7 @@ e1000_clean(struct net_device *poll_dev, int *budget) | |||
3466 | 3457 | ||
3467 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 3458 | /* If no Tx and not enough Rx work done, exit the polling mode */ |
3468 | if ((!tx_cleaned && (work_done == 0)) || | 3459 | if ((!tx_cleaned && (work_done == 0)) || |
3469 | !netif_running(adapter->netdev)) { | 3460 | !netif_running(poll_dev)) { |
3470 | quit_polling: | 3461 | quit_polling: |
3471 | netif_rx_complete(poll_dev); | 3462 | netif_rx_complete(poll_dev); |
3472 | e1000_irq_enable(adapter); | 3463 | e1000_irq_enable(adapter); |
@@ -3681,6 +3672,9 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3681 | 3672 | ||
3682 | length = le16_to_cpu(rx_desc->length); | 3673 | length = le16_to_cpu(rx_desc->length); |
3683 | 3674 | ||
3675 | /* adjust length to remove Ethernet CRC */ | ||
3676 | length -= 4; | ||
3677 | |||
3684 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) { | 3678 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) { |
3685 | /* All receives must fit into a single buffer */ | 3679 | /* All receives must fit into a single buffer */ |
3686 | E1000_DBG("%s: Receive packet consumed multiple" | 3680 | E1000_DBG("%s: Receive packet consumed multiple" |
@@ -3885,8 +3879,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3885 | pci_dma_sync_single_for_device(pdev, | 3879 | pci_dma_sync_single_for_device(pdev, |
3886 | ps_page_dma->ps_page_dma[0], | 3880 | ps_page_dma->ps_page_dma[0], |
3887 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 3881 | PAGE_SIZE, PCI_DMA_FROMDEVICE); |
3882 | /* remove the CRC */ | ||
3883 | l1 -= 4; | ||
3888 | skb_put(skb, l1); | 3884 | skb_put(skb, l1); |
3889 | length += l1; | ||
3890 | goto copydone; | 3885 | goto copydone; |
3891 | } /* if */ | 3886 | } /* if */ |
3892 | } | 3887 | } |
@@ -3905,6 +3900,10 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3905 | skb->truesize += length; | 3900 | skb->truesize += length; |
3906 | } | 3901 | } |
3907 | 3902 | ||
3903 | /* strip the ethernet crc, problem is we're using pages now so | ||
3904 | * this whole operation can get a little cpu intensive */ | ||
3905 | pskb_trim(skb, skb->len - 4); | ||
3906 | |||
3908 | copydone: | 3907 | copydone: |
3909 | e1000_rx_checksum(adapter, staterr, | 3908 | e1000_rx_checksum(adapter, staterr, |
3910 | le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb); | 3909 | le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb); |
@@ -4752,6 +4751,7 @@ static void | |||
4752 | e1000_netpoll(struct net_device *netdev) | 4751 | e1000_netpoll(struct net_device *netdev) |
4753 | { | 4752 | { |
4754 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4753 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4754 | |||
4755 | disable_irq(adapter->pdev->irq); | 4755 | disable_irq(adapter->pdev->irq); |
4756 | e1000_intr(adapter->pdev->irq, netdev, NULL); | 4756 | e1000_intr(adapter->pdev->irq, netdev, NULL); |
4757 | e1000_clean_tx_irq(adapter, adapter->tx_ring); | 4757 | e1000_clean_tx_irq(adapter, adapter->tx_ring); |