🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27119

[PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer index

#27119
From: Joe Damato
Date: Fri, 04 Dec 2026 20:03
69 lines
12973 bytes
On a BCM57504 running firmware 238.1.138.6 or 232.0.159.4, the NIC can
lock up when the NQ consumer index goes stale. This can be reproduced
with iperf3 TCP traffic and hard IRQ deferral enabled:

  echo 2      > /sys/class/net/eth0/napi_defer_hard_irqs
  echo 200000 > /sys/class/net/eth0/gro_flush_timeout
  iperf3 -c $PEER -P 4 -t 300 &
  iperf3 -c $PEER -P 4 -t 300 -R &

Traffic stops within seconds. On FW 238.1.138.6 the TX watchdog then
fires and the driver's reset fails (RING_FREE fails and ring allocation
fails on open).

In that state, devlink reload, FLR, and host reboot all fail to recover
the NIC; only removing power from the NIC recovers the device. The same
test did not reproduce the lockup with firmware 225.0.154.0 or
225.0.157.0.

The driver does not update the NQ consumer index when
napi_complete_done() returns false, for example when IRQ deferral is
enabled as above, or when a busy polling socket owns the NAPI.

Fix this by writing the NQ consumer index, without arming the NQ, when
napi_complete_done() returns false. Skip the write if the index has not
moved, to avoid an extra MMIO write while busy polling an idle NAPI.

Fixes: 0fcec9854ab4 ("bnxt_en: Add new NAPI poll function for 57500 chips.")
Signed-off-by: Joe Damato <joe@dama.to>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 85ce4b2e297e..f5cc273b97a5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3397,6 +3397,7 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)
 	struct bnxt *bp = bnapi->bp;
 	struct nqe_cn *nqcmp;
 	int work_done = 0;
+	bool nq_moved;
 	u32 cons;
 
 	if (unlikely(test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))) {
@@ -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);
+			}
 			goto poll_done;
 		}
 

base-commit: e9d78fc6741ac06d438cf64e314c28e57014432a
-- 
2.53.1-Meta
Technical Details
Message-ID: <20261204200334.2294555-1-joe@dama.to>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377607-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377607-linux-kernel-netdev=dewy.ru
From: joe@dama.to (Joe Damato)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer index
Date: Fri,  4 Dec 2026 12:03:34 -0800
Organization: Usenet Network
Message-ID: <20261204200334.2294555-1-joe@dama.to>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2851727"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:q4BSh3nkmRG2JDyXCezOisizw7w= sha256:2Bi6SYcbG3gAnOV311A5pNpDevXogrzyaUyaZzpgJLE=
	sha1:1Hd33h6BxlFsp+NXDVvspVESgmA= sha256:W+NT97SopPBOOrBsvo6YqJ99KeReh9LZ0oADEywOAa8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E43D1117CD0; Fri,  4 Dec 2026 23:03:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.199
X-Spam-Status: No, score=-3.199 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=dama-to.20260707.gappssmtp.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id twg_TOUjj4Fw;
	Fri,  4 Dec 2026 23:03:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377607-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=dama.to
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C3B60117CAF; Fri,  4 Dec 2026 23:03:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7FD4B35537; Fri,  4 Dec 2026 20:03:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796414624;
	b=Va97AxDg3grkjpg+Agx4DKIyGOrUvuSDdebu35yLUPKoObrhKFoBouQUKb4hK7ZkSlBs
	 3/7/BdEi35tZPDJkQa2oYICHNYZCM6/K7SUx6Ap2JN6Pbp0vaZm8EWMep7kWXo/OkskW3
	 vmeuy7Ro0K3znyvLSY30zaa8RUdMV2HFhn/NKMFBFsxVTEsTjADcysNerUiDRtxxnF/sI
	 eidmM32BK5BmHTgUWWTd6mJupbMDxHxjsLI6fgAwg8VMo7hnQUaMvKFgKOPj14kddly7r
	 Gw7EUwtc4jVIB+sdcIoQ1r+reRW/9ooYdL3ALCHe3/Mt6ZAPSMW7tKSvZg8X78enAJA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796414624;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=IXgrT0ZekyApDZwvpE4o8idZ5u6iyRZA7r3NHjNUYoM=;
	b=OfgrmGZWWk7dQUucltrVyuMqoB5NLk70FQZT3GE2ydYiv9RFMW0e08iBZgr95z5uKO92
	 xTkWdApVr5Bmz04PDJbEN7UOoOnDN1nf+6iuDxI64OfuLUJ6kS5z5dKzGpKYxbnKb3TC6
	 l83Sv2Xb613sqWnCuXum1xB7vJsfvn2JPwohsw6RZsNV+FBxNRDw3jmiTOPqD/LzHvccW
	 GUnsp9xe1aEjZlY4lCHF6EJ9HKvcT3h9JV/a7CEGkMytE35qTMvgd/j16Wlbtz04+UkUX
	 B6HCABi4GVea3d/id9aLEafi/CqvVD2RMWhbJmOs5vkpNpkhxwaIL41885viIsztjjA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=S1BqK+S3;
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 55B99606A333;
	Fri,  4 Dec 2026 20:03:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=S1BqK+S3
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796414623;
	b=JUDm7DfsDveYknUCJkucig4kVdFzmx8Nh4IH2HaAzIKRXchHRa6L/cTFAhL8daMgLof2
	 zzSpgiqm9sYCGl2wBHb7ekgEUyuD+A3w/svqdcx3yGyqSzNTirnmQ4SeC+HljB1gzKiL0
	 NkUSPwBt9V37vtj5DyXIkQNtjoyykw/TFwR3Y0+dVs7uoCEd+XfjeNDbtLhDrDLVez9X7
	 WV/zSpzlc01B527TqNMFMMNzFG1x++dNSCmXQjQ9NEOGQ50+PfNm5KtFnmBfFvsZQkyK0
	 aj43bwuD+29EXuXzapqMso62pXemP61GX3WJQDtYYSw/bqcdw+XbxppR+Kya5PJkZGQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796414623;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=IXgrT0ZekyApDZwvpE4o8idZ5u6iyRZA7r3NHjNUYoM=;
	b=AqTjZNhtgToNE9kLyd0NTmsW2GuZgLrHZlM9HGvST8iJX86GnWQpclVea+7O/K4Qk4oK
	 NCaPGeAAjpLMojNEZj4AqBXP8p4iHwZQg3lXniVd4gu8Jmy/3sTAhPlm6cnaUE+0CwBSH
	 GgoPmwg6bCC+rvZoUoirA7XUHXDLpUX76cSXdxIFbVb0Ng9Jfo1hp6w4PdCC3mryYm2/5
	 E9brh+METj7MDFZ629CRBKV/8TPjfXqfbR9C/C/6dMCs3X1lvJ1s5mpRM+xc0mCa3RWKQ
	 N7EFa/IGh7qZN0xpN/NA0K2e2+Dn4lG+jnl54nWXDKfBC7JRSHGADLaHYhOopUJQHWw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=dama.to;
	spf=none smtp.mailfrom=dama.to;
	dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=S1BqK+S3;
	arc=none smtp.remote-ip=209.85.216.45
X-Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D952E606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 20:03:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D952E606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to
X-Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-3b413d04c93so900890a91.1
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 12:03:42 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dama-to.20260707.gappssmtp.com; s=20260707; t=1796414622; x=1797019422; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=IXgrT0ZekyApDZwvpE4o8idZ5u6iyRZA7r3NHjNUYoM=;
        b=S1BqK+S3fb2Al9hEj05hD401vSDw6UZbgArXe0JrC0mUQLkBo/0sDe5YDVUODGPoZa
         WNqMkj9/nJ2j4Lsk1DG/6lD3RiHZdoeLNw0OX2vL5fdrPK4iIHsr5LFr3581YPSc3lVn
         Zo6hQ2vryrPgQ7zQ63Em/jaKVpOvGOoZW9CGxGOSU45a6c3R2t6ibHdwD2iZfZxn2uAF
         enKVT5lDLC/rXXyTxMwiMYgy5HolHqomo4LbGsLnInk9PZ3XhUzU0PGm1YoMZ61PxcWq
         Jzh7gCUYgKaP8zjFQdQEZxAuzuQPMo4w8l91Ryj8NFzokJG25GsyALdXptH47XzFkgP+
         6v0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796414622; x=1797019422;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IXgrT0ZekyApDZwvpE4o8idZ5u6iyRZA7r3NHjNUYoM=;
        b=hLfwT4LQqzys1LRNrpS7EOtfl4HhinBVlEsTB6iJN2uaXHkrwaYuB+M9lk27L7OstP
         w4/DISCxtVhsw6B9tSa1WW6nfIBeCFd2LFjjggYTdiKgZg2gW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3c87:b0:3b1:3598:f881 with SMTP id 98e67ed59e1d1-3b5e06a271bmr3012357a91.53.1796414622018;
        Fri, 04 Dec 2026 12:03:42 -0800 (PST)
X-Received: from localhost ([2a03:2880:2ff:72::])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5ddc7157dsm5341508a91.15.2026.12.04.12.03.41
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 04 Dec 2026 12:03:41 -0800 (PST)
X-Cc: Joe Damato <joe@dama.to>
X-Mailer: git-send-email 2.53.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list