diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-09-11 22:58:14 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-24 18:54:54 -0400 |
commit | 30efa5a363d18f1c284455879cb67fb1bf547bdc (patch) | |
tree | 114f01ea6cf674bd14354e706d32a1ad47877ade /drivers/net/ixgbe | |
parent | 3d3d6d3cc2ad1e77516f3ad3f79d5988ebc361cf (diff) |
ixgbe: fix initial interrupt throttle settings
ixgbe was incorrectly setting the throttle rate setting for all tx
queues and the driver has been refreshed to better handle a dynamic
interrupt mode as well as multiple queues.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 23 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 86 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 80 |
3 files changed, 100 insertions, 89 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 2b827a67c9c5..5ba03845c3e3 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -62,11 +62,6 @@ | |||
62 | #define IXGBE_MAX_RXQ 1 | 62 | #define IXGBE_MAX_RXQ 1 |
63 | #define IXGBE_MIN_RXQ 1 | 63 | #define IXGBE_MIN_RXQ 1 |
64 | 64 | ||
65 | #define IXGBE_DEFAULT_ITR_RX_USECS 125 /* 8k irqs/sec */ | ||
66 | #define IXGBE_DEFAULT_ITR_TX_USECS 250 /* 4k irqs/sec */ | ||
67 | #define IXGBE_MIN_ITR_USECS 100 /* 500k irqs/sec */ | ||
68 | #define IXGBE_MAX_ITR_USECS 10000 /* 100 irqs/sec */ | ||
69 | |||
70 | /* flow control */ | 65 | /* flow control */ |
71 | #define IXGBE_DEFAULT_FCRTL 0x10000 | 66 | #define IXGBE_DEFAULT_FCRTL 0x10000 |
72 | #define IXGBE_MIN_FCRTL 0x40 | 67 | #define IXGBE_MIN_FCRTL 0x40 |
@@ -161,10 +156,7 @@ struct ixgbe_ring { | |||
161 | * vector array, can also be used for finding the bit in EICR | 156 | * vector array, can also be used for finding the bit in EICR |
162 | * and friends that represents the vector for this ring */ | 157 | * and friends that represents the vector for this ring */ |
163 | 158 | ||
164 | u32 eims_value; | ||
165 | u16 itr_register; | ||
166 | 159 | ||
167 | char name[IFNAMSIZ + 5]; | ||
168 | u16 work_limit; /* max work per interrupt */ | 160 | u16 work_limit; /* max work per interrupt */ |
169 | u16 rx_buf_len; | 161 | u16 rx_buf_len; |
170 | }; | 162 | }; |
@@ -191,8 +183,8 @@ struct ixgbe_q_vector { | |||
191 | DECLARE_BITMAP(txr_idx, MAX_TX_QUEUES); /* Tx ring indices */ | 183 | DECLARE_BITMAP(txr_idx, MAX_TX_QUEUES); /* Tx ring indices */ |
192 | u8 rxr_count; /* Rx ring count assigned to this vector */ | 184 | u8 rxr_count; /* Rx ring count assigned to this vector */ |
193 | u8 txr_count; /* Tx ring count assigned to this vector */ | 185 | u8 txr_count; /* Tx ring count assigned to this vector */ |
194 | u8 tx_eitr; | 186 | u8 tx_itr; |
195 | u8 rx_eitr; | 187 | u8 rx_itr; |
196 | u32 eitr; | 188 | u32 eitr; |
197 | }; | 189 | }; |
198 | 190 | ||
@@ -240,7 +232,9 @@ struct ixgbe_adapter { | |||
240 | 232 | ||
241 | /* TX */ | 233 | /* TX */ |
242 | struct ixgbe_ring *tx_ring; /* One per active queue */ | 234 | struct ixgbe_ring *tx_ring; /* One per active queue */ |
235 | int num_tx_queues; | ||
243 | u64 restart_queue; | 236 | u64 restart_queue; |
237 | u64 hw_csum_tx_good; | ||
244 | u64 lsc_int; | 238 | u64 lsc_int; |
245 | u64 hw_tso_ctxt; | 239 | u64 hw_tso_ctxt; |
246 | u64 hw_tso6_ctxt; | 240 | u64 hw_tso6_ctxt; |
@@ -249,12 +243,10 @@ struct ixgbe_adapter { | |||
249 | 243 | ||
250 | /* RX */ | 244 | /* RX */ |
251 | struct ixgbe_ring *rx_ring; /* One per active queue */ | 245 | struct ixgbe_ring *rx_ring; /* One per active queue */ |
252 | u64 hw_csum_tx_good; | 246 | int num_rx_queues; |
253 | u64 hw_csum_rx_error; | 247 | u64 hw_csum_rx_error; |
254 | u64 hw_csum_rx_good; | 248 | u64 hw_csum_rx_good; |
255 | u64 non_eop_descs; | 249 | u64 non_eop_descs; |
256 | int num_tx_queues; | ||
257 | int num_rx_queues; | ||
258 | int num_msix_vectors; | 250 | int num_msix_vectors; |
259 | struct ixgbe_ring_feature ring_feature[3]; | 251 | struct ixgbe_ring_feature ring_feature[3]; |
260 | struct msix_entry *msix_entries; | 252 | struct msix_entry *msix_entries; |
@@ -301,14 +293,15 @@ struct ixgbe_adapter { | |||
301 | struct ixgbe_hw_stats stats; | 293 | struct ixgbe_hw_stats stats; |
302 | 294 | ||
303 | /* Interrupt Throttle Rate */ | 295 | /* Interrupt Throttle Rate */ |
304 | u32 rx_eitr; | 296 | u32 eitr_param; |
305 | u32 tx_eitr; | ||
306 | 297 | ||
307 | unsigned long state; | 298 | unsigned long state; |
308 | u64 tx_busy; | 299 | u64 tx_busy; |
309 | u64 lro_aggregated; | 300 | u64 lro_aggregated; |
310 | u64 lro_flushed; | 301 | u64 lro_flushed; |
311 | u64 lro_no_desc; | 302 | u64 lro_no_desc; |
303 | unsigned int tx_ring_count; | ||
304 | unsigned int rx_ring_count; | ||
312 | 305 | ||
313 | u32 link_speed; | 306 | u32 link_speed; |
314 | bool link_up; | 307 | bool link_up; |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 2506f9eae58e..f18e3daaf4f5 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -880,17 +880,23 @@ static int ixgbe_get_coalesce(struct net_device *netdev, | |||
880 | { | 880 | { |
881 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 881 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
882 | 882 | ||
883 | if (adapter->rx_eitr < IXGBE_MIN_ITR_USECS) | ||
884 | ec->rx_coalesce_usecs = adapter->rx_eitr; | ||
885 | else | ||
886 | ec->rx_coalesce_usecs = 1000000 / adapter->rx_eitr; | ||
887 | |||
888 | if (adapter->tx_eitr < IXGBE_MIN_ITR_USECS) | ||
889 | ec->tx_coalesce_usecs = adapter->tx_eitr; | ||
890 | else | ||
891 | ec->tx_coalesce_usecs = 1000000 / adapter->tx_eitr; | ||
892 | |||
893 | ec->tx_max_coalesced_frames_irq = adapter->tx_ring[0].work_limit; | 883 | ec->tx_max_coalesced_frames_irq = adapter->tx_ring[0].work_limit; |
884 | |||
885 | /* only valid if in constant ITR mode */ | ||
886 | switch (adapter->itr_setting) { | ||
887 | case 0: | ||
888 | /* throttling disabled */ | ||
889 | ec->rx_coalesce_usecs = 0; | ||
890 | break; | ||
891 | case 1: | ||
892 | /* dynamic ITR mode */ | ||
893 | ec->rx_coalesce_usecs = 1; | ||
894 | break; | ||
895 | default: | ||
896 | /* fixed interrupt rate mode */ | ||
897 | ec->rx_coalesce_usecs = 1000000/adapter->eitr_param; | ||
898 | break; | ||
899 | } | ||
894 | return 0; | 900 | return 0; |
895 | } | 901 | } |
896 | 902 | ||
@@ -898,38 +904,40 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
898 | struct ethtool_coalesce *ec) | 904 | struct ethtool_coalesce *ec) |
899 | { | 905 | { |
900 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 906 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
901 | 907 | struct ixgbe_hw *hw = &adapter->hw; | |
902 | if ((ec->rx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || | 908 | int i; |
903 | ((ec->rx_coalesce_usecs != 0) && | ||
904 | (ec->rx_coalesce_usecs != 1) && | ||
905 | (ec->rx_coalesce_usecs != 3) && | ||
906 | (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) | ||
907 | return -EINVAL; | ||
908 | if ((ec->tx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || | ||
909 | ((ec->tx_coalesce_usecs != 0) && | ||
910 | (ec->tx_coalesce_usecs != 1) && | ||
911 | (ec->tx_coalesce_usecs != 3) && | ||
912 | (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) | ||
913 | return -EINVAL; | ||
914 | |||
915 | /* convert to rate of irq's per second */ | ||
916 | if (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS) | ||
917 | adapter->rx_eitr = ec->rx_coalesce_usecs; | ||
918 | else | ||
919 | adapter->rx_eitr = (1000000 / ec->rx_coalesce_usecs); | ||
920 | |||
921 | if (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS) | ||
922 | adapter->tx_eitr = ec->rx_coalesce_usecs; | ||
923 | else | ||
924 | adapter->tx_eitr = (1000000 / ec->tx_coalesce_usecs); | ||
925 | 909 | ||
926 | if (ec->tx_max_coalesced_frames_irq) | 910 | if (ec->tx_max_coalesced_frames_irq) |
927 | adapter->tx_ring[0].work_limit = | 911 | adapter->tx_ring[0].work_limit = ec->tx_max_coalesced_frames_irq; |
928 | ec->tx_max_coalesced_frames_irq; | 912 | |
913 | if (ec->rx_coalesce_usecs > 1) { | ||
914 | /* store the value in ints/second */ | ||
915 | adapter->eitr_param = 1000000/ec->rx_coalesce_usecs; | ||
916 | |||
917 | /* static value of interrupt rate */ | ||
918 | adapter->itr_setting = adapter->eitr_param; | ||
919 | /* clear the lower bit */ | ||
920 | adapter->itr_setting &= ~1; | ||
921 | } else if (ec->rx_coalesce_usecs == 1) { | ||
922 | /* 1 means dynamic mode */ | ||
923 | adapter->eitr_param = 20000; | ||
924 | adapter->itr_setting = 1; | ||
925 | } else { | ||
926 | /* any other value means disable eitr, which is best | ||
927 | * served by setting the interrupt rate very high */ | ||
928 | adapter->eitr_param = 3000000; | ||
929 | adapter->itr_setting = 0; | ||
930 | } | ||
929 | 931 | ||
930 | if (netif_running(netdev)) { | 932 | for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) { |
931 | ixgbe_down(adapter); | 933 | struct ixgbe_q_vector *q_vector = &adapter->q_vector[i]; |
932 | ixgbe_up(adapter); | 934 | if (q_vector->txr_count && !q_vector->rxr_count) |
935 | q_vector->eitr = (adapter->eitr_param >> 1); | ||
936 | else | ||
937 | /* rx only or mixed */ | ||
938 | q_vector->eitr = adapter->eitr_param; | ||
939 | IXGBE_WRITE_REG(hw, IXGBE_EITR(i), | ||
940 | EITR_INTS_PER_SEC_TO_REG(q_vector->eitr)); | ||
933 | } | 941 | } |
934 | 942 | ||
935 | return 0; | 943 | return 0; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 0269115593e3..ef965c996848 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -744,12 +744,12 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter) | |||
744 | r_idx + 1); | 744 | r_idx + 1); |
745 | } | 745 | } |
746 | 746 | ||
747 | /* if this is a tx only vector use half the irq (tx) rate */ | 747 | /* if this is a tx only vector halve the interrupt rate */ |
748 | if (q_vector->txr_count && !q_vector->rxr_count) | 748 | if (q_vector->txr_count && !q_vector->rxr_count) |
749 | q_vector->eitr = adapter->tx_eitr; | 749 | q_vector->eitr = (adapter->eitr_param >> 1); |
750 | else | 750 | else |
751 | /* rx only or mixed */ | 751 | /* rx only */ |
752 | q_vector->eitr = adapter->rx_eitr; | 752 | q_vector->eitr = adapter->eitr_param; |
753 | 753 | ||
754 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(v_idx), | 754 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(v_idx), |
755 | EITR_INTS_PER_SEC_TO_REG(q_vector->eitr)); | 755 | EITR_INTS_PER_SEC_TO_REG(q_vector->eitr)); |
@@ -845,13 +845,13 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector) | |||
845 | for (i = 0; i < q_vector->txr_count; i++) { | 845 | for (i = 0; i < q_vector->txr_count; i++) { |
846 | tx_ring = &(adapter->tx_ring[r_idx]); | 846 | tx_ring = &(adapter->tx_ring[r_idx]); |
847 | ret_itr = ixgbe_update_itr(adapter, q_vector->eitr, | 847 | ret_itr = ixgbe_update_itr(adapter, q_vector->eitr, |
848 | q_vector->tx_eitr, | 848 | q_vector->tx_itr, |
849 | tx_ring->total_packets, | 849 | tx_ring->total_packets, |
850 | tx_ring->total_bytes); | 850 | tx_ring->total_bytes); |
851 | /* if the result for this queue would decrease interrupt | 851 | /* if the result for this queue would decrease interrupt |
852 | * rate for this vector then use that result */ | 852 | * rate for this vector then use that result */ |
853 | q_vector->tx_eitr = ((q_vector->tx_eitr > ret_itr) ? | 853 | q_vector->tx_itr = ((q_vector->tx_itr > ret_itr) ? |
854 | q_vector->tx_eitr - 1 : ret_itr); | 854 | q_vector->tx_itr - 1 : ret_itr); |
855 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, | 855 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, |
856 | r_idx + 1); | 856 | r_idx + 1); |
857 | } | 857 | } |
@@ -860,18 +860,18 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector) | |||
860 | for (i = 0; i < q_vector->rxr_count; i++) { | 860 | for (i = 0; i < q_vector->rxr_count; i++) { |
861 | rx_ring = &(adapter->rx_ring[r_idx]); | 861 | rx_ring = &(adapter->rx_ring[r_idx]); |
862 | ret_itr = ixgbe_update_itr(adapter, q_vector->eitr, | 862 | ret_itr = ixgbe_update_itr(adapter, q_vector->eitr, |
863 | q_vector->rx_eitr, | 863 | q_vector->rx_itr, |
864 | rx_ring->total_packets, | 864 | rx_ring->total_packets, |
865 | rx_ring->total_bytes); | 865 | rx_ring->total_bytes); |
866 | /* if the result for this queue would decrease interrupt | 866 | /* if the result for this queue would decrease interrupt |
867 | * rate for this vector then use that result */ | 867 | * rate for this vector then use that result */ |
868 | q_vector->rx_eitr = ((q_vector->rx_eitr > ret_itr) ? | 868 | q_vector->rx_itr = ((q_vector->rx_itr > ret_itr) ? |
869 | q_vector->rx_eitr - 1 : ret_itr); | 869 | q_vector->rx_itr - 1 : ret_itr); |
870 | r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, | 870 | r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, |
871 | r_idx + 1); | 871 | r_idx + 1); |
872 | } | 872 | } |
873 | 873 | ||
874 | current_itr = max(q_vector->rx_eitr, q_vector->tx_eitr); | 874 | current_itr = max(q_vector->rx_itr, q_vector->tx_itr); |
875 | 875 | ||
876 | switch (current_itr) { | 876 | switch (current_itr) { |
877 | /* counts and packets in update_itr are dependent on these numbers */ | 877 | /* counts and packets in update_itr are dependent on these numbers */ |
@@ -970,16 +970,24 @@ static irqreturn_t ixgbe_msix_clean_rx(int irq, void *data) | |||
970 | struct ixgbe_adapter *adapter = q_vector->adapter; | 970 | struct ixgbe_adapter *adapter = q_vector->adapter; |
971 | struct ixgbe_ring *rx_ring; | 971 | struct ixgbe_ring *rx_ring; |
972 | int r_idx; | 972 | int r_idx; |
973 | int i; | ||
973 | 974 | ||
974 | r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); | 975 | r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); |
976 | for (i = 0; i < q_vector->rxr_count; i++) { | ||
977 | rx_ring = &(adapter->rx_ring[r_idx]); | ||
978 | rx_ring->total_bytes = 0; | ||
979 | rx_ring->total_packets = 0; | ||
980 | r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, | ||
981 | r_idx + 1); | ||
982 | } | ||
983 | |||
975 | if (!q_vector->rxr_count) | 984 | if (!q_vector->rxr_count) |
976 | return IRQ_HANDLED; | 985 | return IRQ_HANDLED; |
977 | 986 | ||
987 | r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); | ||
978 | rx_ring = &(adapter->rx_ring[r_idx]); | 988 | rx_ring = &(adapter->rx_ring[r_idx]); |
979 | /* disable interrupts on this vector only */ | 989 | /* disable interrupts on this vector only */ |
980 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, rx_ring->v_idx); | 990 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, rx_ring->v_idx); |
981 | rx_ring->total_bytes = 0; | ||
982 | rx_ring->total_packets = 0; | ||
983 | netif_rx_schedule(adapter->netdev, &q_vector->napi); | 991 | netif_rx_schedule(adapter->netdev, &q_vector->napi); |
984 | 992 | ||
985 | return IRQ_HANDLED; | 993 | return IRQ_HANDLED; |
@@ -1020,7 +1028,7 @@ static int ixgbe_clean_rxonly(struct napi_struct *napi, int budget) | |||
1020 | /* If all Rx work done, exit the polling mode */ | 1028 | /* If all Rx work done, exit the polling mode */ |
1021 | if (work_done < budget) { | 1029 | if (work_done < budget) { |
1022 | netif_rx_complete(adapter->netdev, napi); | 1030 | netif_rx_complete(adapter->netdev, napi); |
1023 | if (adapter->rx_eitr < IXGBE_MIN_ITR_USECS) | 1031 | if (adapter->itr_setting & 3) |
1024 | ixgbe_set_itr_msix(q_vector); | 1032 | ixgbe_set_itr_msix(q_vector); |
1025 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 1033 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
1026 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, rx_ring->v_idx); | 1034 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, rx_ring->v_idx); |
@@ -1187,16 +1195,16 @@ static void ixgbe_set_itr(struct ixgbe_adapter *adapter) | |||
1187 | struct ixgbe_ring *rx_ring = &adapter->rx_ring[0]; | 1195 | struct ixgbe_ring *rx_ring = &adapter->rx_ring[0]; |
1188 | struct ixgbe_ring *tx_ring = &adapter->tx_ring[0]; | 1196 | struct ixgbe_ring *tx_ring = &adapter->tx_ring[0]; |
1189 | 1197 | ||
1190 | q_vector->tx_eitr = ixgbe_update_itr(adapter, new_itr, | 1198 | q_vector->tx_itr = ixgbe_update_itr(adapter, new_itr, |
1191 | q_vector->tx_eitr, | 1199 | q_vector->tx_itr, |
1192 | tx_ring->total_packets, | 1200 | tx_ring->total_packets, |
1193 | tx_ring->total_bytes); | 1201 | tx_ring->total_bytes); |
1194 | q_vector->rx_eitr = ixgbe_update_itr(adapter, new_itr, | 1202 | q_vector->rx_itr = ixgbe_update_itr(adapter, new_itr, |
1195 | q_vector->rx_eitr, | 1203 | q_vector->rx_itr, |
1196 | rx_ring->total_packets, | 1204 | rx_ring->total_packets, |
1197 | rx_ring->total_bytes); | 1205 | rx_ring->total_bytes); |
1198 | 1206 | ||
1199 | current_itr = max(q_vector->rx_eitr, q_vector->tx_eitr); | 1207 | current_itr = max(q_vector->rx_itr, q_vector->tx_itr); |
1200 | 1208 | ||
1201 | switch (current_itr) { | 1209 | switch (current_itr) { |
1202 | /* counts and packets in update_itr are dependent on these numbers */ | 1210 | /* counts and packets in update_itr are dependent on these numbers */ |
@@ -1371,7 +1379,7 @@ static void ixgbe_configure_msi_and_legacy(struct ixgbe_adapter *adapter) | |||
1371 | struct ixgbe_hw *hw = &adapter->hw; | 1379 | struct ixgbe_hw *hw = &adapter->hw; |
1372 | 1380 | ||
1373 | IXGBE_WRITE_REG(hw, IXGBE_EITR(0), | 1381 | IXGBE_WRITE_REG(hw, IXGBE_EITR(0), |
1374 | EITR_INTS_PER_SEC_TO_REG(adapter->rx_eitr)); | 1382 | EITR_INTS_PER_SEC_TO_REG(adapter->eitr_param)); |
1375 | 1383 | ||
1376 | ixgbe_set_ivar(adapter, IXGBE_IVAR_RX_QUEUE(0), 0); | 1384 | ixgbe_set_ivar(adapter, IXGBE_IVAR_RX_QUEUE(0), 0); |
1377 | ixgbe_set_ivar(adapter, IXGBE_IVAR_TX_QUEUE(0), 0); | 1385 | ixgbe_set_ivar(adapter, IXGBE_IVAR_TX_QUEUE(0), 0); |
@@ -2209,7 +2217,7 @@ static int ixgbe_poll(struct napi_struct *napi, int budget) | |||
2209 | /* If budget not fully consumed, exit the polling mode */ | 2217 | /* If budget not fully consumed, exit the polling mode */ |
2210 | if (work_done < budget) { | 2218 | if (work_done < budget) { |
2211 | netif_rx_complete(adapter->netdev, napi); | 2219 | netif_rx_complete(adapter->netdev, napi); |
2212 | if (adapter->rx_eitr < IXGBE_MIN_ITR_USECS) | 2220 | if (adapter->itr_setting & 3) |
2213 | ixgbe_set_itr(adapter); | 2221 | ixgbe_set_itr(adapter); |
2214 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 2222 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
2215 | ixgbe_irq_enable(adapter); | 2223 | ixgbe_irq_enable(adapter); |
@@ -2421,12 +2429,6 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter | |||
2421 | int vector, v_budget; | 2429 | int vector, v_budget; |
2422 | 2430 | ||
2423 | /* | 2431 | /* |
2424 | * Set the default interrupt throttle rate. | ||
2425 | */ | ||
2426 | adapter->rx_eitr = (1000000 / IXGBE_DEFAULT_ITR_RX_USECS); | ||
2427 | adapter->tx_eitr = (1000000 / IXGBE_DEFAULT_ITR_TX_USECS); | ||
2428 | |||
2429 | /* | ||
2430 | * It's easy to be greedy for MSI-X vectors, but it really | 2432 | * It's easy to be greedy for MSI-X vectors, but it really |
2431 | * doesn't do us much good if we have a lot more vectors | 2433 | * doesn't do us much good if we have a lot more vectors |
2432 | * than CPU's. So let's be conservative and only ask for | 2434 | * than CPU's. So let's be conservative and only ask for |
@@ -2567,10 +2569,6 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
2567 | adapter->ring_feature[RING_F_RSS].indices = rss; | 2569 | adapter->ring_feature[RING_F_RSS].indices = rss; |
2568 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 2570 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
2569 | 2571 | ||
2570 | /* Enable Dynamic interrupt throttling by default */ | ||
2571 | adapter->rx_eitr = 1; | ||
2572 | adapter->tx_eitr = 1; | ||
2573 | |||
2574 | /* default flow control settings */ | 2572 | /* default flow control settings */ |
2575 | hw->fc.original_type = ixgbe_fc_none; | 2573 | hw->fc.original_type = ixgbe_fc_none; |
2576 | hw->fc.type = ixgbe_fc_none; | 2574 | hw->fc.type = ixgbe_fc_none; |
@@ -2591,6 +2589,18 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
2591 | return -EIO; | 2589 | return -EIO; |
2592 | } | 2590 | } |
2593 | 2591 | ||
2592 | /* enable itr by default in dynamic mode */ | ||
2593 | adapter->itr_setting = 1; | ||
2594 | adapter->eitr_param = 20000; | ||
2595 | |||
2596 | /* set defaults for eitr in MegaBytes */ | ||
2597 | adapter->eitr_low = 10; | ||
2598 | adapter->eitr_high = 20; | ||
2599 | |||
2600 | /* set default ring sizes */ | ||
2601 | adapter->tx_ring_count = IXGBE_DEFAULT_TXD; | ||
2602 | adapter->rx_ring_count = IXGBE_DEFAULT_RXD; | ||
2603 | |||
2594 | /* initialize eeprom parameters */ | 2604 | /* initialize eeprom parameters */ |
2595 | if (ixgbe_init_eeprom(hw)) { | 2605 | if (ixgbe_init_eeprom(hw)) { |
2596 | dev_err(&pdev->dev, "EEPROM initialization failed\n"); | 2606 | dev_err(&pdev->dev, "EEPROM initialization failed\n"); |