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

From: Sagi Maimon

Date: Sun Oct 04 2026 - 03:01:07 EST


On Fri, Oct 2, 2026 at 4:38 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Wed, 30 Sep 2026 10:15:36 +0300 Sagi Maimon wrote:
> > @@ -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