diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2011-07-15 03:29:49 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-09-16 00:29:11 -0400 |
commit | 8e34d1aacc942586f39f91c0707d5bc7bc2532bb (patch) | |
tree | b810876b0845f5081632c927ab1d4e54cfc93f34 | |
parent | 8132b54e46259cfc6579ba11c5e3efffda64110b (diff) |
ixgbe: cleanup configuration of EITRSEL and VF reset path
This change is meant to cleanup some of the code related to SR-IOV and the
interrupt registers. Specifically I am moving the EITRSEL configuration
into the MSI-X configuration section instead of enablement. Also I am
fixing the VF shutdown path since it had operations in the incorrect order.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 6378d7f123c5..0ee7d094ff89 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1516,6 +1516,12 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter) | |||
1516 | 1516 | ||
1517 | q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 1517 | q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
1518 | 1518 | ||
1519 | /* Populate MSIX to EITR Select */ | ||
1520 | if (adapter->num_vfs > 32) { | ||
1521 | u32 eitrsel = (1 << (adapter->num_vfs - 32)) - 1; | ||
1522 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, eitrsel); | ||
1523 | } | ||
1524 | |||
1519 | /* | 1525 | /* |
1520 | * Populate the IVAR table and set the ITR values to the | 1526 | * Populate the IVAR table and set the ITR values to the |
1521 | * corresponding register. | 1527 | * corresponding register. |
@@ -2130,11 +2136,6 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues, | |||
2130 | ixgbe_irq_enable_queues(adapter, ~0); | 2136 | ixgbe_irq_enable_queues(adapter, ~0); |
2131 | if (flush) | 2137 | if (flush) |
2132 | IXGBE_WRITE_FLUSH(&adapter->hw); | 2138 | IXGBE_WRITE_FLUSH(&adapter->hw); |
2133 | |||
2134 | if (adapter->num_vfs > 32) { | ||
2135 | u32 eitrsel = (1 << (adapter->num_vfs - 32)) - 1; | ||
2136 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, eitrsel); | ||
2137 | } | ||
2138 | } | 2139 | } |
2139 | 2140 | ||
2140 | /** | 2141 | /** |
@@ -2313,8 +2314,6 @@ static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) | |||
2313 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); | 2314 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); |
2314 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); | 2315 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); |
2315 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); | 2316 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); |
2316 | if (adapter->num_vfs > 32) | ||
2317 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, 0); | ||
2318 | break; | 2317 | break; |
2319 | default: | 2318 | default: |
2320 | break; | 2319 | break; |
@@ -3863,17 +3862,19 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3863 | 3862 | ||
3864 | del_timer_sync(&adapter->service_timer); | 3863 | del_timer_sync(&adapter->service_timer); |
3865 | 3864 | ||
3866 | /* disable receive for all VFs and wait one second */ | ||
3867 | if (adapter->num_vfs) { | 3865 | if (adapter->num_vfs) { |
3866 | /* Clear EITR Select mapping */ | ||
3867 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, 0); | ||
3868 | |||
3869 | /* Mark all the VFs as inactive */ | ||
3870 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
3871 | adapter->vfinfo[i].clear_to_send = 0; | ||
3872 | |||
3868 | /* ping all the active vfs to let them know we are going down */ | 3873 | /* ping all the active vfs to let them know we are going down */ |
3869 | ixgbe_ping_all_vfs(adapter); | 3874 | ixgbe_ping_all_vfs(adapter); |
3870 | 3875 | ||
3871 | /* Disable all VFTE/VFRE TX/RX */ | 3876 | /* Disable all VFTE/VFRE TX/RX */ |
3872 | ixgbe_disable_tx_rx(adapter); | 3877 | ixgbe_disable_tx_rx(adapter); |
3873 | |||
3874 | /* Mark all the VFs as inactive */ | ||
3875 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
3876 | adapter->vfinfo[i].clear_to_send = 0; | ||
3877 | } | 3878 | } |
3878 | 3879 | ||
3879 | /* disable transmits in the hardware now that interrupts are off */ | 3880 | /* disable transmits in the hardware now that interrupts are off */ |