Re: [PATCH net v4] net: axienet: cap the TX poll return value at the NAPI budget

From
Jakub Kicinski <kuba@kernel.org>
Date
2026-10-02 01:38:24
Also in
linux-arm-kernel, lkml
Reply to
Sagi Maimon, 2026-09-30
On Wed, 30 Sep 2026 10:15:36 +0300 Sagi Maimon wrote:
quoted hunk ↗ jump to hunk
@@ -1027,7 +1027,12 @@ static int axienet_tx_poll(struct napi_struct *napi, int budget)
 		axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, lp->tx_dma_cr);
 		spin_unlock_irq(&lp->tx_cr_lock);
 	}
-	return packets;
+
+	/* The whole ring was reclaimed above, which may be more than the
+	 * budget, but a poll must not report more work than it was given.
+	 * netpoll polls with a budget of 0 and expects no work reported.
+	 */
+	return min(packets, budget);
Please take a look at commit a58cdf56b6e, that's the correct approach
(incl. feeding 0 to napi_complete_done).
-- 
pw-bot: cr
Thread (5 messages) 5 messages, 4 authors, last reply 2026-10-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help