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

From
Sagi Maimon <hidden>
Date
2026-10-04 07:00:59
Also in
linux-arm-kernel, lkml
Reply to
Jakub Kicinski, 2026-10-02
On Fri, Oct 2, 2026 at 4:38 AM Jakub Kicinski [off-list ref] wrote:
On Wed, 30 Sep 2026 10:15:36 +0300 Sagi Maimon wrote:
quoted
@@ -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).
Thanks, that is cleaner.  v5 does the same: it reclaims the ring,
completes with napi_complete_done(napi, 0) when budget is non-zero,
re-enables the TX interrupt and returns 0.  It is posted as "net:
axienet: do not report TX completions as NAPI work".

Sagi

pw-bot: cr
--
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