aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2009-11-24 13:51:06 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 03:33:58 -0500
commitcfb3f91af49dff9b50de6929dc4de06100c4cfa8 (patch)
treefe3147cc153957299c0151b8c957014190b6685a /drivers/net/ixgbe/ixgbe_ethtool.c
parent429d33ace5ce6122817f8abe9d170eaa55dc3af9 (diff)
ixgbe: handle parameters for tx and rx EITR, no div0
The driver was doing a divide by zero when adjusting tx-usecs. This patch removes the divide by zero code and changes the logic slightly to ignore tx-usecs in the case of shared TxRx vectors. Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Shannon Nelson <shannon.nelson@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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 84ab4db7074..a5ca289efc9 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1972,6 +1972,10 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
1972 break; 1972 break;
1973 } 1973 }
1974 1974
1975 /* if in mixed tx/rx queues per vector mode, report only rx settings */
1976 if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
1977 return 0;
1978
1975 /* only valid if in constant ITR mode */ 1979 /* only valid if in constant ITR mode */
1976 switch (adapter->tx_itr_setting) { 1980 switch (adapter->tx_itr_setting) {
1977 case 0: 1981 case 0:
@@ -1997,12 +2001,9 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
1997 struct ixgbe_q_vector *q_vector; 2001 struct ixgbe_q_vector *q_vector;
1998 int i; 2002 int i;
1999 2003
2000 /* 2004 /* don't accept tx specific changes if we've got mixed RxTx vectors */
2001 * don't accept tx specific changes if we've got mixed RxTx vectors 2005 if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count
2002 * test and jump out here if needed before changing the rx numbers 2006 && ec->tx_coalesce_usecs)
2003 */
2004 if ((1000000/ec->tx_coalesce_usecs) != adapter->tx_eitr_param &&
2005 adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
2006 return -EINVAL; 2007 return -EINVAL;
2007 2008
2008 if (ec->tx_max_coalesced_frames_irq) 2009 if (ec->tx_max_coalesced_frames_irq)