From: "Nazle Asmade, Muhammad Nazim Amirul" <muhammad.nazim.amirul.nazle.asmade@altera.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"mcoquelin.stm32@gmail.com" <mcoquelin.stm32@gmail.com>,
"alexandre.torgue@foss.st.com" <alexandre.torgue@foss.st.com>,
"rmk+kernel@armlinux.org.uk" <rmk+kernel@armlinux.org.uk>,
"maxime.chevallier@bootlin.com" <maxime.chevallier@bootlin.com>,
"linux-stm32@st-md-mailman.stormreply.com"
<linux-stm32@st-md-mailman.stormreply.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: stmmac: Improve Tx timer arm logic further
Date: Fri, 29 May 2026 06:47:48 +0000 [thread overview]
Message-ID: <1175310d-5c8b-4a4e-a597-5acca4ec0db8@altera.com> (raw)
In-Reply-To: <a0cdbac8-c7b2-4dc2-b08c-7fae99a73e93@lunn.ch>
On 28/5/2026 9:58 am, Andrew Lunn wrote:
>> pre-patch behaviour. The meaning of tx_coal_timer is unchanged.
>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> index 3591755ea30b..35da51c26248 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -3341,12 +3341,14 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
>> * Try to cancel any timer if napi is scheduled, timer will be armed
>> * again in the next scheduled napi.
>> */
>> - if (unlikely(!napi_is_scheduled(napi)))
>> - hrtimer_start(&tx_q->txtimer,
>> - STMMAC_COAL_TIMER(tx_coal_timer),
>> - HRTIMER_MODE_REL);
>> - else
>
> With this code, the timer is always tx_coal_timer in the future.
>
>
>> + if (unlikely(!napi_is_scheduled(napi))) {
>> + if (unlikely(!(hrtimer_active(&tx_q->txtimer))))
>> + hrtimer_start(&tx_q->txtimer,
>> + STMMAC_COAL_TIMER(tx_coal_timer),
>> + HRTIMER_MODE_REL);
>
> If the timer is not active, it is set to tx_coal_timer in the
> future. However, if the timer is active, meaning it is already
> counting down, it is left alone, so is less than tx_coal_timer in the
> future.
>
> Do i have this right?
>
> Doesn't that change the meaning of the timer. It now actually goes off
> sooner?
>
> This is somewhat academic. The point of coalescence is to reduce
> overheads. The increase in performance shows that this change does
> reduce overheads.
>
> Andrew
Hi Andrew,
Yes, you have it right. I have updated the commit message in v3 to
correctly describe this behaviour change.
Thanks, Nazim
next prev parent reply other threads:[~2026-05-29 6:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 2:33 muhammad.nazim.amirul.nazle.asmade
2026-05-27 21:00 ` Jacob Keller
2026-05-28 1:58 ` Andrew Lunn
2026-05-29 6:47 ` Nazle Asmade, Muhammad Nazim Amirul [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-26 5:19 muhammad.nazim.amirul.nazle.asmade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1175310d-5c8b-4a4e-a597-5acca4ec0db8@altera.com \
--to=muhammad.nazim.amirul.nazle.asmade@altera.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®