Article View: linux.kernel.netdev
Article #2974Re: [PATCH net-next v3 7/7] bnxt_en: Fix ring accounting and validation when rings are constrained
From: Gregory Price
Date: Tue, 13 Oct 2026 21:50
Date: Tue, 13 Oct 2026 21:50
34 lines
9446 bytes
9446 bytes
On Mon, Oct 12, 2026 at 03:08:27PM -0700, Michael Chan wrote:
> When __bnxt_reserve_rings() reserves fewer TX rings than requested,
> and an XDP program is attached, the driver used to blindly subtract
> bp->tx_nr_rings_xdp from bp->tx_nr_rings, potentially causing an integer
> underflow.
>
This is outside my normal space, was reviewing this for testing and had
an agent spot what it thinks is a bug. It seemed reasonable to me but
if you think this is wrong, please ignore.
> @@ -11602,25 +11673,23 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
> if (!rc)
> rc = bnxt_init_int_mode(bp);
> bnxt_ulp_irq_restart(bp, rc);
> - } else if (irq_change && !rc) {
> - if (bnxt_change_msix(bp, irqs_required) != irqs_required)
> - rc = -ENOSPC;
> + } else if (irq_re_init && BNXT_NEW_RM(bp) && !rc) {
should this be:
} else if (irq_re_init && BNXT_NEW_RM(bp) && bp->irq_tbl && !rc) {
Note from the LLM was:
Unlike irq_change, this no longer implies bp->irq_tbl != NULL. After a
FW/AER reset irq_tbl is gone but total_irqs is stale, so if the rings
shrink we call bnxt_change_msix() with no table and fail with -ENOSPC.
Should this also check bp->irq_tbl?
~Gregory
Technical Details
Message-ID:
<as6mq_WLUJ-SiXI7@gourry-fedora-PF4VCD3F>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345903-linux-kernel-netdev=dewy.ruReferences:
<20261012220827.340998-1-michael.chan@broadcom.com> <20261012220827.340998-8-michael.chan@broadcom.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345903-linux-kernel-netdev=dewy.ru
From: gourry@gourry.net (Gregory Price)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 7/7] bnxt_en: Fix ring accounting and
validation when rings are constrained
Date: Tue, 13 Oct 2026 17:50:13 -0400
Organization: Usenet Network
Message-ID: <as6mq_WLUJ-SiXI7@gourry-fedora-PF4VCD3F>
References: <20261012220827.340998-1-michael.chan@broadcom.com>
<20261012220827.340998-8-michael.chan@broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
logging-data="2171775"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kZT4rsTVtAZRliMvlQ4UCBQxLRY= sha256:Dc7jltAeFgrD8wgqO1ctgIGTGAZxcf/VOsBaTVKswns=
sha1:/f6dIytNAEhxWuxfMUdL6ob94NY= sha256:arQ/4Epi+gTHHcMGd+bkEtHbSVVV6nNolnCpd5rBlYc=
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 4B45510FF6D; Wed, 14 Oct 2026 01:53:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
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=gourry.net
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 jb90zmmKGNtf;
Wed, 14 Oct 2026 01:52:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-345903-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=gourry.net
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id B3D5C10FF6C; Wed, 14 Oct 2026 01:52:49 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 1B7A964CAC; Tue, 13 Oct 2026 21:50:20 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id C6D6A55D893;
Tue, 13 Oct 2026 21:50:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="TYNosL4k"
X-Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id D800251EE14
for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 21:50:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791928219; cv=none; b=ebJLsq7vnBatkEahm2HDSmGkL7dsRpNeNfkXgxdrG4KdgMHhUKCKA1ZHCLQVS476KGr1Pnens3BxNZwsF5ztdR4clnmriuCdPRPUf/ypZ/Jl9UruWImVM6X1jmkS8XfUih+97TsA25nFy7AHfuyAUqE5jAievD0jUW+Muj/4+XA=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791928219; c=relaxed/simple;
bh=4W8XYeV6wWHSI3ONLzPLBeMyG/3dGElS/TVuMLGb6vM=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=SrmMMeALfc1yijlvNb0PUBY2E0qLijHB6MQthVNpqDTFWCZJ6nSih2A+g2n4khAeDMi1qlwZmg3vC7MV54yx9ay5oJ1JNusIZEXSVlwLVS1cGbct+bSE9RMK2qSrPA2V3J5YqszT+82GsoNxPmBO5MF21Uq4JoHdgQpCeNo6iXA=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=TYNosL4k; arc=none smtp.client-ip=209.85.160.174
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net
X-Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-5337fb43c16so37478851cf.3
for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 14:50:17 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gourry.net; s=google; t=1791928217; x=1792533017; darn=vger.kernel.org;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=goavh/XGokBAgELvjlyLn5UbPVFLi7w6hR6sFpVVAsg=;
b=TYNosL4kCdLGQi5TIFIIjTndQb8tLM5uYYzLySIpnVECaNeYfVkk0kc3ZVdxQKtJOO
3Epf45zl4gqUnFmX5UffffyYb4KHeH4to2HT11syibrdl1q6RLz4niKR9LyLjFtLvd4H
Jj16uDFBknX3+UPR7W2XbI2JVss+/kPAKxKqWmxn18hW3uKJue0TXpsP/hwtjL5DAq6B
gQ3slojTxh9PID6acQH12UwbbyKaPFv77kkgBfuBlpIV/ZjVvvxFuL49OTvTvUnSS/G0
dvw4V9bq4Uhpes6QuDZoaNJx0MxlyVTK6X4GZ9Byv+C1jd0UrYmkBegRXlZ66/Hd+ztx
RFDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791928217; x=1792533017;
h=in-reply-to:content-disposition:content-type:mime-version
:references: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=goavh/XGokBAgELvjlyLn5UbPVFLi7w6hR6sFpVVAsg=;
b=WGyRhIkm32y7HaP2EBYiY1LXk7T9mdi/mCqZJZRI72n4dtdrofgL2LAoCEV6f0qX46
ZqM8HsDvt4+pWd/2k4cLPe0NpDjxlqnMvbn5fCQwSaqwthtoOA8UPy7xpEqWJ6Mz8F38
oWrg+/ON5MZhDhAeW93K7Y1TvF06mX/hYr07osxfLt2RQn1tRhV2DSU6FoZNVNODdi4X
55mY29IrRLTve4yzpxM9RGPpWGkYpep8kAQXDRmzcl6zhsEHa2ThdFHa+AS86pt9FWaR
r/GG1rTigdLKBd9rYsSG54wcljS+3ZsDKu8Fedyhvo2jTbWR+LM0ZuIhR8xKkcUlwI7a
JE7Q==
X-Forwarded-Encrypted: i=1; AKwUvBzrDs11CXcwvWJyzuMhRlLKD2Q6StqmZ+L32qx8b/W0WdNvx2kcSh/uqeyE2jcg/nX8NlVS1+Q=@vger.kernel.org
X-Gm-Message-State: AFq9FYLSRHhdMMH3VCuBXcACosqi4mX4piiVo6DIui02IY2QfO70seir
1Dk/lOMvfwZCTTgSqnRq640dvGotEDzap4hPPBMjnuh2aQizC2DAdLQR7nLh2swtvk0=
X-Gm-Gg: AYBFou2aE5R2E4IbjAz+cMoXybetSt6goyoBU9CKbqUIHZ1PubWj4DmToZq6odA2KTx
RbNSb3aQ2pifPmCYxsMCjwZj3dW2k34PacfQ95heg2NkmQ8pta1JRi/Pd1GcQQzuRXz0NclK2Fy
AKR1v4Ww8p0hNL6QlZI0ASqDMSG85ju8G1/1KIlQzOsTabPa5dqjGaMHEmJtXnZLhjs6mYsi+DT
MJjjTNNr7xk7n1zOuBHu4T2GYEvWknnokP9LqKBdWy8oOwguM+Lo9Ev+JMu1z5tFCIeskbg2zcx
AdleTpgZxAZehhP0MpCX3gRtASX+/dG6qh+3iodaul8CMS5y+jraej/hbqlND+pGFCVyPUOCix6
oXKo59euGQq7NBSRUawWLvinmjxM9EhiuZDH537Uw/vtoxXLAj/TBYNQRUVXnOibetRS3TD85sb
npinVWHU4g2l9eaXU4uiTUaeQKZ+SKidiQXKyJ5WrYChXO1J/Vi5L8tFQntY3dtWcwLK/qH86KT
fqx4YMLlv0WdgQr/X3KoDhyjbbBd8/h+u6of0OcaQ8ZrSt5oTIEFcY=
X-Received: by 2002:a05:622a:228a:b0:533:8f29:e5fd with SMTP id d75a77b69052e-5359fad06fbmr209862231cf.18.1791928216595;
Tue, 13 Oct 2026 14:50:16 -0700 (PDT)
X-Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52])
by smtp.gmail.com with ESMTPSA id d75a77b69052e-535ddeffadcsm44382451cf.31.2026.10.13.14.50.15
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 13 Oct 2026 14:50:16 -0700 (PDT)
X-Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch,
pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261012220827.340998-8-michael.chan@broadcom.com>