diff options
| -rw-r--r-- | drivers/net/ethernet/intel/igbvf/ethtool.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c index 8ce67064b9c5..90eef07943f4 100644 --- a/drivers/net/ethernet/intel/igbvf/ethtool.c +++ b/drivers/net/ethernet/intel/igbvf/ethtool.c | |||
| @@ -357,21 +357,28 @@ static int igbvf_set_coalesce(struct net_device *netdev, | |||
| 357 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 357 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
| 358 | struct e1000_hw *hw = &adapter->hw; | 358 | struct e1000_hw *hw = &adapter->hw; |
| 359 | 359 | ||
| 360 | if ((ec->rx_coalesce_usecs > IGBVF_MAX_ITR_USECS) || | 360 | if ((ec->rx_coalesce_usecs >= IGBVF_MIN_ITR_USECS) && |
| 361 | ((ec->rx_coalesce_usecs > 3) && | 361 | (ec->rx_coalesce_usecs <= IGBVF_MAX_ITR_USECS)) { |
| 362 | (ec->rx_coalesce_usecs < IGBVF_MIN_ITR_USECS)) || | 362 | adapter->current_itr = ec->rx_coalesce_usecs << 2; |
| 363 | (ec->rx_coalesce_usecs == 2)) | 363 | adapter->requested_itr = 1000000000 / |
| 364 | return -EINVAL; | 364 | (adapter->current_itr * 256); |
| 365 | 365 | } else if ((ec->rx_coalesce_usecs == 3) || | |
| 366 | /* convert to rate of irq's per second */ | 366 | (ec->rx_coalesce_usecs == 2)) { |
| 367 | if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) { | ||
| 368 | adapter->current_itr = IGBVF_START_ITR; | 367 | adapter->current_itr = IGBVF_START_ITR; |
| 369 | adapter->requested_itr = ec->rx_coalesce_usecs; | 368 | adapter->requested_itr = ec->rx_coalesce_usecs; |
| 370 | } else { | 369 | } else if (ec->rx_coalesce_usecs == 0) { |
| 371 | adapter->current_itr = ec->rx_coalesce_usecs << 2; | 370 | /* |
| 371 | * The user's desire is to turn off interrupt throttling | ||
| 372 | * altogether, but due to HW limitations, we can't do that. | ||
| 373 | * Instead we set a very small value in EITR, which would | ||
| 374 | * allow ~967k interrupts per second, but allow the adapter's | ||
| 375 | * internal clocking to still function properly. | ||
| 376 | */ | ||
| 377 | adapter->current_itr = 4; | ||
| 372 | adapter->requested_itr = 1000000000 / | 378 | adapter->requested_itr = 1000000000 / |
| 373 | (adapter->current_itr * 256); | 379 | (adapter->current_itr * 256); |
| 374 | } | 380 | } else |
| 381 | return -EINVAL; | ||
| 375 | 382 | ||
| 376 | writel(adapter->current_itr, | 383 | writel(adapter->current_itr, |
| 377 | hw->hw_addr + adapter->rx_ring->itr_register); | 384 | hw->hw_addr + adapter->rx_ring->itr_register); |
