|
@@ -56,6 +56,8 @@ static int bnxt_get_coalesce(struct net_device *dev,
|
|
coal->tx_coalesce_usecs_irq = bp->tx_coal_ticks_irq;
|
|
coal->tx_coalesce_usecs_irq = bp->tx_coal_ticks_irq;
|
|
coal->tx_max_coalesced_frames_irq = bp->tx_coal_bufs_irq;
|
|
coal->tx_max_coalesced_frames_irq = bp->tx_coal_bufs_irq;
|
|
|
|
|
|
|
|
+ coal->stats_block_coalesce_usecs = bp->stats_coal_ticks;
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -63,6 +65,7 @@ static int bnxt_set_coalesce(struct net_device *dev,
|
|
struct ethtool_coalesce *coal)
|
|
struct ethtool_coalesce *coal)
|
|
{
|
|
{
|
|
struct bnxt *bp = netdev_priv(dev);
|
|
struct bnxt *bp = netdev_priv(dev);
|
|
|
|
+ bool update_stats = false;
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
|
|
bp->rx_coal_ticks = coal->rx_coalesce_usecs;
|
|
bp->rx_coal_ticks = coal->rx_coalesce_usecs;
|
|
@@ -76,8 +79,26 @@ static int bnxt_set_coalesce(struct net_device *dev,
|
|
bp->tx_coal_ticks_irq = coal->tx_coalesce_usecs_irq;
|
|
bp->tx_coal_ticks_irq = coal->tx_coalesce_usecs_irq;
|
|
bp->tx_coal_bufs_irq = coal->tx_max_coalesced_frames_irq;
|
|
bp->tx_coal_bufs_irq = coal->tx_max_coalesced_frames_irq;
|
|
|
|
|
|
- if (netif_running(dev))
|
|
|
|
- rc = bnxt_hwrm_set_coal(bp);
|
|
|
|
|
|
+ if (bp->stats_coal_ticks != coal->stats_block_coalesce_usecs) {
|
|
|
|
+ u32 stats_ticks = coal->stats_block_coalesce_usecs;
|
|
|
|
+
|
|
|
|
+ stats_ticks = clamp_t(u32, stats_ticks,
|
|
|
|
+ BNXT_MIN_STATS_COAL_TICKS,
|
|
|
|
+ BNXT_MAX_STATS_COAL_TICKS);
|
|
|
|
+ stats_ticks = rounddown(stats_ticks, BNXT_MIN_STATS_COAL_TICKS);
|
|
|
|
+ bp->stats_coal_ticks = stats_ticks;
|
|
|
|
+ update_stats = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (netif_running(dev)) {
|
|
|
|
+ if (update_stats) {
|
|
|
|
+ rc = bnxt_close_nic(bp, true, false);
|
|
|
|
+ if (!rc)
|
|
|
|
+ rc = bnxt_open_nic(bp, true, false);
|
|
|
|
+ } else {
|
|
|
|
+ rc = bnxt_hwrm_set_coal(bp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|