From: Paolo Abeni <pabeni@redhat.com>
To: Sagi Maimon <maimon.sagi@gmail.com>, netdev@vger.kernel.org
Cc: radhey.shyam.pandey@amd.com, michal.simek@amd.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, robert.hancock@calian.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3] net: axienet: bound TX completion cleanup by the NAPI budget
Date: Tue, 29 Sep 2026 15:21:59 +0200 [thread overview]
Message-ID: <a3275288-1eae-463e-ba9f-dbb2d715d1b4@redhat.com> (raw)
In-Reply-To: <20260924135052.185129-1-maimon.sagi@gmail.com>
On 9/24/26 15:50, Sagi Maimon wrote:
> axienet_tx_poll() passes lp->tx_bd_num to axienet_free_tx_chain() as
> @nr_bds, and @budget is only forwarded to napi_consume_skb() as its
> bulk-free hint. Nothing limits the cleanup loop to the NAPI budget, so
> the number of packets returned is bounded by the TX ring size rather
> than by the budget, and the poll can report more work than it was
> given:
>
> eth0: NAPI poll function axienet_tx_poll+0x0/0x180 [xilinx_emac]
> returned 96, exceeding its budget of 64.
>
> Returning more than the budget breaks the NAPI contract. It also makes
> the "packets < budget" test in axienet_tx_poll() false, so
> napi_complete_done() is skipped and TX completion interrupts are not
> re-enabled on that pass. NAPI reschedules the poll, so this recovers,
> but the accounting is wrong either way.
>
> In steady state fewer descriptors complete per poll than the budget
> allows, which is why this is rarely observed. Triggering it needs more
> than @budget completions outstanding at once - for example when TX
> completion interrupts have not been taken for a while and a full ring is
> reclaimed in one go.
>
> Stop the loop once the budget is spent.
Napi can process as much TX descriptor as available, even above `budget`
see:
https://elixir.bootlin.com/linux/v7.2.8/source/Documentation/networking/napi.rst#L68
The solution would be capping axienet_tx_poll() return value to `budget`.
/P
next prev parent reply other threads:[~2026-09-29 13:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 13:50 Sagi Maimon
2026-09-25 13:52 ` netdev-bot+sashiko
2026-09-29 13:21 ` Paolo Abeni [this message]
2026-09-30 7:16 ` Sagi Maimon
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=a3275288-1eae-463e-ba9f-dbb2d715d1b4@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@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=maimon.sagi@gmail.com \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=radhey.shyam.pandey@amd.com \
--cc=robert.hancock@calian.com \
/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®