Article View: linux.kernel.netdev
Article #27407Re: [PATCH net-next v12 05/10] bnge: add ethtool support to manage RSS contexts
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 14:46
Date: Sat, 05 Dec 2026 14:46
108 lines
11910 bytes
11910 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] In bnge_refill_dflt_rss_ctxs()
(drivers/net/ethernet/broadcom/bnge/bnge_vnic.c), the driver calls…
--
bnge: add ethtool support to manage RSS contexts
This patch adds create, modify and remove ethtool callbacks for additional
RSS contexts. Each context is backed by its own VNIC with its own
indirection table and hash key. When the RX ring count changes at open,
contexts with user tables that no longer fit are deleted, and contexts that
use the default table are resized and refilled.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_vnic.c b/drivers/net/ethernet/broadcom/bnge/bnge_vnic.c
> index a44971a7c74d3..7d587290c33ab 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_vnic.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_vnic.c
[ ... ]
> +void bnge_refill_dflt_rss_ctxs(struct bnge_dev *bd)
> +{
[ ... ]
> + if (resize) {
> + if (ethtool_rxfh_ctxs_can_resize(bd->netdev, tbl_size)) {
> + dev_warn(bd->dev,
> + "RSS contexts cannot be resized to %u entries\n",
> + tbl_size);
> + return;
> + }
> + ethtool_rxfh_ctxs_resize(bd->netdev, tbl_size);
> + }
> +
> + mutex_lock(&bd->netdev->ethtool->rss_lock);
> + xa_for_each(&bd->netdev->ethtool->rss_ctx, context, ctx) {
> + if (!ctx->indir_user_size)
> + bnge_set_dflt_rss_indir_tbl(bd, ctx);
> + }
> + mutex_unlock(&bd->netdev->ethtool->rss_lock);
> }
[Severity: Medium]
Will user space get a stale indirection table in the RSS notification
here?
ethtool_rxfh_ctxs_resize() sends ETHTOOL_MSG_RSS_NTF for every context
before it returns. At that point each table has only been resized in
place:
net/ethtool/common.c:ethtool_rxfh_ctxs_resize() {
...
xa_for_each(&dev->ethtool->rss_ctx, context, ctx) {
ethtool_rxfh_resize(ethtool_rxfh_context_indir(ctx),
ctx->indir_size, new_indir_size);
ctx->indir_size = new_indir_size;
}
mutex_unlock(&dev->ethtool->rss_lock);
xa_for_each(&dev->ethtool->rss_ctx, context, ctx)
ethtool_rss_notify(dev, ETHTOOL_MSG_RSS_NTF, context);
}
rss_prepare_ctx() copies ethtool_rxfh_context_indir(ctx) into the message
when it is built. So listeners receive the table as spread over the old
ring count.
The loop after the resize then rewrites the default-table contexts with
ethtool_rxfh_indir_default(i, bd->rx_nr_rings) and sends no further
notification. bnge_hwrm_realloc_rss_ctx_vnic() programs the hardware from
the refilled table, so the last RSS_NTF matches neither the context state
nor the device.
For example, if RX rings drop from 100 to 60, the table shrinks from 128 to
64 entries. The notified table holds entries 0..63 of the i % 100 spread,
and entries 60..63 name RX queues that no longer exist.
bnge_reserve_rings() already follows the opposite order for context 0:
/* Notify only now, so the notification reports the new ring count
* and the reset indirection table.
*/
if (indir_lost)
ethtool_rxfh_indir_lost(bd->netdev);
A related case: when the ring count changes but the table size does not,
no resize happens. The default contexts are then rewritten without any
notification.
Would it work to refill the default contexts under rss_lock before calling
ethtool_rxfh_ctxs_resize()? The other option is to send a fresh RSS_NTF
after the refill.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201132011.2705569-1-vikas.gupta%40broadcom.com
Technical Details
Message-ID:
<179648197746.3146.17151739096735720714@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378021-linux-kernel-netdev=dewy.ruReferences:
<20261201132011.2705569-6-vikas.gupta@broadcom.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378021-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v12 05/10] bnge: add ethtool support to manage RSS contexts Date: Sat, 05 Dec 2026 14:46:17 +0000 Organization: Usenet Network Message-ID: <179648197746.3146.17151739096735720714@kernel.org> References: <20261201132011.2705569-6-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="3049231"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Sx9wKarNg2eld84LCWhP8gU6Wd4= sha256:FyahbAx+uOh7onCon2Tn63WXwg0itaU2hBUqlXv+UfA= sha1:fkIpxx6RymKCPuQYxC+OjNkva0w= sha256:aqF8lHJF90ft+qi8mcwOjeSI8lceXNvyjLEG9l26Qig= 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 41E52117E45; Sat, 5 Dec 2026 17:46:52 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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, URIBL_BLOCKED=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 texHZ2-iJ1nJ; Sat, 5 Dec 2026 17:46:49 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-378021-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 0E661117E40; Sat, 5 Dec 2026 17:46:38 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id B63F32CEF2; Sat, 5 Dec 2026 14:46:36 +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=1796481985; b=pRxurn3QkjpdE2lliDATmEpa24GmqD95Wu0/kTVBwSArGwUPPJ8f8VCfELeeXqAiolpA deLVQgIPKdzPkank8qYr4ux47u2YW1Qpe1x1cbjiL0IDprcB3cx9ByhDXY0jKY/JTOEso T0qRGWbybVpFJYACHcbhNlJJyhTC+Epxop9Yg0IhOI2jvZDhoMAo8dsVrmXQ2JUWCTepw sUCVhfLV+K6+pCInsi1vrBuQFk4XwOVSL3iIyBTEcOlIvBXuijhRUgkweGWIFoTg/B0qM lYLgM7pZxaWChvXsLf8Dsdefyorcojsr2hALwg4CwF7Qr+7RWuY6Xapi+yTsrfK5SyQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481985; 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=4hSzxz9LIURxrOR3pq4S3TTdDEfWO/ZPfSS0/9wsec8=; b=t87r81xIq1D+qick2d3m2IieDbT9UMyLmONtd0L/O/gLkNdis/d4z+sd9cvgmoFU/8nb Q0Tu5cYQSXC8zGWB79tq0mAH87oypq4Za18QVqY1UdlbxIIRsGA7mWn2nO8933XRIEkdA 8wy4pVC3WgEtI3IcMf3fx4/AWsr2dgeFLWgis47hCj599upNriOyi6dE93HtSEoNwXmAr DzAxdo5kc4+hJ3I0Im8ubggMuw99XTHXJXnBgbnU5dlLVUektnFcTdF27iEwP7BgW7RDE Bor0xHXlusqBNm7naOJuUQApKsBPdH+RCJM3DSbiCHaYcF0VgWRme02/7T0zxa1ZhIQ== 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=I0C9kN1P; 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 DEC0F60A260E; Sat, 5 Dec 2026 14:46:24 +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=I0C9kN1P 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=1796481979; b=kkExPWo4KsfHnrRA5kFBllAm4Db8wNG0cDP23fvTA6qTj7sqnkmWsA4ChrkePklkPs6z sWoC1nRZDLz3MhJn0f1cS8zgGprnIx/urCrR/RNEr2O7nBZSuEULTR0PPS6z2jrMp23YW Kps4FfwgWSDMS1IXpYekduORoAaLwE6VYbXpEfhwun2elp5O3pAoB74lAfM6B36e6XMNx RMowidzH+6/dfSMzyugN3maA+zCEUZpR7FwwySf0yMBzhR1FksEkajC0jFpHJaHvd/kBN pLuLF1Z8baY3OK7g6DIvmIVkqM5g/lzcJmTD87rrtBhmV+dPd4tR1UrH9R9cSFRfdgQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481979; 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=4hSzxz9LIURxrOR3pq4S3TTdDEfWO/ZPfSS0/9wsec8=; b=DTdQi/pyKB/pY/2f95hM3mD9Xu3HIe6lf95gfHoYC0iS8RZ2dBomBdakKDmSj0eODSl8 TCLG67XUnQpsVnAHfaowHQYx9zRSjXqB09erUQWyS6VlsYjClNbAuOnSFqX/3WziDC/7d fmEtHdLBV3I72dtVH8i5TBgNWYvZJHJduRrYMIV/wxjz/ykIo5k3WnEmNg0v+JT1titBb rev0xT/IgdoIk4n3C+lig9jk1jUsESYDGDNZPcxCbdj5iRMz/D0t+mfy8L6LjfYn/ppec kD/R2kc/5ZWg3RV37cz35cTTc8ud44cdDVSV7XdXbAfzpC67IM0tmXXwy9SjtxX6/Ew== 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=I0C9kN1P; 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 0B42E606A696; Sat, 5 Dec 2026 14:46:18 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF1CD1F00A13; Sat, 5 Dec 2026 14:46:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796481978; bh=4hSzxz9LIURxrOR3pq4S3TTdDEfWO/ZPfSS0/9wsec8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I0C9kN1PWhLfIwo6zvqsng6/mqo+ehnTUWMtXst7/ZY3RhpZ0iyjkwGbRwIrvyLUT QdkvSq3W/74yPHx1yMVXILjh/8v+jL3UXc0WAxy8PR6rwQ/ook4k+iL18tBbu2zlPn D3tILliHwPld3m5tDJlSlNCvJrblCoSQ/+tdUvji+z4w1llxlBdQ/lh/gvC/WvHKzn p4uLd0Odgl+WcZ5K3bexGa2C4G1FULBlUwKfaGYwZzFmhIsOy2pIKsol/pi8nFD3pS ErzFeFv6siYCYgVxmb+Tw16NsFwV7NfOib3kAn+RHX92uuQA8VSPhvGlPNP1FngSBF Sc8+ndEIuA1sQ== 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: <20261201132011.2705569-6-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