aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2009-03-13 18:13:28 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-14 15:41:08 -0400
commit509ee935ec0828e534e4d48d08d4d0b4bc17ea92 (patch)
treed50803203ef9ec0e528f37546d2e9d3488747c43 /drivers/net/ixgbe/ixgbe_ethtool.c
parent40dcd79a7bd2e0d6bf4680db4bc0268c9f149a1d (diff)
ixgbe: Fix interrupt configuration for 82599
The interrupt models using EITR have changed in 82599. The way the register is laid out, the change is transparent to some of the existing code. However, some of it isn't. This patch fixes all the cases where EITR handling is different than 82598. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index ae38bcaa7ca1..3a99781794d1 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -977,40 +977,47 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
977 struct ethtool_coalesce *ec) 977 struct ethtool_coalesce *ec)
978{ 978{
979 struct ixgbe_adapter *adapter = netdev_priv(netdev); 979 struct ixgbe_adapter *adapter = netdev_priv(netdev);
980 struct ixgbe_hw *hw = &adapter->hw;
981 int i; 980 int i;
982 981
983 if (ec->tx_max_coalesced_frames_irq) 982 if (ec->tx_max_coalesced_frames_irq)
984 adapter->tx_ring[0].work_limit = ec->tx_max_coalesced_frames_irq; 983 adapter->tx_ring[0].work_limit = ec->tx_max_coalesced_frames_irq;
985 984
986 if (ec->rx_coalesce_usecs > 1) { 985 if (ec->rx_coalesce_usecs > 1) {
986 /* check the limits */
987 if ((1000000/ec->rx_coalesce_usecs > IXGBE_MAX_INT_RATE) ||
988 (1000000/ec->rx_coalesce_usecs < IXGBE_MIN_INT_RATE))
989 return -EINVAL;
990
987 /* store the value in ints/second */ 991 /* store the value in ints/second */
988 adapter->eitr_param = 1000000/ec->rx_coalesce_usecs; 992 adapter->eitr_param = 1000000/ec->rx_coalesce_usecs;
989 993
990 /* static value of interrupt rate */ 994 /* static value of interrupt rate */
991 adapter->itr_setting = adapter->eitr_param; 995 adapter->itr_setting = adapter->eitr_param;
992 /* clear the lower bit */ 996 /* clear the lower bit as its used for dynamic state */
993 adapter->itr_setting &= ~1; 997 adapter->itr_setting &= ~1;
994 } else if (ec->rx_coalesce_usecs == 1) { 998 } else if (ec->rx_coalesce_usecs == 1) {
995 /* 1 means dynamic mode */ 999 /* 1 means dynamic mode */
996 adapter->eitr_param = 20000; 1000 adapter->eitr_param = 20000;
997 adapter->itr_setting = 1; 1001 adapter->itr_setting = 1;
998 } else { 1002 } else {
999 /* any other value means disable eitr, which is best 1003 /*
1000 * served by setting the interrupt rate very high */ 1004 * any other value means disable eitr, which is best
1001 adapter->eitr_param = 3000000; 1005 * served by setting the interrupt rate very high
1006 */
1007 adapter->eitr_param = IXGBE_MAX_INT_RATE;
1002 adapter->itr_setting = 0; 1008 adapter->itr_setting = 0;
1003 } 1009 }
1004 1010
1005 for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) { 1011 for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) {
1006 struct ixgbe_q_vector *q_vector = &adapter->q_vector[i]; 1012 struct ixgbe_q_vector *q_vector = &adapter->q_vector[i];
1007 if (q_vector->txr_count && !q_vector->rxr_count) 1013 if (q_vector->txr_count && !q_vector->rxr_count)
1014 /* tx vector gets half the rate */
1008 q_vector->eitr = (adapter->eitr_param >> 1); 1015 q_vector->eitr = (adapter->eitr_param >> 1);
1009 else 1016 else
1010 /* rx only or mixed */ 1017 /* rx only or mixed */
1011 q_vector->eitr = adapter->eitr_param; 1018 q_vector->eitr = adapter->eitr_param;
1012 IXGBE_WRITE_REG(hw, IXGBE_EITR(i), 1019 ixgbe_write_eitr(adapter, i,
1013 EITR_INTS_PER_SEC_TO_REG(q_vector->eitr)); 1020 EITR_INTS_PER_SEC_TO_REG(q_vector->eitr));
1014 } 1021 }
1015 1022
1016 return 0; 1023 return 0;