ixgbe: fix panic when shutting down system with WoL enabled
Subsystems (2)
PATCH 1/3 ixgbe: fix panic when shutting down system with WoL enabled
From: Andy Gospodarek <[email protected]>
This patch added to 2.6.34:
commit 5f6c01819979afbfec7e0b15fe52371b8eed87e8 Author: Jesse Brandeburg <[email protected]> Date: Wed Apr 14 16:04:23 2010 -0700 ixgbe: fix bug with vlan strip in promsic mode
among other things added a function called ixgbe_vlan_filter_enable. This new function wants to access and set some rx_ring parameters, but adapter->rx_ring has already been freed. This simply moves the free until after the access and makes __ixgbe_shutdown look more like ixgbe_remove.
---
drivers/net/ixgbe/ixgbe_main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +2 -1
@@ -5195,7 +5195,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)ixgbe_free_all_tx_resources (adapter);ixgbe_free_all_rx_resources (adapter); } -ixgbe_clear_interrupt_scheme (adapter);#ifdef CONFIG_PM retval =pci_save_state (pdev);
@@ -5230,6 +5229,8 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) *enable_wake = !!wufc; +ixgbe_clear_interrupt_scheme (adapter); +ixgbe_release_hw_control (adapter);pci_disable_device (pdev);
PATCH 2/3 ixgbe: disable tx engine before disabling tx laser
From: John Fastabend <[email protected]>
Disabling the tx laser while receiving DMA requests can hang the device. After this occurs the device is in a bad state. The GPIO bit never clears when PCI master access is disabled and a reboot is required to get the device in a good state again.
---
drivers/net/ixgbe/ixgbe_main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +4 -4
@@ -3684,10 +3684,6 @@ void ixgbe_down(struct ixgbe_adapter *adapter)/* signal that we are down to the interrupt handler */ set_bit (__IXGBE_DOWN, &adapter->state); -/* power down the optics */ -if (hw->phy.multispeed_fiber) - hw->mac.ops.disable_tx_laser (hw); -/* disable receive for all VFs and wait one second */ if (adapter->num_vfs) {/* ping all the active vfs to let them know we are going down */
@@ -3742,6 +3738,10 @@ void ixgbe_down(struct ixgbe_adapter *adapter) (IXGBE_READ_REG (hw,IXGBE_DMATXCTL ) & ~IXGBE_DMATXCTL_TE)); +/* power down the optics */ +if (hw->phy.multispeed_fiber) + hw->mac.ops.disable_tx_laser (hw); +/* clear n-tuple filters that are cached */ ethtool_ntuple_flush (netdev);
PATCH 3/3 ixgbe: skip non IPv4 packets in ATR filter
In reply to Jeff KirsherFrom: Guillaume Gaudonville <[email protected]>
In driver ixgbe, ixgbe_atr may cause crashes for non-ipv4 packets. Just add a test to check skb->protocol. It may crash on short packets due to ip_hdr() access.
---
drivers/net/ixgbe/ixgbe_main.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +3 -1
@@ -6024,7 +6024,6 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter,static void ixgbe_atr (struct ixgbe_adapter *adapter,struct sk_buff *skb,int queue,u32 tx_flags) { -/* Right now, we support IPv4 only */ struct ixgbe_atr_input atr_input;struct tcphdr *th;struct iphdr *iph =ip_hdr (skb);
@@ -6033,6 +6032,9 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,u32 src_ipv4_addr, dst_ipv4_addr;u8 l4type =0 ; +/* Right now, we support IPv4 only */ +if (skb->protocol !=htons (ETH_P_IP )) +return ;/* check if we're UDP or TCP */ if (iph->protocol ==IPPROTO_TCP ) { th =tcp_hdr (skb);
From: Jeff Kirsher <[email protected]>
Date: Tue, 29 Jun 2010 21:28:12 -0700
Quoted 16 lines
From: Andy Gospodarek <[email protected]>
This patch added to 2.6.34:
commit 5f6c01819979afbfec7e0b15fe52371b8eed87e8 Author: Jesse Brandeburg <[email protected]> Date: Wed Apr 14 16:04:23 2010 -0700 ixgbe: fix bug with vlan strip in promsic modeamong other things added a function called
ixgbe_vlan_filter_enable. This new function wants to access and set somerx_ringparameters, butadapter->rx_ringhas already been freed. This simply moves the free until after the access and makes__ixgbe_shutdownlook more likeixgbe_remove.
Quoted 4 lines
Signed-off-by Andy Gospodarek <[email protected]>Acked-by Jesse Brandeburg <[email protected]>Tested-by Emil Tantilov <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
Re: [net-2.6 PATCH 2/3] ixgbe: disable tx engine before disabling tx laser
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Tue, 29 Jun 2010 21:28:36 -0700
Quoted 11 lines
From: John Fastabend <[email protected]>
Disabling the tx laser while receiving DMA requests can hang the device. After this occurs the device is in a bad state. The GPIO bit never clears when PCI master access is disabled and a reboot is required to get the device in a good state again.
Signed-off-by John Fastabend <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
Re: [net-2.6 PATCH 3/3] ixgbe: skip non IPv4 packets in ATR filter
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Tue, 29 Jun 2010 21:29:00 -0700
Quoted 10 lines
From: Guillaume Gaudonville <[email protected]>
In driver ixgbe,
ixgbe_atrmay cause crashes for non-ipv4 packets. Just add a test to checkskb->protocol. It may crash on short packets due toip_hdr()access.Signed-off-by Guillaume Gaudonville <[email protected]>Signed-off-by Don Skidmore <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.