From: netdev-bot+sashiko@kernel.org
To: daniel.machon@microchip.com
Cc: horatiu.vultur@microchip.com, UNGLinuxDriver@microchip.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
sdf@fomichev.me, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net] net: lan966x: don't disable hardirqs in fdma tx clear path
Date: Tue, 27 Oct 2026 13:48:08 +0000 [thread overview]
Message-ID: <179310888885.3134.1983716616405342216@kernel.org> (raw)
In-Reply-To: <20261026-lan966x-fdma-tx-clear-hardirq-v1-1-5f70f026a2e4@microchip.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The patch only fixes the normal NAPI case.
--
net: lan966x: don't disable hardirqs in fdma tx clear path
This patch changes lan966x_fdma_tx_clear_buf() to take tx_lock with a
plain spin_lock() instead of spin_lock_irqsave(). The aim is to stop
freeing page_pool backed buffers with hardirqs disabled. That currently
triggers the lockdep_assert_no_hardirq() warning in
__page_pool_put_page().
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> index a7940eca5df31..a92bd0590b460 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
> @@ -336,14 +336,13 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight)
[ ... ]
> xdp_frame_bulk_init(&bq);
>
> - spin_lock_irqsave(&lan966x->tx_lock, flags);
> + spin_lock(&lan966x->tx_lock);
[Severity: High]
Does this cover the netpoll case? The commit message says:
tx_clear_buf() runs from the NAPI poll, so disabling hardirqs there is
not needed.
However, netpoll can call the NAPI poll with budget 0 after the caller
has already disabled hardirqs:
netpoll_send_skb()
local_irq_save(flags)
__netpoll_send_skb()
netpoll_poll_dev()
poll_napi()
poll_one_napi()
napi->poll(napi, 0)
lan966x_fdma_napi_poll(weight == 0)
lan966x_fdma_tx_clear_buf(lan966x, 0)
lan966x_fdma_napi_poll() calls lan966x_fdma_tx_clear_buf() whatever the
weight is. tx_clear_buf() then does the XDP and page pool frees without
checking weight:
if (dcb_buf->xdp_ndo)
xdp_return_frame_bulk(dcb_buf->data.xdpf, &bq);
else
page_pool_recycle_direct(rx->page_pool,
dcb_buf->data.page);
...
xdp_flush_frame_bulk(&bq);
Consider netconsole on the port that owns the FDMA NAPI (fdma_ndev, which
does not set IFF_DISABLE_NETPOLL), with completed XDP_TX or ndo_xdp_xmit
frames in the TX ring. In that case, won't page_pool_recycle_direct() and
xdp_flush_frame_bulk() still hit lockdep_assert_no_hardirq() in
__page_pool_put_page()?
The bulk path always goes through page_pool_recycle_ring_bulk(). The
direct path does too once the alloc cache is full. That function takes
the producer lock with spin_lock_bh(), and netpoll from process context
is not in softirq.
Can spin_unlock_bh() then run __local_bh_enable_ip() with IRQs disabled?
That could run pending softirqs or turn IRQs back on inside netpoll's
local_irq_save() section.
Documentation/networking/napi.rst says:
skb Tx processing should happen regardless of the budget, but if
the argument is 0 driver cannot call any XDP (or page pool) APIs.
The skb branch looks fine, because napi_consume_skb(skb, 0) falls back to
dev_consume_skb_any(). Could the XDP and page pool part of TX completion
be skipped when weight is 0, as other page_pool drivers do?
The missing budget check is older than this patch. Even so, it means the
warning this patch is meant to fix can still be triggered from
lan966x_fdma_tx_clear_buf().
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261026-lan966x-fdma-tx-clear-hardirq-v1-1-5f70f026a2e4%40microchip.com
next prev parent reply other threads:[~2026-10-27 13:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 13:45 Daniel Machon
2026-10-27 13:48 ` netdev-bot+sashiko [this message]
2026-10-27 14:39 ` Daniel Machon
2026-10-27 23:10 ` patchwork-bot+netdevbpf
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=179310888885.3134.1983716616405342216@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel.machon@microchip.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=horatiu.vultur@microchip.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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®