mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: bgmac: don't process RX with a zero NAPI budget
@ 2026-10-14  0:19 Rosen Penev
  2026-10-14  0:24 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-10-14  0:19 UTC (permalink / raw)
  To: netdev
  Cc: Rafał Miłecki, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, open list

netpoll calls the NAPI poll with a budget of 0 and expects only TX
completions to be handled. bgmac_poll() passes the budget straight to
bgmac_dma_rx_read(), which checks it only after handling a descriptor,
so one received frame is always processed and bgmac_poll() returns 1.
That trips the "exceeded budget in poll" WARN_ONCE() in poll_one_napi()
when netconsole is used, and passes a frame up the stack from netpoll
context.

Return right after cleaning TX when the budget is 0. NAPI stays
scheduled, so the pending RX frames are picked up by the next regular
poll.

Fixes: dd4544f05469 ("bgmac: driver for GBit MAC core on BCMA bus")
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 427a096e5ad4..b1cb973caee5 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1154,6 +1154,11 @@ static int bgmac_poll(struct napi_struct *napi, int weight)
 	bgmac_write(bgmac, BGMAC_INT_STATUS, ~0);
 
 	bgmac_dma_tx_free(bgmac, &bgmac->tx_ring[0]);
+
+	/* A zero budget (netpoll) means only TX may be cleaned */
+	if (unlikely(!weight))
+		return 0;
+
 	handled += bgmac_dma_rx_read(bgmac, &bgmac->rx_ring[0], weight);
 
 	/* Poll again if more events arrived in the meantime */
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: bgmac: don't process RX with a zero NAPI budget
  2026-10-14  0:19 [PATCH net] net: bgmac: don't process RX with a zero NAPI budget Rosen Penev
@ 2026-10-14  0:24 ` netdev-bot+sinfo
  0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-10-14  0:24 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Rafał Miłecki,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-kernel

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-14  0:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14  0:19 [PATCH net] net: bgmac: don't process RX with a zero NAPI budget Rosen Penev
2026-10-14  0:24 ` netdev-bot+sinfo

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®