🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27177

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

#27177
From: Joe Damato
Date: Fri, 04 Dec 2026 22:58
50 lines
14020 bytes
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.
Technical Details
Message-ID: <axNFstlJtPCuGzI/@devvm20253.cco0.facebook.com>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377723-linux-kernel-netdev=dewy.ru
References: <20261204200334.2294555-1-joe@dama.to> <CACKFLikOPYrjKj1dBo=3MD0oeQcqCBu02n6=JvZ8uK4FeNfdkw@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377723-linux-kernel-netdev=dewy.ru
From: joe@dama.to (Joe Damato)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] bnxt_en: Fix NIC lockup caused by stale NQ consumer
 index
Date: Fri, 4 Dec 2026 14:58:58 -0800
Organization: Usenet Network
Message-ID: <axNFstlJtPCuGzI/@devvm20253.cco0.facebook.com>
References: <20261204200334.2294555-1-joe@dama.to>
 <CACKFLikOPYrjKj1dBo=3MD0oeQcqCBu02n6=JvZ8uK4FeNfdkw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2897095"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ohA/IBdoap48Gi1JOcGpF7Mvk50= sha256:ZLG58jFE/Kq1HpQ1FsPIgBoA1qqHCLQBtz/mAeFyyZY=
	sha1:PRtlW96j9rHh9QO7NWitOFwzaGc= sha256:XWHa49my8XV1jb4v4Ijo1ew+nQX/pKv4wURNJxa2BXQ=
Content-Disposition: inline
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 AD40E117D17; Sat,  5 Dec 2026 01:59:14 +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 G_7Wwjdw1RzE;
	Sat,  5 Dec 2026 01:59:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377723-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 69965117D13; Sat,  5 Dec 2026 01:59:03 +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 EEEF638A6A; Fri,  4 Dec 2026 22:59:01 +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=1796425141;
	b=XsVpRt593UIfjO2gR/5/T47M22w4j6p05RuSHQLfF7HR5zXO6URPZ6bKUqIqsQfAilQh
	 SHghOVn5P+jlS5dTrdbi5AyLmzenY50DR7jCd86Li6gwh03+hgeCpVPikhe6L+ONqB0rd
	 CYwr30W1Fw3CrzT6tCeNxZ2umyV6DU2DYKlsAcknMlJu1ECp2/N+dTlBBEenV2BFkpAg0
	 zkQtgWn7WENEWhzUuQMyQPFhHed4a8e/i866LWHU4LuwCTVEA5JokYvPCmZBq6qfBAyvY
	 0OO1P+D6yRknFtFIAnkdUUSsGlR7TUQFJTWy3vQme52ya4OH6pKPmhuX7pyR/dwrPkg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796425141;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Disposition:Content-Transfer-Encoding:In-Reply-To;
	bh=amg4aX5L9Kv7thRdHJIYsz40BJboVSAtGP6U9UZnV8k=;
	b=pjnx9nCJ5uqXvvC+0fTZXlmy8GUIIR3h4Qi0AlsVI65sxVrure9TCvETGQxyG0ZST4R3
	 5iCny5/PMbxEeHRPg7dX5LiVKCKLf2TXPzp+Nieu9NaH3O7Qyl2kIOxPCRFqPx6jqLtqb
	 hT0ImU6JKRV217jEs0lVIWvBBXUHglhJm4XvVw+Ys3bgSUlU3bCi4A4+OLQToswg44g9Y
	 Vhxmy04kmVx67Ko5ysB34XY/qgHDuORYXaEjx4oJr95eoQ9jxqBcleF3M8sBgy82Ywi2V
	 ckRUiROYZPjQ0PhI8Yo3WkmD2yheQ/PQs22jzF/EzklUF0ev2yIWm16pod1JZcNBE4w==
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=kP+nRq2y;
	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 C7BE1606A333;
	Fri,  4 Dec 2026 22:59:01 +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=kP+nRq2y
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796425141;
	b=e/L3rdX4+LLZXsjdroRRyYtJG24/6+FGVFME67WcYDvB7NAECVYhh+ihoFR9zSngPIYn
	 BX2E4Dj4C6pr5YqnWCkqv/ruYAQDHD42/o+OI8OKcx6EwlbVvSDJGTcjV1aSf+0p5J6mL
	 WMFSsMef37ngQfqZN5SnRM9gJzy+P9OzsxzX3N4zq28T0fRp2oydfuoDf1WWxwn7MkILu
	 xDzNklbXrjvyPAVQhaSgBOcxYjGYdK+0XypVkqMggWy1eQhzWYt8NH0am8WUJ0zob2Fn+
	 9021qd7nAh4lU1YRoFvx2sRLyIJaJzImw+aN+omVrpfelXG+sL5eINwBZCwg0K+r5QA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796425141;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc:
	 Subject:Message-ID:Mail-Followup-To:References:MIME-Version:
	 Content-Type:Content-Disposition:Content-Transfer-Encoding:
	 In-Reply-To;
	bh=amg4aX5L9Kv7thRdHJIYsz40BJboVSAtGP6U9UZnV8k=;
	b=Zka7Lar2DJIN8tJXlg25xFo+mOQtITG2G8EmgirsS+XjRBjmB5G5GoVOpuCGLM6plKyo
	 Xv064UiVWVaYXeSbeHHsiONSQtXRNh4jx4nHMMnCfiHgljrnmrIpc/7lvofNSgzEccPLN
	 nPTnP/AZGeJcf+w9LZ7PIRTol9VL/Pqi3GJD2YhXB0nmNQKAQOUL9QbeLT+gO1seNSdRJ
	 ocSuXHTAyxZyLQ2MKhQ7Daz+8w1il9eDhyMMFSrxG/CeW0mewUCsBVn5Ixe/snrXG6Cwo
	 oBZu73BsFoVMmNW597gaw25+gbYwhcHd5RqDAhBu85R82idQD2nfYIP/ulm6bDRuRqQ==
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=kP+nRq2y;
	arc=none smtp.remote-ip=209.85.214.170
X-Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170])
	(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 54FA1606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 22:59:00 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 54FA1606A322
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-pl1-f170.google.com with SMTP id d9443c01a7336-2f04ad2c46dso8607075ad.2
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 14:59:00 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=dama-to.20260707.gappssmtp.com; s=20260707; t=1796425139; x=1797029939; darn=vger.kernel.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:mail-followup-to:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=amg4aX5L9Kv7thRdHJIYsz40BJboVSAtGP6U9UZnV8k=;
        b=kP+nRq2y9WrSdchCp7lxSF3mvBliSRP98y+KVYu6z/Intc6SSrhsogF7ZY7H0NUudK
         JfKSwHTTKE3cFSg9Kke4GhGzqbsYsDLCMsnfJoDwS/r6w7xKKpgAyWTPEsQYccALav2X
         m/nWOhxn7VR9SuHo2ax0WtfU7AGZHGYqBVBsj14EX4pm+biXlvoTrphh7lEmxSJ7jKkV
         gHLHe3jCfocjBbixl56dmf2EdsK3xqol/by+pjxvBFtmgdML3jsGuNx34k0mMyp/+Uzu
         ymKkGMq/rGCVjBb9v7Ba1ItwQvpOYhrM/8FDvyWkhGFrBD4rskz3MvDOCVhn7OuxaGi4
         pKLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796425139; x=1797029939;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:mail-followup-to:message-id
         :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=amg4aX5L9Kv7thRdHJIYsz40BJboVSAtGP6U9UZnV8k=;
        b=WtiafK/7JeMFSExPadxxZiZdp2XhIipG6LbgB/8swNduTw6bIau4JeJ8t7Qp2p0vlN
         WJID/in90ODLHMZZ5KX3GnPg012ka8uqI/Yk3n0KEV+P4b9L9ADXta92bMBgn+mGHFnf
         GiOXAyHNfrAVEyY1Ju4xzDZtJC9mBH5/Y9ajcHaHpTRt1TEaQLedyGJD/jSXF8I14e3w
         xYPeLxIOoDix4Pn1YCqoMc2+tIAfljYhVrl3Jk9auoR0ysZZ3TimPsAXArBeEaZ2b/RW
         DOU86cE0UPHp333AZPIsTQiZMuEiWDgZIzee3N5soXsURRvYhZn7f+JiT6pvts/fOnbN
         8AUA==
X-Gm-Message-State: AB4q+uEqO9Cy5o52Qt/DYF4rbf7U8icOZ5TpsxSNN+oGxUvPscNy6z/4
	cLE/+3lxzjwNccTb9igW6b9Crz9vEy1FAsfxGN4Mspu52hTfxVYjLmFH6kgxs+F1D5M=
X-Gm-Gg: AZFdTZdLcvfgAedMPEoHvCutekevxOywrssZU6mgM31N+ILwWJcguGFkSwm4ArM+4Iz
	++dyd7eXxXHvx34QRG4fDTrEyqjEsQqPXehTLeRTy5+LRP4Y8kCAqOcBmGP5zsPjuPTsKyF+0B/
	6ix9QsqHbsWTemU0UueOc4JrsvfZCsNH0eokzOSDBS83OFiRnb7jk+e8D/uE15f1VLyny96kA75
	VzROGfYIUy66ARrSGGRwFmzMPWYr7M0G1r1MLx9Qd9NDqGn+xGEp9beLe4eBQHXjtuOhCU7AYPz
	fAgJovO6C9qnJlOaSY3d/RGAKHpmPgaYQQ0TxzVsfuAZSowtxzVO8VScEoAngb18etAm17Ek+TD
	AVjZJjfFE805MlUQu1EUuVnaq7pCo7V0rkBCT3COk1yMsygWfEy7vKTv6kz6F9zkPcNPZtnWTCE
	MXEem8GdHi9sL2PDSgbu16xHf9Eahs4ym45K636kQa/T7T+5HudOc5uOpKT/waLVInyy6OuHvU/
	ZWiI6z05Jwd3lqn1kYHErbm1UCcqLCSsxmhAJZ2eINVlKFV1uRDRa5CUxOnQpWwwUMcBNhrEat/
	Z/HeAqN+duKqSfrVFlrJX5OaLOrHJ59Dth8ylM4qI9VkYH2ZbVtnHsfjhHmPAl8=
X-Received: by 2002:a17:90b:4c50:b0:3ad:eb38:9778 with SMTP id 98e67ed59e1d1-3b5e06d58c2mr3031976a91.48.1796425139485;
        Fri, 04 Dec 2026 14:58:59 -0800 (PST)
X-Received: from localhost ([2a03:2880:2ff:72::])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6166c6149sm553113a91.2.2026.12.04.14.58.58
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 04 Dec 2026 14:58:58 -0800 (PST)
X-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>
X-Mail-Followup-To: Joe Damato <joe@dama.to>,
	Michael Chan <michael.chan@broadcom.com>, 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>
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
X-In-Reply-To: <CACKFLikOPYrjKj1dBo=3MD0oeQcqCBu02n6=JvZ8uK4FeNfdkw@mail.gmail.com>