Article View: linux.kernel.netdev
Article #24148Re: [PATCH net-next v10 02/10] bnge: add NTUPLE/ARFS VNIC
From: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 12:46
Date: Sun, 29 Nov 2026 12:46
151 lines
13659 bytes
13659 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] This patch makes the second (NTUPLE/aRFS) VNIC, and twice the
RSS contexts, a hard probe requirement.
--
bnge: add NTUPLE/ARFS VNIC
This patch adds a second VNIC for NTUPLE/aRFS, which bnge_init_chip()
allocates and configures on every open. bnge_rings_ok() now requires at
least BNGE_BASE_VNICS (2) VNICs and twice the RSS contexts. That check
now runs before the driver ring counts are updated. The patch also adds
ndo_fix_features/ndo_set_features handling for NETIF_F_NTUPLE.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> index 01205b161d822..5207091a72901 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> @@ -206,12 +206,16 @@ int bnge_cal_nr_rss_ctxs(u16 rx_rings)
> static u16 bnge_get_total_rss_ctxs(struct bnge_dev *bd,
> struct bnge_hw_rings *hwr)
> {
> - return bnge_cal_nr_rss_ctxs(hwr->grp);
> + u16 rss_ctx = bnge_cal_nr_rss_ctxs(hwr->grp);
> +
> + rss_ctx *= hwr->vnic;
> +
> + return rss_ctx;
> }
>
> static u16 bnge_get_total_vnics(struct bnge_dev *bd)
> {
> - return 1;
> + return BNGE_BASE_VNICS;
> }
[ ... ]
> @@ -237,8 +241,12 @@ static void bnge_copy_reserved_rings(struct bnge_dev *bd,
>
> static bool bnge_rings_ok(struct bnge_hw_rings *hwr)
> {
> - return hwr->tx && hwr->rx && hwr->nq && hwr->grp && hwr->vnic &&
> - hwr->stat && hwr->cmpl;
> + /* The default and the NTUPLE VNICs each need a full set of RSS
> + * contexts for the final number of ring groups.
> + */
> + return hwr->tx && hwr->rx && hwr->nq && hwr->grp &&
> + hwr->vnic >= BNGE_BASE_VNICS && hwr->stat && hwr->cmpl &&
> + hwr->rss_ctx >= bnge_cal_nr_rss_ctxs(hwr->grp) * BNGE_BASE_VNICS;
> }
[ ... ]
> @@ -347,6 +358,16 @@ int bnge_reserve_rings(struct bnge_dev *bd)
> hwr.rx = rx_rings << 1;
> tx_cp = hwr.tx;
> hwr.nq = sh ? max_t(u16, tx_cp, rx_rings) : tx_cp + rx_rings;
> +
> + /* One ring group per rx ring, so rss_ctx is checked against the final
> + * rx ring count. Fail before the driver ring counts (tx, rx and nq) are
> + * changed, so that a failed call does not leave reduced counts behind
> + * for the next call to find unchanged.
> + */
> + hwr.grp = rx_rings;
> + if (!bnge_rings_ok(&hwr))
> + return -ENOMEM;
[Severity: Medium]
Could this cause probe to fail on setups that probed fine before this
patch?
Earlier in bnge_reserve_rings(), rx_rings is clamped to the granted rx
rings and ring groups. It is not clamped to the granted RSS contexts:
rx_rings = min_t(u16, rx_rings, hwr.grp);
The demand from bnge_cal_nr_rss_ctxs() grows with the rx ring count. It
is 1 context for up to 64 rings, 2 for up to 128, 4 for up to 256, and
capped at 8 beyond that. With two VNICs the request can now reach 16
instead of 8.
bnge_net_init_dflt_rings() takes the default rx ring count from
netif_get_num_default_rss_queues(). bnge_hwrm_func_qcaps() reads
hw_resc->max_rsscos_ctxs and hw_resc->max_vnics, but neither
_bnge_get_max_rings() nor bnge_get_dflt_rings() uses them to size the
rings.
Firmware might grant fewer RSS contexts than requested. One example is a
many-core host where firmware covers one VNIC's contexts but not two.
Firmware might also limit the function to one VNIC. In both cases this
path runs:
bnge_net_init_dflt_config()
bnge_net_init_dflt_rings()
bnge_reserve_rings()
bnge_rings_ok() returns false
return -ENOMEM
Both reservation attempts in bnge_net_init_dflt_rings() fail this way,
and the probe in bnge_core.c jumps to err_fw_reg. In the RSS context
case, a smaller rx ring count that fits the grant would have worked.
The commit message says:
Firmware grants these to every supported function. If it grants fewer,
bnge_reserve_rings() fails with -ENOMEM and the device does not probe,
so there is no fallback to a single VNIC.
What guarantees this? Nothing in the driver checks it, and
NETIF_F_NTUPLE is not advertised yet at this point in the series.
For comparison, bnxt_rfs_capable() checks the needed VNICs and RSS
contexts against bnxt_get_max_func_vnics(), bnxt_get_max_func_rss_ctxs()
and the reserved values. On a shortfall it disables NTUPLE rather than
failing. bnxt also gates the NTUPLE VNIC on BNXT_SUPPORTS_NTUPLE_VNIC.
Here, the patch removes BNGE_FW_CAP_CFA_RFS_RING_TBL_IDX_V3 from bnge.h,
and bnge_init_chip() calls bnge_alloc_rfs_vnic() with no capability
check.
Would it work to reduce rx_rings to fit the granted rss_ctx, or to fall
back to a single VNIC with NTUPLE off, instead of failing the probe?
This doesn't change by the end of the series. bnge_rings_ok() still
requires BNGE_BASE_VNICS VNICs and twice the RSS contexts, and
bnge_set_dflt_rfs() turns NTUPLE on unconditionally. A later patch adds
bnge_rss_ctx_capable(), which treats max_vnics/max_rss_ctxs as a real
limit for additional RSS contexts. Nothing applies that limit to the two
base VNICs.
> +
> bd->tx_nr_rings = hwr.tx;
> if (!bd->num_tc)
> bd->tx_nr_rings_per_tc = bd->tx_nr_rings;
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125115434.2080590-1-vikas.gupta%40broadcom.com
Technical Details
Message-ID:
<179595640268.3146.9271118388454673823@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373492-linux-kernel-netdev=dewy.ruReferences:
<20261125115434.2080590-3-vikas.gupta@broadcom.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373492-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v10 02/10] bnge: add NTUPLE/ARFS VNIC Date: Sun, 29 Nov 2026 12:46:42 +0000 Organization: Usenet Network Message-ID: <179595640268.3146.9271118388454673823@kernel.org> References: <20261125115434.2080590-3-vikas.gupta@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1169816"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BcGTKSpYJkaWxJKzlgjjaa2kxZ8= sha256:WfdiXpa3Nxtb4cxi6vMYVOVjyxS5wmtk+/pnFudlXM0= sha1:TJY547EZZE+BQRBNljzaZ2sopJM= sha256:xc7We6qsQU8vXqA6xz9WsB2O4WZgylhlz0hs79nrsQg= 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 A55B9125F98; Sun, 29 Nov 2026 15:47:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 tKYUG7MiLKGj; Sun, 29 Nov 2026 15:47:11 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373492-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E52A8125F9A; Sun, 29 Nov 2026 15:47:02 +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 037F525E72; Sun, 29 Nov 2026 12:46:53 +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=1795956410; b=NnLXTwChwLelPAtABpkymd9s8RD8v1G7UkpRdBGikgyDbgNprQwaTaKdkEkeDpIRqof7 aRvQcuvN3m7msBplciTPphZMneWcqhmfvJO+WkAQBwX8kpemNQYWjQ+NsZMy9r7XWe1UO 12ksI7SwD2nyrLtjxYxTvx9AI4lf4oIFzuZQIon2qinqnmN3cjH6cnAHTImrUX6E1Gl0T Jf4zEXzMyhF4HQMOorazchHuw68XEgRAxqSPLbZ1v0loNA7h7syKx9r9COwM8Exore4E+ kw5FVFw1f2o4wszdSIZRYA9BA2LSvpYp38Jn5VpsDQ7jSYXCXDd62tjZZfjgaEbZkSg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795956410; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=Tvb22Ax96VFUXAzw54SMQcPRYBdKDv14O7FsY5nR544=; b=wWPgpDvge1JjqfENHtJZlIhguDi1AUUsoBDPjptEOuhnYAx7BnNxVjBVi+GZKP8JvNsx uVM4bZ9lTlWj9LfP4lgreAq5SZSrsqjKBSuMPWckXW8AaK8Ot1SO3SNvUDasLbiAK5LO1 AryiWvmXIgdDxeB3gGHVSL9+5QAPAAnqruHEJ6qai2+3LhOs52gVgdhlcpEQ1rmfMByRr PKyDf67oLW3+vvjnbeQLH4g5yVPfRAv1KIVgoQVzMGz2kxiZ3J24SK9FSldwNestldgxV eghoPr0PHU59u0ifJksPwCDuxOtGPzgXZlmC/P2vVFLap1moDMHY/cjAo72iCozJCDA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WFUxcQzd; 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 442AC606A699; Sun, 29 Nov 2026 12:46:50 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WFUxcQzd X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795956404; b=SzDGuvwlPAP2soJ0kxKY7+C2w+QyEirZ2jdQulJN85itlh4LfP244XJVHX4pAuxsOqfh 9Yhr3r6FuvnGn+1KRLuTQACpXzg1gZYiSvMsRHr32encRSSqF5E7yviGkqgonPQEKKCG5 OGm+yzO1OxUPduA3CN8+PEe2A9MSJBwaEfHMIhNB7PWXhU2fdA/eHH7wD5KP+RK0FuzAI Rrue0zeUkUshRoKJ2bOmF1VSq38rqLRRwS2Nkfz5QUWIUqEeSh0vEMckQjaTn+BYENyPx WoeIaMhLb+zfZ4uqHEh+9TN8bgCaF0GywaBFiAGAiA3a4vbEIFXEaGe/YPPuN7Gcg9Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795956404; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=Tvb22Ax96VFUXAzw54SMQcPRYBdKDv14O7FsY5nR544=; b=o8TdoRjfq54ptgt0fkN88rqo9FfMw3gyaH5T56xJ9NmCL/sAYjIP0OywTZfp8iWSmDLf j2R4l9XdypxZa1hGSvJACTQ6s3kx23swSqLacBHz3sM3g7DhUqkxkJ3l/WYbw883LNWxD klScEKDWZ25mF5a5CMliRnSHU3ck+RI5N4p8RaXLysYOzqXq6pPOQcH+7u76LUInlbZ2s bRnM2UjVBIRg9/brTIOBByY4vG6onpz8XgvNqxX8IFodXnge1UWXjTx6x4AxcGPpB6rsS U69uRFRfKBPnorZHCAG2O5/nHIQo/d7agVpkYJMDkMajx1i8uG2zNEpW6cHn3kI7tOw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WFUxcQzd; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62A5A606A31C; Sun, 29 Nov 2026 12:46:44 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9C41F000C1; Sun, 29 Nov 2026 12:46:43 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795956404; bh=Tvb22Ax96VFUXAzw54SMQcPRYBdKDv14O7FsY5nR544=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WFUxcQzdR6BuOqBbPfKtENAyKKzVXC13IUcUocRCUc9Ygoa5V6S3w9bfPFHwPCY2e MWmk5+H4nCTGpmE+WXGj5pMf72nS6/pmNIikbO66elnVnAfh820mfuhBr6vRgZNt+i 0kRS+5fmbt0FZcrZI5oYlolRwXMdPz04mIJIJfwxSLP4lM/yONX62MPrw+ZO10uRc2 28kWPnqgWu7W5YtQapOWmuJaHk6W8L0A/YUuxaHbE328KRSERGe84/tUO1t9txo8dL 3SOV/1vECfJLOwZbY8y9R9VY6gcKC3BmaACLUxMLCBkq8W2y/rmx+yMzZyrgA3/7D7 CUMURnDS3nqyg== X-Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bhargava.marreddy@broadcom.com, rahul-rg.gupta@broadcom.com, vsrama-krishna.nemani@broadcom.com, rajashekar.hudumula@broadcom.com, dharmender.garg@broadcom.com, ajit.khaparde@broadcom.com X-In-Reply-To: <20261125115434.2080590-3-vikas.gupta@broadcom.com> X-sashiko-severity: Medium 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