e100, e1000: Fixes for netdev-2.6#upstream-fixes
Subsystems (2)
cover e100, e1000: Fixes for netdev-2.6#upstream-fixes
Hi,
The following fixes targeted to netdev-2.6#upstream-fixes are available through git:
git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 upstream-fixes
And apply against 4a1d2d81fa327d095a0a8a1f961bace5b0a2f7da
Cheers,
Auke
---
Jesse Brandeburg <[email protected]>:
e1000: FIX: don't poke at manageability registers for incompatible adapters
e1000: FIX: disable LPE for IPV6, only enable for jumbo frames
e1000: FIX: Don't limit descriptor size to 4kb for PCI-E adapters
e1000: FIX: move length adjustment due to crc stripping disabled.
Bruce Allan <[email protected]>:
e1000: FIX: fix wrong txdctl threshold bitmasks
Auke Kok <[email protected]>:
e1000: FIX: 82542 doesn't support WoL
e1000: Increment version to 7.2.9-k4
e100: FIX: fix netconsole fast reboot attached to e100---
drivers/net/e100.c | 52 +++++++++++++++++++++++--------------- drivers/net/e1000/e1000_ethtool.c | 4 ++ drivers/net/e1000/e1000_hw.h | 6 ++-- drivers/net/e1000/e1000_main.c | 41 ++++++++++++++++++++--------- 4 files changed, 66 insertions(+), 37 deletions(-)
---
Auke Kok <[email protected]>
PATCH 1/8 e1000: FIX: don't poke at manageability registers for incompatible adapters
The MANC register should not be read for PCI-E adapters at all, as well as 82543 and older where 82543 would master abort when this register was accessed.
---
drivers/net/e1000/e1000_ethtool.c | 3 ++- drivers/net/e1000/e1000_main.c | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/net/e1000/e1000_ethtool.c +2 -1
@@ -461,7 +461,8 @@ e1000_get_regs(struct net_device *netdev regs_buff[24 ] = (uint32_t )phy_data;/* phy local receiver status */ regs_buff[25 ] = regs_buff[24 ];/* phy remote receiver status */ if (hw->mac_type >= e1000_82540 && - hw->media_type == e1000_media_type_copper) { + hw->mac_type < e1000_82571 && + hw->media_type == e1000_media_type_copper) { regs_buff[26 ] =E1000_READ_REG (hw,MANC ); } }
drivers/net/e1000/e1000_main.c +14 -7
@@ -699,7 +699,10 @@ e1000_reset(struct e1000_adapter *adapte phy_data); } -if ((adapter->en_mng_pt) && (adapter->hw.mac_type < e1000_82571)) { +if ((adapter->en_mng_pt) && + (adapter->hw.mac_type >= e1000_82540) && + (adapter->hw.mac_type < e1000_82571) && + (adapter->hw.media_type == e1000_media_type_copper)) { manc =E1000_READ_REG (&adapter->hw,MANC ); manc |= (E1000_MANC_ARP_EN |E1000_MANC_EN_MNG2HOST );E1000_WRITE_REG (&adapter->hw,MANC , manc);
@@ -1076,8 +1079,9 @@ e1000_remove(struct pci_dev *pdev)flush_scheduled_work (); -if (adapter->hw.mac_type < e1000_82571 && - adapter->hw.media_type == e1000_media_type_copper) { +if (adapter->hw.mac_type >= e1000_82540 && + adapter->hw.mac_type < e1000_82571 && + adapter->hw.media_type == e1000_media_type_copper) { manc =E1000_READ_REG (&adapter->hw,MANC );if (manc &E1000_MANC_SMBUS_EN ) { manc |=E1000_MANC_ARP_EN ;
@@ -4773,8 +4777,9 @@ e1000_suspend(struct pci_dev *pdev, pm_mpci_enable_wake (pdev, PCI_D3cold,0 ); } -if (adapter->hw.mac_type < e1000_82571 && - adapter->hw.media_type == e1000_media_type_copper) { +if (adapter->hw.mac_type >= e1000_82540 && + adapter->hw.mac_type < e1000_82571 && + adapter->hw.media_type == e1000_media_type_copper) { manc =E1000_READ_REG (&adapter->hw,MANC );if (manc &E1000_MANC_SMBUS_EN ) { manc |=E1000_MANC_ARP_EN ;
@@ -4825,8 +4830,9 @@ e1000_resume(struct pci_dev *pdev)netif_device_attach (netdev); -if (adapter->hw.mac_type < e1000_82571 && - adapter->hw.media_type == e1000_media_type_copper) { +if (adapter->hw.mac_type >= e1000_82540 && + adapter->hw.mac_type < e1000_82571 && + adapter->hw.media_type == e1000_media_type_copper) { manc =E1000_READ_REG (&adapter->hw,MANC ); manc &= ~(E1000_MANC_ARP_EN );E1000_WRITE_REG (&adapter->hw,MANC , manc);
@@ -4948,6 +4954,7 @@ static void e1000_io_resume(struct pci_dnetif_device_attach (netdev);if (adapter->hw.mac_type >= e1000_82540 && + adapter->hw.mac_type < e1000_82571 && adapter->hw.media_type == e1000_media_type_copper) { manc =E1000_READ_REG (&adapter->hw,MANC ); manc &= ~(E1000_MANC_ARP_EN );
---
Auke Kok <[email protected]>
PATCH 2/8 e1000: FIX: 82542 doesn't support WoL
In reply to Kok, AukeExclude 82542 when setting up WoL. This card does not do WoL at all.
---
drivers/net/e1000/e1000_ethtool.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/e1000/e1000_ethtool.c +1 -0
@@ -1691,6 +1691,7 @@ static int e1000_wol_exclusion(struct e1int retval =1 ;/* fail by default */ switch (hw->device_id) { +case E1000_DEV_ID_82542 :case E1000_DEV_ID_82543GC_FIBER :case E1000_DEV_ID_82543GC_COPPER :case E1000_DEV_ID_82544EI_FIBER :
---
Auke Kok <[email protected]>
PATCH 3/8 e1000: FIX: fix wrong txdctl threshold bitmasks
In reply to Kok, AukeThreshold bitmasks for prefetch, host and writeback were clearing bits that they were not supposed to. The leftmost 2 bits in the byte for each threshold are reserved.
---
drivers/net/e1000/e1000_hw.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/e1000_hw.h +3 -3
@@ -1961,9 +1961,9 @@ struct e1000_hw {#define E1000_RXDCTL_GRAN 0x01000000/* RXDCTL Granularity */ /* Transmit Descriptor Control */ -#define E1000_TXDCTL_PTHRESH 0x000000FF/* TXDCTL Prefetch Threshold */ -#define E1000_TXDCTL_HTHRESH 0x0000FF00/* TXDCTL Host Threshold */ -#define E1000_TXDCTL_WTHRESH 0x00FF0000/* TXDCTL Writeback Threshold */ +#define E1000_TXDCTL_PTHRESH 0x0000003F/* TXDCTL Prefetch Threshold */ +#define E1000_TXDCTL_HTHRESH 0x00003F00/* TXDCTL Host Threshold */ +#define E1000_TXDCTL_WTHRESH 0x003F0000/* TXDCTL Writeback Threshold */ #define E1000_TXDCTL_GRAN 0x01000000/* TXDCTL Granularity */ #define E1000_TXDCTL_LWTHRESH 0xFE000000/* TXDCTL Low Threshold */ #define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000/* GRAN=1, WTHRESH=1 */
---
Auke Kok <[email protected]>
PATCH 4/8 e1000: FIX: disable LPE for IPV6, only enable for jumbo frames
In reply to Kok, AukeAllocations using alloc_page are taking too long for normal MTU, so use LPE only for jumbo frames. Disable packet split for IPV6 extension headers since malformed headers can hang the RX.
Signed-off-bu: Jesse Brandeburg <[email protected]>
---
drivers/net/e1000/e1000_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/e1000/e1000_main.c +4 -2
@@ -1808,9 +1808,11 @@ e1000_setup_rctl(struct e1000_adapter *a* followed by the page buffers. Therefore, skb->data is * sized to hold the largest protocol header. */ +/* allocations using alloc_page take too long for regular MTU +* so only enable packet split for jumbo frames */ pages =PAGE_USE_COUNT (adapter->netdev->mtu); -if ((adapter->hw.mac_type > e1000_82547_rev_2) && (pages <=3 ) && -PAGE_SIZE <=16384 ) +if ((adapter->hw.mac_type >= e1000_82571) && (pages <=3 ) && +PAGE_SIZE <=16384 && (rctl &E1000_RCTL_LPE )) adapter->rx_ps_pages = pages;else adapter->rx_ps_pages =0 ;
---
Auke Kok <[email protected]>
PATCH 5/8 e1000: FIX: Don't limit descriptor size to 4kb for PCI-E adapters
In reply to Kok, Auke82571 and newer chispets don't need to limit desc. length to 4kb and can handle 8kb sizes.
---
drivers/net/e1000/e1000_main.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/e1000/e1000_main.c +5 -0
@@ -2992,6 +2992,11 @@ e1000_xmit_frame(struct sk_buff *skb, streturn NETDEV_TX_OK ; } +/* 82571 and newer doesn't need the workaround that limited descriptor +* length to 4kB */ +if (adapter->hw.mac_type >= e1000_82571) + max_per_txd =8192 ; +#ifdef NETIF_F_TSO mss =skb_shinfo (skb)->gso_size;/* The controller does a simple calculation to
---
Auke Kok <[email protected]>
PATCH 6/8 e1000: FIX: move length adjustment due to crc stripping disabled.
In reply to Kok, AukeMove the length (rx_bytes counter) adjustment of 4 bytes down to after the TBI_ACCEPT workaround.
---
drivers/net/e1000/e1000_main.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/e1000/e1000_main.c +4 -3
@@ -3786,9 +3786,6 @@ e1000_clean_rx_irq(struct e1000_adapter length =le16_to_cpu (rx_desc->length); -/* adjust length to remove Ethernet CRC */ - length -=4 ; -if (unlikely (!(status &E1000_RXD_STAT_EOP ))) {/* All receives must fit into a single buffer */ E1000_DBG("%s: Receive packet consumed multiple"
@@ -3816,6 +3813,10 @@ e1000_clean_rx_irq(struct e1000_adapter } } +/* adjust length to remove Ethernet CRC, this must be +* done after the TBI_ACCEPT workaround above */ + length -=4 ; +/* code added for copybreak, this should improve * performance for small packets with large amounts * of reassembly being done in the stack */
---
Auke Kok <[email protected]>
PATCH 7/8 e1000: Increment version to 7.2.9-k4
In reply to Kok, AukeSignificant fixes -> increment driver version.
---
drivers/net/e1000/e1000_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/e1000/e1000_main.c +1 -1
@@ -35,7 +35,7 @@ static char e1000_driver_string[] = "Int#else #define DRIVERNAPI "-NAPI"#endif -#define DRV_VERSION "7.2.9-k2"DRIVERNAPI +#define DRV_VERSION "7.2.9-k4"DRIVERNAPIchar e1000_driver_version[] =DRV_VERSION ;static char e1000_copyright[] ="Copyright (c) 1999-2006 Intel Corporation." ;
---
Auke Kok <[email protected]>
PATCH 8/8 e100: FIX: fix netconsole fast reboot attached to e100
In reply to Kok, AukeWhen rebooting with netconsole over e100, the driver shutdown code would deadlock with netpoll. Reduce shutdown code to a bare minimum while retaining WoL functionality.
---
drivers/net/e100.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 20 deletions(-)
drivers/net/e100.c +32 -20
@@ -159,7 +159,7 @@#define DRV_NAME "e100"#define DRV_EXT "-NAPI" -#define DRV_VERSION "3.5.17-k2"DRV_EXT +#define DRV_VERSION "3.5.17-k4"DRV_EXT#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation"#define PFX DRV_NAME ": "
@@ -2039,7 +2039,6 @@ static int e100_change_mtu(struct net_dereturn 0 ; } -#ifdef CONFIG_PM static int e100_asf (struct nic *nic) {/* ASF can be enabled from eeprom */
@@ -2048,7 +2047,6 @@ static int e100_asf(struct nic *nic) !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE)); } -#endif static int e100_up (struct nic *nic) {
@@ -2715,34 +2713,32 @@ static void __devexit e100_remove(struct } } +#ifdef CONFIG_PM static int e100_suspend (struct pci_dev *pdev,pm_message_t state) {struct net_device *netdev =pci_get_drvdata (pdev);struct nic *nic =netdev_priv (netdev); -if (netif_running (netdev)) -e100_down (nic); -e100_hw_reset (nic); -netif_device_detach (netdev); +netif_poll_disable (nic->netdev); +del_timer_sync (&nic->watchdog); +netif_carrier_off (nic->netdev); -#ifdef CONFIG_PMpci_save_state (pdev); - if (nic->flags & (wol_magic | e100_asf(nic))) -#else - if (nic->flags & (wol_magic)) -#endif - pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); - else - /* disable PME */ - pci_enable_wake(pdev, 0, 0); + +if ((nic->flags & wol_magic) |e100_asf (nic)) { +pci_enable_wake (pdev, PCI_D3hot,1 ); +pci_enable_wake (pdev, PCI_D3cold,1 ); + }else { +pci_enable_wake (pdev, PCI_D3hot,0 ); +pci_enable_wake (pdev, PCI_D3cold,0 ); + }pci_disable_device (pdev); - pci_set_power_state(pdev, pci_choose_state(pdev, state)); +pci_set_power_state (pdev, PCI_D3hot);return 0 ; } -#ifdef CONFIG_PMstatic int e100_resume (struct pci_dev *pdev) {struct net_device *netdev =pci_get_drvdata (pdev);
@@ -2764,7 +2760,23 @@ static int e100_resume(struct pci_dev *pstatic void e100_shutdown (struct pci_dev *pdev) { -e100_suspend (pdev,PMSG_SUSPEND ); +struct net_device *netdev =pci_get_drvdata (pdev); +struct nic *nic =netdev_priv (netdev); + +netif_poll_disable (nic->netdev); +del_timer_sync (&nic->watchdog); +netif_carrier_off (nic->netdev); + +if ((nic->flags & wol_magic) |e100_asf (nic)) { +pci_enable_wake (pdev, PCI_D3hot,1 ); +pci_enable_wake (pdev, PCI_D3cold,1 ); + }else { +pci_enable_wake (pdev, PCI_D3hot,0 ); +pci_enable_wake (pdev, PCI_D3cold,0 ); + } + +pci_disable_device (pdev); +pci_set_power_state (pdev, PCI_D3hot); }/* ------------------ PCI Error Recovery infrastructure -------------- */
@@ -2848,9 +2860,9 @@ static struct pci_driver e100_driver = { .id_table = e100_id_table, .probe = e100_probe, .remove =__devexit_p (e100_remove), +#ifdef CONFIG_PM/* Power Management hooks */ .suspend = e100_suspend, -#ifdef CONFIG_PM .resume = e100_resume, #endif .shutdown = e100_shutdown,
---
Auke Kok <[email protected]>
Quoted 6 lines · Auke
Hi,
The following fixes targeted to netdev-2.6#upstream-fixes are available through git:
git pull
git://lost.foo-projects.org/~ahkok/git/netdev-2.6upstream-fixes
hrm. since another e100 fixes got applied, can you either (a) update the above URL for that change, or (b) provide separate e100 and e1000 pull urls?
Jeff
Quoted 9 lines · Jeff Garzik
Quoted 6 lines · Auke
Hi,
The following fixes targeted to netdev-2.6#upstream-fixes are available through git:
git pull
git://lost.foo-projects.org/~ahkok/git/netdev-2.6upstream-fixeshrm. since another e100 fixes got applied, can you either (a) update the above URL for that change, or (b) provide separate e100 and e1000 pull urls?
I dropped the e100 patch from the series, it now contains (at the above url) only the e1000 changes.
Cheers,
Auke
please pull from git://lost.foo-projects.org/~ahkok/git/netdev-2.6 upstream-fixes
Quoted 4 lines · Auke Kok
Quoted 3 lines · Jeff Garzik
Quoted 2 lines · Auke
Hi,
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
The following fixes targeted to netdev-2.6#upstream-fixes are available through git:
git pull
git://lost.foo-projects.org/~ahkok/git/netdev-2.6upstream-fixeshrm. since another e100 fixes got applied, can you either (a) update the above URL for that change, or (b) provide separate e100 and e1000 pull urls?
I dropped the e100 patch from the series, it now contains (at the above url) only the e1000 changes.
okay, I've rebased the trees on the latest upstream-fixes and master from netdev-2.6, and on top of that added the latest e100 shutdown patch to it (see below).
Jeff,
Please pull from git://lost.foo-projects.org/~ahkok/git/netdev-2.6
upstream-fixes in to your #upstream-fixes or #upstream-linus branch so that these
fixes get into 2.6.19.
Thanks.
Auke
---
e100: account for closed interface when shutting down
From: Auke Kok <[email protected]>
Account for the interface being closed before disabling polling on a device, to fix shutdown on some systems that explcitly close the netdevice before calling shutdown.
---
drivers/net/e100.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/e100.c +8 -2
@@ -2719,7 +2719,10 @@ static int e100_suspend(struct pci_dev *struct net_device *netdev =pci_get_drvdata (pdev);struct nic *nic =netdev_priv (netdev); -netif_poll_disable (nic->netdev); +#ifdef CONFIG_E100_NAPI +if (netif_running (netdev)) +netif_poll_disable (nic->netdev); +#endif del_timer_sync (&nic->watchdog);netif_carrier_off (nic->netdev);
@@ -2763,7 +2766,10 @@ static void e100_shutdown(struct pci_devstruct net_device *netdev =pci_get_drvdata (pdev);struct nic *nic =netdev_priv (netdev); -netif_poll_disable (nic->netdev); +#ifdef CONFIG_E100_NAPI +if (netif_running (netdev)) +netif_poll_disable (nic->netdev); +#endif del_timer_sync (&nic->watchdog);netif_carrier_off (nic->netdev);