Skip to content

Commit fa60b81

Browse files
vwaxdavem330
authored andcommitted
net: stmmac: fix handling of zero coalescing tx-usecs
Setting ethtool -C eth0 tx-usecs 0 is supposed to disable the use of the coalescing timer but currently it gets programmed with zero delay instead. Disable the use of the coalescing timer if tx-usecs is zero by preventing it from being restarted. Note that to keep things simple we don't start/stop the timer when the coalescing settings are changed, but just let that happen on the next transmit or timer expiry. Fixes: 8fce333 ("net: stmmac: Rework coalesce timer and fix multi-queue races") Signed-off-by: Vincent Whitchurch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6eadb0b commit fa60b81

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,9 +2704,7 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
27042704

27052705
/* We still have pending packets, let's call for a new scheduling */
27062706
if (tx_q->dirty_tx != tx_q->cur_tx)
2707-
hrtimer_start(&tx_q->txtimer,
2708-
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
2709-
HRTIMER_MODE_REL);
2707+
stmmac_tx_timer_arm(priv, queue);
27102708

27112709
flags = u64_stats_update_begin_irqsave(&tx_q->txq_stats.syncp);
27122710
tx_q->txq_stats.tx_packets += tx_packets;
@@ -2995,9 +2993,13 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
29952993
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
29962994
{
29972995
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
2996+
u32 tx_coal_timer = priv->tx_coal_timer[queue];
2997+
2998+
if (!tx_coal_timer)
2999+
return;
29983000

29993001
hrtimer_start(&tx_q->txtimer,
3000-
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
3002+
STMMAC_COAL_TIMER(tx_coal_timer),
30013003
HRTIMER_MODE_REL);
30023004
}
30033005

0 commit comments

Comments
 (0)