Skip to content

Commit

Permalink
ixgbe: handle parameters for tx and rx EITR, no div0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Nov 29, 2009
1 parent 429d33a commit cfb3f91
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
@@ -1972,6 +1972,10 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
break;
}

/* if in mixed tx/rx queues per vector mode, report only rx settings */
if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
return 0;

/* only valid if in constant ITR mode */
switch (adapter->tx_itr_setting) {
case 0:
@@ -1997,12 +2001,9 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
struct ixgbe_q_vector *q_vector;
int i;

/*
* don't accept tx specific changes if we've got mixed RxTx vectors
* test and jump out here if needed before changing the rx numbers
*/
if ((1000000/ec->tx_coalesce_usecs) != adapter->tx_eitr_param &&
adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
/* don't accept tx specific changes if we've got mixed RxTx vectors */
if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count
&& ec->tx_coalesce_usecs)
return -EINVAL;

if (ec->tx_max_coalesced_frames_irq)

0 comments on commit cfb3f91

Please sign in to comment.