diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2013-01-25 01:19:20 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-02-16 02:51:14 -0500 |
commit | 67da097e1295071da700862e7faa8a294b182b42 (patch) | |
tree | a8806aac14268ff4aaca79c2e1be483b2481eb55 /drivers/net/ethernet/intel | |
parent | 71858acbe5c38e82554d92d041741ea949e46b99 (diff) |
ixgbe: fix Tx timeouts with BQL
This patch makes sure that TXDCTL.WTHRESH is set to 1 when BQL is enabled
and EITR is set to more than 100k interrupts per second to avoid Tx timeouts.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 33 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 |
2 files changed, 34 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index e6cebdc58def..f4d2e9e3c6d5 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -2113,13 +2113,17 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
2113 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 2113 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
2114 | struct ixgbe_q_vector *q_vector; | 2114 | struct ixgbe_q_vector *q_vector; |
2115 | int i; | 2115 | int i; |
2116 | u16 tx_itr_param, rx_itr_param; | 2116 | u16 tx_itr_param, rx_itr_param, tx_itr_prev; |
2117 | bool need_reset = false; | 2117 | bool need_reset = false; |
2118 | 2118 | ||
2119 | /* don't accept tx specific changes if we've got mixed RxTx vectors */ | 2119 | if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count) { |
2120 | if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count | 2120 | /* reject Tx specific changes in case of mixed RxTx vectors */ |
2121 | && ec->tx_coalesce_usecs) | 2121 | if (ec->tx_coalesce_usecs) |
2122 | return -EINVAL; | 2122 | return -EINVAL; |
2123 | tx_itr_prev = adapter->rx_itr_setting; | ||
2124 | } else { | ||
2125 | tx_itr_prev = adapter->tx_itr_setting; | ||
2126 | } | ||
2123 | 2127 | ||
2124 | if ((ec->rx_coalesce_usecs > (IXGBE_MAX_EITR >> 2)) || | 2128 | if ((ec->rx_coalesce_usecs > (IXGBE_MAX_EITR >> 2)) || |
2125 | (ec->tx_coalesce_usecs > (IXGBE_MAX_EITR >> 2))) | 2129 | (ec->tx_coalesce_usecs > (IXGBE_MAX_EITR >> 2))) |
@@ -2145,8 +2149,25 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
2145 | else | 2149 | else |
2146 | tx_itr_param = adapter->tx_itr_setting; | 2150 | tx_itr_param = adapter->tx_itr_setting; |
2147 | 2151 | ||
2152 | /* mixed Rx/Tx */ | ||
2153 | if (adapter->q_vector[0]->tx.count && adapter->q_vector[0]->rx.count) | ||
2154 | adapter->tx_itr_setting = adapter->rx_itr_setting; | ||
2155 | |||
2156 | #if IS_ENABLED(CONFIG_BQL) | ||
2157 | /* detect ITR changes that require update of TXDCTL.WTHRESH */ | ||
2158 | if ((adapter->tx_itr_setting > 1) && | ||
2159 | (adapter->tx_itr_setting < IXGBE_100K_ITR)) { | ||
2160 | if ((tx_itr_prev == 1) || | ||
2161 | (tx_itr_prev > IXGBE_100K_ITR)) | ||
2162 | need_reset = true; | ||
2163 | } else { | ||
2164 | if ((tx_itr_prev > 1) && | ||
2165 | (tx_itr_prev < IXGBE_100K_ITR)) | ||
2166 | need_reset = true; | ||
2167 | } | ||
2168 | #endif | ||
2148 | /* check the old value and enable RSC if necessary */ | 2169 | /* check the old value and enable RSC if necessary */ |
2149 | need_reset = ixgbe_update_rsc(adapter); | 2170 | need_reset |= ixgbe_update_rsc(adapter); |
2150 | 2171 | ||
2151 | for (i = 0; i < adapter->num_q_vectors; i++) { | 2172 | for (i = 0; i < adapter->num_q_vectors; i++) { |
2152 | q_vector = adapter->q_vector[i]; | 2173 | q_vector = adapter->q_vector[i]; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index b0b72fccb86b..68478d6dfa2d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -2786,13 +2786,19 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter, | |||
2786 | 2786 | ||
2787 | /* | 2787 | /* |
2788 | * set WTHRESH to encourage burst writeback, it should not be set | 2788 | * set WTHRESH to encourage burst writeback, it should not be set |
2789 | * higher than 1 when ITR is 0 as it could cause false TX hangs | 2789 | * higher than 1 when: |
2790 | * - ITR is 0 as it could cause false TX hangs | ||
2791 | * - ITR is set to > 100k int/sec and BQL is enabled | ||
2790 | * | 2792 | * |
2791 | * In order to avoid issues WTHRESH + PTHRESH should always be equal | 2793 | * In order to avoid issues WTHRESH + PTHRESH should always be equal |
2792 | * to or less than the number of on chip descriptors, which is | 2794 | * to or less than the number of on chip descriptors, which is |
2793 | * currently 40. | 2795 | * currently 40. |
2794 | */ | 2796 | */ |
2797 | #if IS_ENABLED(CONFIG_BQL) | ||
2798 | if (!ring->q_vector || (ring->q_vector->itr < IXGBE_100K_ITR)) | ||
2799 | #else | ||
2795 | if (!ring->q_vector || (ring->q_vector->itr < 8)) | 2800 | if (!ring->q_vector || (ring->q_vector->itr < 8)) |
2801 | #endif | ||
2796 | txdctl |= (1 << 16); /* WTHRESH = 1 */ | 2802 | txdctl |= (1 << 16); /* WTHRESH = 1 */ |
2797 | else | 2803 | else |
2798 | txdctl |= (8 << 16); /* WTHRESH = 8 */ | 2804 | txdctl |= (8 << 16); /* WTHRESH = 8 */ |