Skip to content

Commit

Permalink
Merge branch 'ena-fixes-of-interrupt-moderation-bugs'
Browse files Browse the repository at this point in the history
Arthur Kiyanovski says:

====================
ena: fixes of interrupt moderation bugs

Differences from V1:
1. Updated default tx interrupt moderation to 64us
2. Added "Fixes:" tags.
3. Removed cosmetic changes that are not relevant for these bug fixes

This patchset includes a couple of fixes of bugs in the implemenation of
interrupt moderation.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Dec 21, 2019
2 parents 28a3b84 + 41c53ca commit 9f5e508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/amazon/ena/ena_com.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
/*****************************************************************************/
/* ENA adaptive interrupt moderation settings */

#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 196
#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 64
#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 0
#define ENA_DEFAULT_INTR_DELAY_RESOLUTION 1

Expand Down
24 changes: 10 additions & 14 deletions drivers/net/ethernet/amazon/ena/ena_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,9 @@ static int ena_get_coalesce(struct net_device *net_dev,
ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) *
ena_dev->intr_delay_resolution;

if (!ena_com_get_adaptive_moderation_enabled(ena_dev))
coalesce->rx_coalesce_usecs =
ena_com_get_nonadaptive_moderation_interval_rx(ena_dev)
* ena_dev->intr_delay_resolution;
coalesce->rx_coalesce_usecs =
ena_com_get_nonadaptive_moderation_interval_rx(ena_dev)
* ena_dev->intr_delay_resolution;

coalesce->use_adaptive_rx_coalesce =
ena_com_get_adaptive_moderation_enabled(ena_dev);
Expand Down Expand Up @@ -367,23 +366,20 @@ static int ena_set_coalesce(struct net_device *net_dev,

ena_update_tx_rings_intr_moderation(adapter);

if (coalesce->use_adaptive_rx_coalesce) {
if (!ena_com_get_adaptive_moderation_enabled(ena_dev))
ena_com_enable_adaptive_moderation(ena_dev);
return 0;
}

rc = ena_com_update_nonadaptive_moderation_interval_rx(ena_dev,
coalesce->rx_coalesce_usecs);
if (rc)
return rc;

ena_update_rx_rings_intr_moderation(adapter);

if (!coalesce->use_adaptive_rx_coalesce) {
if (ena_com_get_adaptive_moderation_enabled(ena_dev))
ena_com_disable_adaptive_moderation(ena_dev);
}
if (coalesce->use_adaptive_rx_coalesce &&
!ena_com_get_adaptive_moderation_enabled(ena_dev))
ena_com_enable_adaptive_moderation(ena_dev);

if (!coalesce->use_adaptive_rx_coalesce &&
ena_com_get_adaptive_moderation_enabled(ena_dev))
ena_com_disable_adaptive_moderation(ena_dev);

return 0;
}
Expand Down

0 comments on commit 9f5e508

Please sign in to comment.