diff options
Diffstat (limited to 'drivers/net/ethernet/sfc/ethtool.c')
-rw-r--r-- | drivers/net/ethernet/sfc/ethtool.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 1cb6ed0a255c..98b363bb4a75 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -623,7 +623,8 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev, | |||
623 | struct efx_nic *efx = netdev_priv(net_dev); | 623 | struct efx_nic *efx = netdev_priv(net_dev); |
624 | struct efx_channel *channel; | 624 | struct efx_channel *channel; |
625 | unsigned int tx_usecs, rx_usecs; | 625 | unsigned int tx_usecs, rx_usecs; |
626 | bool adaptive; | 626 | bool adaptive, rx_may_override_tx; |
627 | int rc; | ||
627 | 628 | ||
628 | if (coalesce->use_adaptive_tx_coalesce) | 629 | if (coalesce->use_adaptive_tx_coalesce) |
629 | return -EINVAL; | 630 | return -EINVAL; |
@@ -642,16 +643,14 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev, | |||
642 | /* If channels are shared, TX IRQ moderation can be quietly | 643 | /* If channels are shared, TX IRQ moderation can be quietly |
643 | * overridden unless it is changed from its old value. | 644 | * overridden unless it is changed from its old value. |
644 | */ | 645 | */ |
645 | if (efx->tx_channel_offset == 0 && | 646 | rx_may_override_tx = coalesce->tx_coalesce_usecs_irq == tx_usecs; |
646 | coalesce->tx_coalesce_usecs_irq != tx_usecs && | ||
647 | coalesce->tx_coalesce_usecs_irq != rx_usecs) { | ||
648 | netif_err(efx, drv, efx->net_dev, "Channels are shared. " | ||
649 | "RX and TX IRQ moderation must be equal\n"); | ||
650 | return -EINVAL; | ||
651 | } | ||
652 | tx_usecs = coalesce->tx_coalesce_usecs_irq; | 647 | tx_usecs = coalesce->tx_coalesce_usecs_irq; |
653 | 648 | ||
654 | efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive); | 649 | rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive, |
650 | rx_may_override_tx); | ||
651 | if (rc != 0) | ||
652 | return rc; | ||
653 | |||
655 | efx_for_each_channel(channel, efx) | 654 | efx_for_each_channel(channel, efx) |
656 | efx->type->push_irq_moderation(channel); | 655 | efx->type->push_irq_moderation(channel); |
657 | 656 | ||