From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.45 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== 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== 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 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 ; Fri, 4 Dec 2026 20:03:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D952E606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) 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 Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-3b413d04c93so900890a91.1 for ; Fri, 04 Dec 2026 12:03:42 -0800 (PST) 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/DISCxtVhsw6B9tSa1WW6nfIBeCFd2LFjjggYTdiKgZg2gW2OjznZegTRrY3giQcrc ATrLOz1FAEuKfnmYHaluvomwzTN8akZ6wAiUEEsRX/I0L6UVLY5s+8+nY2qCIL3tKDn/ Yz2kazoEIowZfAiYBcdvFdbzNifD3l8BSBZyh4WC82WhS8zDsxEHmsiNl/iZ0CkZiX/O +zmFQtGFq3qPgkOYIJwA02o8g3QbS9dFNGO1bT1omQxhpjlMKX1XByjuwUz7pDi61iRp asZw== X-Gm-Message-State: AB4q+uFUkAieldXXOH1uGaVCSgtaF2Gln6RZE5+/XrCR+iKHgHCyfZFs d+leSnqbbchqNyPQ2EQpCmQ9aXpjuri2YBFCOoHxOLQkwDJWl17e4GOPjd7DQqeGImpsKgUdkKS G2W7R X-Gm-Gg: AZFdTZfcHU4NmZRYu8X91vZ8wkzDjOYCvvtQwbjgGITTuSX6Bp+DACent2/Sh29wUzx IU4+FsmPI1okpH7vdoyB8l43C1xxkJgc7IFw1z7spJC0zyDpNYThJdNWiauIqhGUQ5MO9gKxsjl We1FHRXnnVZLOYsPRou1l87CcGuRLlQ6Rj13osqw2aDEgyhP95sy6Ii+oJd39tYyEqKnioDbXLE dcJYXCmCq7eK7PB4OmSQJye9V0+cmogqtHzB0wOR+qEjYX+BAbydSsqH/SY4AnEE5vz3w7R/ryw QRJuGkraoM5y+oh65Toxvf9ML5QinWahEmBq444pn13xWSJO/RjVj2sR9UGnwCZcXnpShgW5vkg tMlxzz6JyRjAdbb7n1VzFWx/Nv1lDLyaACvmzZf4bX0mY4LRM1gdf4XZ2AEm9vg2cfOJF2/ilPC wtF+LbSZeJFs4UOpY5nmN7E9utnBNgipyDcLjAf/fGpbc8AdzHar1TPxi2AQb7BNeUXAytKZDT+ QW7x7eADB7URDPE9y0PcfXM2TIEJQTFtMBWoWqeRVMTsnAKxW1AMhtUUVrYJxxiXuR24zeJ9FYd ZmCzXX+qxIgNx8Ocx0UmUC2zu5I1f02uPcP0qLzrqDk= X-Received: by 2002:a17:90b:3c87:b0:3b1:3598:f881 with SMTP id 98e67ed59e1d1-3b5e06a271bmr3012357a91.53.1796414622018; Fri, 04 Dec 2026 12:03:42 -0800 (PST) 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) From: Joe Damato To: netdev@vger.kernel.org, Michael Chan , Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Joe Damato Subject: [PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer index Date: Fri, 4 Dec 2026 12:03:34 -0800 Message-ID: <20261204200334.2294555-1-joe@dama.to> X-Mailer: git-send-email 2.53.1 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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