提交 cfb3f91a 编写于 作者: S Shannon Nelson 提交者: David S. Miller

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: NShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 429d33ac
...@@ -1972,6 +1972,10 @@ static int ixgbe_get_coalesce(struct net_device *netdev, ...@@ -1972,6 +1972,10 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
break; 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 */ /* only valid if in constant ITR mode */
switch (adapter->tx_itr_setting) { switch (adapter->tx_itr_setting) {
case 0: case 0:
...@@ -1997,12 +2001,9 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -1997,12 +2001,9 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
struct ixgbe_q_vector *q_vector; struct ixgbe_q_vector *q_vector;
int i; int i;
/* /* don't accept tx specific changes if we've got mixed RxTx vectors */
* 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
* test and jump out here if needed before changing the rx numbers && ec->tx_coalesce_usecs)
*/
if ((1000000/ec->tx_coalesce_usecs) != adapter->tx_eitr_param &&
adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
return -EINVAL; return -EINVAL;
if (ec->tx_max_coalesced_frames_irq) if (ec->tx_max_coalesced_frames_irq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册