diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2011-04-22 00:08:14 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-05-14 21:08:46 -0400 |
commit | 34cecbbfad5a01050604d5b12fd7d7fb02597dbe (patch) | |
tree | 590fdb6dbec2747e8ef7b7a1cc513da66a3a765b /drivers/net/ixgbe | |
parent | f0f9778d043481f3cded693849e3b88b01fbc69b (diff) |
ixgbe: cleanup some minor issues in ixgbe_down()
This patch cleans up two minor issues in ixgbe_down. Specifically it
addresses the fact that the VFs should not be pinged until after interrupts
are disabled otherwise they might still get a response. It also drops the
use of the txdctl temporary variable since the only bit we should be
writing to the TXDCTL registers during a shutdown is the flush bit.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index dad56e15d4f9..4be2af22d69b 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -4182,26 +4182,12 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
4182 | struct net_device *netdev = adapter->netdev; | 4182 | struct net_device *netdev = adapter->netdev; |
4183 | struct ixgbe_hw *hw = &adapter->hw; | 4183 | struct ixgbe_hw *hw = &adapter->hw; |
4184 | u32 rxctrl; | 4184 | u32 rxctrl; |
4185 | u32 txdctl; | ||
4186 | int i; | 4185 | int i; |
4187 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 4186 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
4188 | 4187 | ||
4189 | /* signal that we are down to the interrupt handler */ | 4188 | /* signal that we are down to the interrupt handler */ |
4190 | set_bit(__IXGBE_DOWN, &adapter->state); | 4189 | set_bit(__IXGBE_DOWN, &adapter->state); |
4191 | 4190 | ||
4192 | /* disable receive for all VFs and wait one second */ | ||
4193 | if (adapter->num_vfs) { | ||
4194 | /* ping all the active vfs to let them know we are going down */ | ||
4195 | ixgbe_ping_all_vfs(adapter); | ||
4196 | |||
4197 | /* Disable all VFTE/VFRE TX/RX */ | ||
4198 | ixgbe_disable_tx_rx(adapter); | ||
4199 | |||
4200 | /* Mark all the VFs as inactive */ | ||
4201 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
4202 | adapter->vfinfo[i].clear_to_send = 0; | ||
4203 | } | ||
4204 | |||
4205 | /* disable receives */ | 4191 | /* disable receives */ |
4206 | rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); | 4192 | rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); |
4207 | IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl & ~IXGBE_RXCTRL_RXEN); | 4193 | IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl & ~IXGBE_RXCTRL_RXEN); |
@@ -4229,6 +4215,19 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
4229 | 4215 | ||
4230 | del_timer_sync(&adapter->service_timer); | 4216 | del_timer_sync(&adapter->service_timer); |
4231 | 4217 | ||
4218 | /* disable receive for all VFs and wait one second */ | ||
4219 | if (adapter->num_vfs) { | ||
4220 | /* ping all the active vfs to let them know we are going down */ | ||
4221 | ixgbe_ping_all_vfs(adapter); | ||
4222 | |||
4223 | /* Disable all VFTE/VFRE TX/RX */ | ||
4224 | ixgbe_disable_tx_rx(adapter); | ||
4225 | |||
4226 | /* Mark all the VFs as inactive */ | ||
4227 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
4228 | adapter->vfinfo[i].clear_to_send = 0; | ||
4229 | } | ||
4230 | |||
4232 | /* Cleanup the affinity_hint CPU mask memory and callback */ | 4231 | /* Cleanup the affinity_hint CPU mask memory and callback */ |
4233 | for (i = 0; i < num_q_vectors; i++) { | 4232 | for (i = 0; i < num_q_vectors; i++) { |
4234 | struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; | 4233 | struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; |
@@ -4241,11 +4240,10 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
4241 | /* disable transmits in the hardware now that interrupts are off */ | 4240 | /* disable transmits in the hardware now that interrupts are off */ |
4242 | for (i = 0; i < adapter->num_tx_queues; i++) { | 4241 | for (i = 0; i < adapter->num_tx_queues; i++) { |
4243 | u8 reg_idx = adapter->tx_ring[i]->reg_idx; | 4242 | u8 reg_idx = adapter->tx_ring[i]->reg_idx; |
4244 | txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(reg_idx)); | 4243 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), IXGBE_TXDCTL_SWFLSH); |
4245 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), | ||
4246 | (txdctl & ~IXGBE_TXDCTL_ENABLE)); | ||
4247 | } | 4244 | } |
4248 | /* Disable the Tx DMA engine on 82599 */ | 4245 | |
4246 | /* Disable the Tx DMA engine on 82599 and X540 */ | ||
4249 | switch (hw->mac.type) { | 4247 | switch (hw->mac.type) { |
4250 | case ixgbe_mac_82599EB: | 4248 | case ixgbe_mac_82599EB: |
4251 | case ixgbe_mac_X540: | 4249 | case ixgbe_mac_X540: |