Netdev List
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Michael Chan <michael.chan@broadcom.com>,
	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>,
	netdev@vger.kernel.org
Cc: "Björn Töpel" <bjorn@kernel.org>
Subject: [PATCH net] bnxt_en: Acknowledge the NQ before completing NAPI
Date: Thu,  3 Dec 2026 12:23:39 +0100	[thread overview]
Message-ID: <20261203112343.3524699-1-bjorn@kernel.org> (raw)

On P5 and newer chips, NAPI tells the device how far it read the NQ
with a doorbell. Currently, a poll that finds the NQ empty does so
only with the IRQ re-arm, after napi_complete_done() returns true. It
returns false while busy polling or deferring IRQs, so a NAPI that
completes without re-arming never frees the notifications it reads.
Once the NQ is full, the device stops notifying of RX and TX
completions. TX times out, the reset fails to free and allocate rings,
and the device stays down.

Acknowledge what was read before completing NAPI, while the poll still
owns it. In IRQ mode the re-arm follows with the same index.

Found from the console logs of a BCM57504 in real use. Normal traffic
with deferred IRQs, e.g napi_defer_hard_irqs 100, gro_flush_timeout
200000, lost the device in 19 seconds at 0.1 Mpps of 1500B UDP to one
queue. Also seen on the WIP AF_XDP series running preferred busy
polling. Both pass with this patch.

Fixes: 0fcec9854ab4 ("bnxt_en: Add new NAPI poll function for 57500 chips.")
Signed-off-by: Björn Töpel <bjorn@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 85ce4b2e297e..9f8ceca047f7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3419,7 +3419,14 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)
 
 			__bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL,
 					     budget);
-			cpr->cp_raw_cons = raw_cons;
+			/* Busy polling and deferred IRQs keep the NQ disarmed.
+			 * Free what was read while the NAPI is still ours, or
+			 * the NQ fills up and the device stops notifying.
+			 */
+			if (raw_cons != cpr->cp_raw_cons) {
+				cpr->cp_raw_cons = raw_cons;
+				BNXT_DB_NQ_P5(&cpr->cp_db, raw_cons);
+			}
 			if (napi_complete_done(napi, work_done))
 				BNXT_DB_NQ_ARM_P5(&cpr->cp_db,
 						  cpr->cp_raw_cons);

base-commit: 7c13d5d5afb4ba2e8634fe5aa0a9f2bca235cb4b
-- 
2.53.1


                 reply	other threads:[~2026-12-03 11:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261203112343.3524699-1-bjorn@kernel.org \
    --to=bjorn@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox