aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000.h7
-rw-r--r--drivers/net/e1000/e1000_ethtool.c6
-rw-r--r--drivers/net/e1000/e1000_main.c128
-rw-r--r--drivers/net/e1000/e1000_osdep.h4
-rw-r--r--drivers/net/e1000/e1000_param.c15
5 files changed, 51 insertions, 109 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index f091042b146e..689f158a469e 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -59,17 +59,13 @@
59#include <linux/capability.h> 59#include <linux/capability.h>
60#include <linux/in.h> 60#include <linux/in.h>
61#include <linux/ip.h> 61#include <linux/ip.h>
62#ifdef NETIF_F_TSO6
63#include <linux/ipv6.h> 62#include <linux/ipv6.h>
64#endif
65#include <linux/tcp.h> 63#include <linux/tcp.h>
66#include <linux/udp.h> 64#include <linux/udp.h>
67#include <net/pkt_sched.h> 65#include <net/pkt_sched.h>
68#include <linux/list.h> 66#include <linux/list.h>
69#include <linux/reboot.h> 67#include <linux/reboot.h>
70#ifdef NETIF_F_TSO
71#include <net/checksum.h> 68#include <net/checksum.h>
72#endif
73#include <linux/mii.h> 69#include <linux/mii.h>
74#include <linux/ethtool.h> 70#include <linux/ethtool.h>
75#include <linux/if_vlan.h> 71#include <linux/if_vlan.h>
@@ -257,7 +253,6 @@ struct e1000_adapter {
257 spinlock_t tx_queue_lock; 253 spinlock_t tx_queue_lock;
258#endif 254#endif
259 atomic_t irq_sem; 255 atomic_t irq_sem;
260 unsigned int detect_link;
261 unsigned int total_tx_bytes; 256 unsigned int total_tx_bytes;
262 unsigned int total_tx_packets; 257 unsigned int total_tx_packets;
263 unsigned int total_rx_bytes; 258 unsigned int total_rx_bytes;
@@ -348,9 +343,7 @@ struct e1000_adapter {
348 boolean_t have_msi; 343 boolean_t have_msi;
349#endif 344#endif
350 /* to not mess up cache alignment, always add to the bottom */ 345 /* to not mess up cache alignment, always add to the bottom */
351#ifdef NETIF_F_TSO
352 boolean_t tso_force; 346 boolean_t tso_force;
353#endif
354 boolean_t smart_power_down; /* phy smart power down */ 347 boolean_t smart_power_down; /* phy smart power down */
355 boolean_t quad_port_a; 348 boolean_t quad_port_a;
356 unsigned long flags; 349 unsigned long flags;
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index fb96c87f9e56..44ebc72962dc 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -338,7 +338,6 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data)
338 return 0; 338 return 0;
339} 339}
340 340
341#ifdef NETIF_F_TSO
342static int 341static int
343e1000_set_tso(struct net_device *netdev, uint32_t data) 342e1000_set_tso(struct net_device *netdev, uint32_t data)
344{ 343{
@@ -352,18 +351,15 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
352 else 351 else
353 netdev->features &= ~NETIF_F_TSO; 352 netdev->features &= ~NETIF_F_TSO;
354 353
355#ifdef NETIF_F_TSO6
356 if (data) 354 if (data)
357 netdev->features |= NETIF_F_TSO6; 355 netdev->features |= NETIF_F_TSO6;
358 else 356 else
359 netdev->features &= ~NETIF_F_TSO6; 357 netdev->features &= ~NETIF_F_TSO6;
360#endif
361 358
362 DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); 359 DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
363 adapter->tso_force = TRUE; 360 adapter->tso_force = TRUE;
364 return 0; 361 return 0;
365} 362}
366#endif /* NETIF_F_TSO */
367 363
368static uint32_t 364static uint32_t
369e1000_get_msglevel(struct net_device *netdev) 365e1000_get_msglevel(struct net_device *netdev)
@@ -1971,10 +1967,8 @@ static const struct ethtool_ops e1000_ethtool_ops = {
1971 .set_tx_csum = e1000_set_tx_csum, 1967 .set_tx_csum = e1000_set_tx_csum,
1972 .get_sg = ethtool_op_get_sg, 1968 .get_sg = ethtool_op_get_sg,
1973 .set_sg = ethtool_op_set_sg, 1969 .set_sg = ethtool_op_set_sg,
1974#ifdef NETIF_F_TSO
1975 .get_tso = ethtool_op_get_tso, 1970 .get_tso = ethtool_op_get_tso,
1976 .set_tso = e1000_set_tso, 1971 .set_tso = e1000_set_tso,
1977#endif
1978 .self_test_count = e1000_diag_test_count, 1972 .self_test_count = e1000_diag_test_count,
1979 .self_test = e1000_diag_test, 1973 .self_test = e1000_diag_test,
1980 .get_strings = e1000_get_strings, 1974 .get_strings = e1000_get_strings,
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8424a8e4cbb0..619c89218b4b 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.3.15-k2"DRIVERNAPI 39#define DRV_VERSION "7.3.20-k2"DRIVERNAPI
40char e1000_driver_version[] = DRV_VERSION; 40char e1000_driver_version[] = DRV_VERSION;
41static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; 41static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
42 42
@@ -990,16 +990,12 @@ e1000_probe(struct pci_dev *pdev,
990 netdev->features &= ~NETIF_F_HW_VLAN_FILTER; 990 netdev->features &= ~NETIF_F_HW_VLAN_FILTER;
991 } 991 }
992 992
993#ifdef NETIF_F_TSO
994 if ((adapter->hw.mac_type >= e1000_82544) && 993 if ((adapter->hw.mac_type >= e1000_82544) &&
995 (adapter->hw.mac_type != e1000_82547)) 994 (adapter->hw.mac_type != e1000_82547))
996 netdev->features |= NETIF_F_TSO; 995 netdev->features |= NETIF_F_TSO;
997 996
998#ifdef NETIF_F_TSO6
999 if (adapter->hw.mac_type > e1000_82547_rev_2) 997 if (adapter->hw.mac_type > e1000_82547_rev_2)
1000 netdev->features |= NETIF_F_TSO6; 998 netdev->features |= NETIF_F_TSO6;
1001#endif
1002#endif
1003 if (pci_using_dac) 999 if (pci_using_dac)
1004 netdev->features |= NETIF_F_HIGHDMA; 1000 netdev->features |= NETIF_F_HIGHDMA;
1005 1001
@@ -2583,15 +2579,22 @@ e1000_watchdog(unsigned long data)
2583 2579
2584 if (link) { 2580 if (link) {
2585 if (!netif_carrier_ok(netdev)) { 2581 if (!netif_carrier_ok(netdev)) {
2582 uint32_t ctrl;
2586 boolean_t txb2b = 1; 2583 boolean_t txb2b = 1;
2587 e1000_get_speed_and_duplex(&adapter->hw, 2584 e1000_get_speed_and_duplex(&adapter->hw,
2588 &adapter->link_speed, 2585 &adapter->link_speed,
2589 &adapter->link_duplex); 2586 &adapter->link_duplex);
2590 2587
2591 DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s\n", 2588 ctrl = E1000_READ_REG(&adapter->hw, CTRL);
2592 adapter->link_speed, 2589 DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s, "
2593 adapter->link_duplex == FULL_DUPLEX ? 2590 "Flow Control: %s\n",
2594 "Full Duplex" : "Half Duplex"); 2591 adapter->link_speed,
2592 adapter->link_duplex == FULL_DUPLEX ?
2593 "Full Duplex" : "Half Duplex",
2594 ((ctrl & E1000_CTRL_TFCE) && (ctrl &
2595 E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
2596 E1000_CTRL_RFCE) ? "RX" : ((ctrl &
2597 E1000_CTRL_TFCE) ? "TX" : "None" )));
2595 2598
2596 /* tweak tx_queue_len according to speed/duplex 2599 /* tweak tx_queue_len according to speed/duplex
2597 * and adjust the timeout factor */ 2600 * and adjust the timeout factor */
@@ -2619,7 +2622,6 @@ e1000_watchdog(unsigned long data)
2619 E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); 2622 E1000_WRITE_REG(&adapter->hw, TARC0, tarc0);
2620 } 2623 }
2621 2624
2622#ifdef NETIF_F_TSO
2623 /* disable TSO for pcie and 10/100 speeds, to avoid 2625 /* disable TSO for pcie and 10/100 speeds, to avoid
2624 * some hardware issues */ 2626 * some hardware issues */
2625 if (!adapter->tso_force && 2627 if (!adapter->tso_force &&
@@ -2630,22 +2632,17 @@ e1000_watchdog(unsigned long data)
2630 DPRINTK(PROBE,INFO, 2632 DPRINTK(PROBE,INFO,
2631 "10/100 speed: disabling TSO\n"); 2633 "10/100 speed: disabling TSO\n");
2632 netdev->features &= ~NETIF_F_TSO; 2634 netdev->features &= ~NETIF_F_TSO;
2633#ifdef NETIF_F_TSO6
2634 netdev->features &= ~NETIF_F_TSO6; 2635 netdev->features &= ~NETIF_F_TSO6;
2635#endif
2636 break; 2636 break;
2637 case SPEED_1000: 2637 case SPEED_1000:
2638 netdev->features |= NETIF_F_TSO; 2638 netdev->features |= NETIF_F_TSO;
2639#ifdef NETIF_F_TSO6
2640 netdev->features |= NETIF_F_TSO6; 2639 netdev->features |= NETIF_F_TSO6;
2641#endif
2642 break; 2640 break;
2643 default: 2641 default:
2644 /* oops */ 2642 /* oops */
2645 break; 2643 break;
2646 } 2644 }
2647 } 2645 }
2648#endif
2649 2646
2650 /* enable transmits in the hardware, need to do this 2647 /* enable transmits in the hardware, need to do this
2651 * after setting TARC0 */ 2648 * after setting TARC0 */
@@ -2875,7 +2872,6 @@ static int
2875e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, 2872e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2876 struct sk_buff *skb) 2873 struct sk_buff *skb)
2877{ 2874{
2878#ifdef NETIF_F_TSO
2879 struct e1000_context_desc *context_desc; 2875 struct e1000_context_desc *context_desc;
2880 struct e1000_buffer *buffer_info; 2876 struct e1000_buffer *buffer_info;
2881 unsigned int i; 2877 unsigned int i;
@@ -2904,7 +2900,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2904 0); 2900 0);
2905 cmd_length = E1000_TXD_CMD_IP; 2901 cmd_length = E1000_TXD_CMD_IP;
2906 ipcse = skb->h.raw - skb->data - 1; 2902 ipcse = skb->h.raw - skb->data - 1;
2907#ifdef NETIF_F_TSO6
2908 } else if (skb->protocol == htons(ETH_P_IPV6)) { 2903 } else if (skb->protocol == htons(ETH_P_IPV6)) {
2909 skb->nh.ipv6h->payload_len = 0; 2904 skb->nh.ipv6h->payload_len = 0;
2910 skb->h.th->check = 2905 skb->h.th->check =
@@ -2914,7 +2909,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2914 IPPROTO_TCP, 2909 IPPROTO_TCP,
2915 0); 2910 0);
2916 ipcse = 0; 2911 ipcse = 0;
2917#endif
2918 } 2912 }
2919 ipcss = skb->nh.raw - skb->data; 2913 ipcss = skb->nh.raw - skb->data;
2920 ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data; 2914 ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
@@ -2947,8 +2941,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2947 2941
2948 return TRUE; 2942 return TRUE;
2949 } 2943 }
2950#endif
2951
2952 return FALSE; 2944 return FALSE;
2953} 2945}
2954 2946
@@ -2968,8 +2960,9 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
2968 buffer_info = &tx_ring->buffer_info[i]; 2960 buffer_info = &tx_ring->buffer_info[i];
2969 context_desc = E1000_CONTEXT_DESC(*tx_ring, i); 2961 context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
2970 2962
2963 context_desc->lower_setup.ip_config = 0;
2971 context_desc->upper_setup.tcp_fields.tucss = css; 2964 context_desc->upper_setup.tcp_fields.tucss = css;
2972 context_desc->upper_setup.tcp_fields.tucso = css + skb->csum_offset; 2965 context_desc->upper_setup.tcp_fields.tucso = css + skb->csum;
2973 context_desc->upper_setup.tcp_fields.tucse = 0; 2966 context_desc->upper_setup.tcp_fields.tucse = 0;
2974 context_desc->tcp_seg_setup.data = 0; 2967 context_desc->tcp_seg_setup.data = 0;
2975 context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT); 2968 context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT);
@@ -3005,7 +2998,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3005 while (len) { 2998 while (len) {
3006 buffer_info = &tx_ring->buffer_info[i]; 2999 buffer_info = &tx_ring->buffer_info[i];
3007 size = min(len, max_per_txd); 3000 size = min(len, max_per_txd);
3008#ifdef NETIF_F_TSO
3009 /* Workaround for Controller erratum -- 3001 /* Workaround for Controller erratum --
3010 * descriptor for non-tso packet in a linear SKB that follows a 3002 * descriptor for non-tso packet in a linear SKB that follows a
3011 * tso gets written back prematurely before the data is fully 3003 * tso gets written back prematurely before the data is fully
@@ -3020,7 +3012,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3020 * in TSO mode. Append 4-byte sentinel desc */ 3012 * in TSO mode. Append 4-byte sentinel desc */
3021 if (unlikely(mss && !nr_frags && size == len && size > 8)) 3013 if (unlikely(mss && !nr_frags && size == len && size > 8))
3022 size -= 4; 3014 size -= 4;
3023#endif
3024 /* work-around for errata 10 and it applies 3015 /* work-around for errata 10 and it applies
3025 * to all controllers in PCI-X mode 3016 * to all controllers in PCI-X mode
3026 * The fix is to make sure that the first descriptor of a 3017 * The fix is to make sure that the first descriptor of a
@@ -3062,12 +3053,10 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
3062 while (len) { 3053 while (len) {
3063 buffer_info = &tx_ring->buffer_info[i]; 3054 buffer_info = &tx_ring->buffer_info[i];
3064 size = min(len, max_per_txd); 3055 size = min(len, max_per_txd);
3065#ifdef NETIF_F_TSO
3066 /* Workaround for premature desc write-backs 3056 /* Workaround for premature desc write-backs
3067 * in TSO mode. Append 4-byte sentinel desc */ 3057 * in TSO mode. Append 4-byte sentinel desc */
3068 if (unlikely(mss && f == (nr_frags-1) && size == len && size > 8)) 3058 if (unlikely(mss && f == (nr_frags-1) && size == len && size > 8))
3069 size -= 4; 3059 size -= 4;
3070#endif
3071 /* Workaround for potential 82544 hang in PCI-X. 3060 /* Workaround for potential 82544 hang in PCI-X.
3072 * Avoid terminating buffers within evenly-aligned 3061 * Avoid terminating buffers within evenly-aligned
3073 * dwords. */ 3062 * dwords. */
@@ -3292,7 +3281,6 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3292 if (adapter->hw.mac_type >= e1000_82571) 3281 if (adapter->hw.mac_type >= e1000_82571)
3293 max_per_txd = 8192; 3282 max_per_txd = 8192;
3294 3283
3295#ifdef NETIF_F_TSO
3296 mss = skb_shinfo(skb)->gso_size; 3284 mss = skb_shinfo(skb)->gso_size;
3297 /* The controller does a simple calculation to 3285 /* The controller does a simple calculation to
3298 * make sure there is enough room in the FIFO before 3286 * make sure there is enough room in the FIFO before
@@ -3346,16 +3334,10 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3346 if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL)) 3334 if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
3347 count++; 3335 count++;
3348 count++; 3336 count++;
3349#else
3350 if (skb->ip_summed == CHECKSUM_PARTIAL)
3351 count++;
3352#endif
3353 3337
3354#ifdef NETIF_F_TSO
3355 /* Controller Erratum workaround */ 3338 /* Controller Erratum workaround */
3356 if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb)) 3339 if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
3357 count++; 3340 count++;
3358#endif
3359 3341
3360 count += TXD_USE_COUNT(len, max_txd_pwr); 3342 count += TXD_USE_COUNT(len, max_txd_pwr);
3361 3343
@@ -3765,8 +3747,8 @@ e1000_update_stats(struct e1000_adapter *adapter)
3765 * @data: pointer to a network interface device structure 3747 * @data: pointer to a network interface device structure
3766 **/ 3748 **/
3767 3749
3768static 3750static irqreturn_t
3769irqreturn_t e1000_intr_msi(int irq, void *data) 3751e1000_intr_msi(int irq, void *data)
3770{ 3752{
3771 struct net_device *netdev = data; 3753 struct net_device *netdev = data;
3772 struct e1000_adapter *adapter = netdev_priv(netdev); 3754 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3774,49 +3756,27 @@ irqreturn_t e1000_intr_msi(int irq, void *data)
3774#ifndef CONFIG_E1000_NAPI 3756#ifndef CONFIG_E1000_NAPI
3775 int i; 3757 int i;
3776#endif 3758#endif
3759 uint32_t icr = E1000_READ_REG(hw, ICR);
3777 3760
3778 /* this code avoids the read of ICR but has to get 1000 interrupts
3779 * at every link change event before it will notice the change */
3780 if (++adapter->detect_link >= 1000) {
3781 uint32_t icr = E1000_READ_REG(hw, ICR);
3782#ifdef CONFIG_E1000_NAPI 3761#ifdef CONFIG_E1000_NAPI
3783 /* read ICR disables interrupts using IAM, so keep up with our 3762 /* read ICR disables interrupts using IAM, so keep up with our
3784 * enable/disable accounting */ 3763 * enable/disable accounting */
3785 atomic_inc(&adapter->irq_sem); 3764 atomic_inc(&adapter->irq_sem);
3786#endif 3765#endif
3787 adapter->detect_link = 0; 3766 if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
3788 if ((icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) && 3767 hw->get_link_status = 1;
3789 (icr & E1000_ICR_INT_ASSERTED)) { 3768 /* 80003ES2LAN workaround-- For packet buffer work-around on
3790 hw->get_link_status = 1; 3769 * link down event; disable receives here in the ISR and reset
3791 /* 80003ES2LAN workaround-- 3770 * adapter in watchdog */
3792 * For packet buffer work-around on link down event; 3771 if (netif_carrier_ok(netdev) &&
3793 * disable receives here in the ISR and 3772 (adapter->hw.mac_type == e1000_80003es2lan)) {
3794 * reset adapter in watchdog 3773 /* disable receives */
3795 */ 3774 uint32_t rctl = E1000_READ_REG(hw, RCTL);
3796 if (netif_carrier_ok(netdev) && 3775 E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
3797 (adapter->hw.mac_type == e1000_80003es2lan)) {
3798 /* disable receives */
3799 uint32_t rctl = E1000_READ_REG(hw, RCTL);
3800 E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
3801 }
3802 /* guard against interrupt when we're going down */
3803 if (!test_bit(__E1000_DOWN, &adapter->flags))
3804 mod_timer(&adapter->watchdog_timer,
3805 jiffies + 1);
3806 } 3776 }
3807 } else { 3777 /* guard against interrupt when we're going down */
3808 E1000_WRITE_REG(hw, ICR, (0xffffffff & ~(E1000_ICR_RXSEQ | 3778 if (!test_bit(__E1000_DOWN, &adapter->flags))
3809 E1000_ICR_LSC))); 3779 mod_timer(&adapter->watchdog_timer, jiffies + 1);
3810 /* bummer we have to flush here, but things break otherwise as
3811 * some event appears to be lost or delayed and throughput
3812 * drops. In almost all tests this flush is un-necessary */
3813 E1000_WRITE_FLUSH(hw);
3814#ifdef CONFIG_E1000_NAPI
3815 /* Interrupt Auto-Mask (IAM)...upon writing ICR, interrupts are
3816 * masked. No need for the IMC write, but it does mean we
3817 * should account for it ASAP. */
3818 atomic_inc(&adapter->irq_sem);
3819#endif
3820 } 3780 }
3821 3781
3822#ifdef CONFIG_E1000_NAPI 3782#ifdef CONFIG_E1000_NAPI
@@ -3836,7 +3796,7 @@ irqreturn_t e1000_intr_msi(int irq, void *data)
3836 3796
3837 for (i = 0; i < E1000_MAX_INTR; i++) 3797 for (i = 0; i < E1000_MAX_INTR; i++)
3838 if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring) & 3798 if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring) &
3839 !e1000_clean_tx_irq(adapter, adapter->tx_ring))) 3799 e1000_clean_tx_irq(adapter, adapter->tx_ring)))
3840 break; 3800 break;
3841 3801
3842 if (likely(adapter->itr_setting & 3)) 3802 if (likely(adapter->itr_setting & 3))
@@ -3939,7 +3899,7 @@ e1000_intr(int irq, void *data)
3939 3899
3940 for (i = 0; i < E1000_MAX_INTR; i++) 3900 for (i = 0; i < E1000_MAX_INTR; i++)
3941 if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring) & 3901 if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring) &
3942 !e1000_clean_tx_irq(adapter, adapter->tx_ring))) 3902 e1000_clean_tx_irq(adapter, adapter->tx_ring)))
3943 break; 3903 break;
3944 3904
3945 if (likely(adapter->itr_setting & 3)) 3905 if (likely(adapter->itr_setting & 3))
@@ -3989,7 +3949,7 @@ e1000_clean(struct net_device *poll_dev, int *budget)
3989 poll_dev->quota -= work_done; 3949 poll_dev->quota -= work_done;
3990 3950
3991 /* If no Tx and not enough Rx work done, exit the polling mode */ 3951 /* If no Tx and not enough Rx work done, exit the polling mode */
3992 if ((!tx_cleaned && (work_done == 0)) || 3952 if ((tx_cleaned && (work_done < work_to_do)) ||
3993 !netif_running(poll_dev)) { 3953 !netif_running(poll_dev)) {
3994quit_polling: 3954quit_polling:
3995 if (likely(adapter->itr_setting & 3)) 3955 if (likely(adapter->itr_setting & 3))
@@ -4019,7 +3979,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4019#ifdef CONFIG_E1000_NAPI 3979#ifdef CONFIG_E1000_NAPI
4020 unsigned int count = 0; 3980 unsigned int count = 0;
4021#endif 3981#endif
4022 boolean_t cleaned = FALSE; 3982 boolean_t cleaned = TRUE;
4023 unsigned int total_tx_bytes=0, total_tx_packets=0; 3983 unsigned int total_tx_bytes=0, total_tx_packets=0;
4024 3984
4025 i = tx_ring->next_to_clean; 3985 i = tx_ring->next_to_clean;
@@ -4034,10 +3994,13 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4034 3994
4035 if (cleaned) { 3995 if (cleaned) {
4036 struct sk_buff *skb = buffer_info->skb; 3996 struct sk_buff *skb = buffer_info->skb;
4037 unsigned int segs = skb_shinfo(skb)->gso_segs; 3997 unsigned int segs, bytecount;
3998 segs = skb_shinfo(skb)->gso_segs ?: 1;
3999 /* multiply data chunks by size of headers */
4000 bytecount = ((segs - 1) * skb_headlen(skb)) +
4001 skb->len;
4038 total_tx_packets += segs; 4002 total_tx_packets += segs;
4039 total_tx_packets++; 4003 total_tx_bytes += bytecount;
4040 total_tx_bytes += skb->len;
4041 } 4004 }
4042 e1000_unmap_and_free_tx_resource(adapter, buffer_info); 4005 e1000_unmap_and_free_tx_resource(adapter, buffer_info);
4043 tx_desc->upper.data = 0; 4006 tx_desc->upper.data = 0;
@@ -4050,7 +4013,10 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
4050#ifdef CONFIG_E1000_NAPI 4013#ifdef CONFIG_E1000_NAPI
4051#define E1000_TX_WEIGHT 64 4014#define E1000_TX_WEIGHT 64
4052 /* weight of a sort for tx, to avoid endless transmit cleanup */ 4015 /* weight of a sort for tx, to avoid endless transmit cleanup */
4053 if (count++ == E1000_TX_WEIGHT) break; 4016 if (count++ == E1000_TX_WEIGHT) {
4017 cleaned = FALSE;
4018 break;
4019 }
4054#endif 4020#endif
4055 } 4021 }
4056 4022
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index 18afc0c25dac..10af742d8a20 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -48,8 +48,6 @@ typedef enum {
48 TRUE = 1 48 TRUE = 1
49} boolean_t; 49} boolean_t;
50 50
51#define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B)
52
53#ifdef DBG 51#ifdef DBG
54#define DEBUGOUT(S) printk(KERN_DEBUG S "\n") 52#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
55#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A) 53#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
@@ -58,7 +56,7 @@ typedef enum {
58#define DEBUGOUT1(S, A...) 56#define DEBUGOUT1(S, A...)
59#endif 57#endif
60 58
61#define DEBUGFUNC(F) DEBUGOUT(F) 59#define DEBUGFUNC(F) DEBUGOUT(F "\n")
62#define DEBUGOUT2 DEBUGOUT1 60#define DEBUGOUT2 DEBUGOUT1
63#define DEBUGOUT3 DEBUGOUT2 61#define DEBUGOUT3 DEBUGOUT2
64#define DEBUGOUT7 DEBUGOUT3 62#define DEBUGOUT7 DEBUGOUT3
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index cf2a279307e1..f8862e203ac9 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -760,22 +760,13 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
760 case SPEED_1000: 760 case SPEED_1000:
761 DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without " 761 DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without "
762 "Duplex\n"); 762 "Duplex\n");
763 DPRINTK(PROBE, INFO, 763 goto full_duplex_only;
764 "Using Autonegotiation at 1000 Mbps "
765 "Full Duplex only\n");
766 adapter->hw.autoneg = adapter->fc_autoneg = 1;
767 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
768 break;
769 case SPEED_1000 + HALF_DUPLEX: 764 case SPEED_1000 + HALF_DUPLEX:
770 DPRINTK(PROBE, INFO, 765 DPRINTK(PROBE, INFO,
771 "Half Duplex is not supported at 1000 Mbps\n"); 766 "Half Duplex is not supported at 1000 Mbps\n");
772 DPRINTK(PROBE, INFO, 767 /* fall through */
773 "Using Autonegotiation at 1000 Mbps "
774 "Full Duplex only\n");
775 adapter->hw.autoneg = adapter->fc_autoneg = 1;
776 adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
777 break;
778 case SPEED_1000 + FULL_DUPLEX: 768 case SPEED_1000 + FULL_DUPLEX:
769full_duplex_only:
779 DPRINTK(PROBE, INFO, 770 DPRINTK(PROBE, INFO,
780 "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); 771 "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
781 adapter->hw.autoneg = adapter->fc_autoneg = 1; 772 adapter->hw.autoneg = adapter->fc_autoneg = 1;