All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: Michael Chan <michael.chan@broadcom.com>
Cc: netdev@vger.kernel.org, Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer index
Date: Fri, 4 Dec 2026 14:58:58 -0800	[thread overview]
Message-ID: <axNFstlJtPCuGzI/@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <CACKFLikOPYrjKj1dBo=3MD0oeQcqCBu02n6=JvZ8uK4FeNfdkw@mail.gmail.com>

On Fri, Dec 04, 2026 at 02:22:49PM -0800, Michael Chan wrote:
> On Fri, Dec 4, 2026 at 12:03 PM Joe Damato <joe@dama.to> wrote:
> 
> > @@ -3419,10 +3420,18 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)
> >
> >                         __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL,
> >                                              budget);
> > +                       nq_moved = raw_cons != cpr->cp_raw_cons;
> >                         cpr->cp_raw_cons = raw_cons;
> > -                       if (napi_complete_done(napi, work_done))
> > +                       if (napi_complete_done(napi, work_done)) {
> >                                 BNXT_DB_NQ_ARM_P5(&cpr->cp_db,
> >                                                   cpr->cp_raw_cons);
> > +                       } else if (nq_moved) {
> > +                               /* NAPI stays scheduled (IRQ deferral or busy
> > +                                * poll) and the NQ is not re-armed, but the
> > +                                * HW must still learn how far it was consumed.
> > +                                */
> > +                               BNXT_DB_NQ_P5(&cpr->cp_db, cpr->cp_raw_cons);
> 
> I will check with the HW/FW teams to understand why this is needed.
> If we finish polling within budget, the completion rings should be
> armed and our NQ should be big enough for any new entries without
> updating the NQ doorbell.  I'll get back to you in a few days.
> Thanks.

Thanks for taking a look and following up internally.

I agree that a single poll can't overflow the NQ. The problem is that many
polls in a row can skip the NQ doorbell write.

With defer_hard_irqs, any poll with work_done > 0 resets the defer
count, so napi_complete_done() keeps returning false under steady
traffic. Busy poll always returns false. Each of those polls re-arms
the CQs and consumes the new NQEs, but the consumer index the HW sees
never moves.

The end-of-loop write doesn't help a TX-heavy NAPI. TX completions
don't count toward the budget, so a TCP sender, whose only RX is
ACKs, stays under budget and never reaches it.

FWIW, FW 225 didn't seem to reproduce this issue so it is possible that
something changed between FW 225 and the more recent FWs or that maybe my test
on FW 225 wasn't right for some reason. Not sure.

In any case, I'd encourage the folks on your side to test the reproducer on
different FW versions and see if you can repro.

I tested it a few times on FW 238 and it repro'd every time within seconds.

  reply	other threads:[~2026-12-04 22:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 20:03 [PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer index Joe Damato
2026-12-04 22:22 ` Michael Chan
2026-12-04 22:58   ` Joe Damato [this message]
2026-12-05 15:19     ` Pavan Chebbi
2026-12-05 20:10 ` netdev-bot+sashiko

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=axNFstlJtPCuGzI/@devvm20253.cco0.facebook.com \
    --to=joe@dama.to \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.