Article View: linux.kernel.netdev
Article #25001Re: [PATCH net-next v11 05/10] bnge: add ethtool support to manage RSS contexts
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:39
Date: Tue, 01 Dec 2026 06:39
136 lines
12828 bytes
12828 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 drivers/net/ethernet/broadcom/bnge/bnge_vnic.c,
bnge_refill_dflt_rss_ctxs() sends RSS notifications with the wrong…
--
bnge: add ethtool support to manage RSS contexts
This patch adds ethtool callbacks to create, modify and remove RSS
contexts. Each context gets its own VNIC with its own indirection table
and hash key. When the RX ring count changes, contexts whose user tables
no longer fit are deleted. Contexts that use the default table are
resized and refilled.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> index c1064e53cfbf8..18f01b41b8cc1 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
[ ... ]
> @@ -403,7 +422,8 @@ int bnge_reserve_rings(struct bnge_dev *bd)
> if (old_rx_rings != bd->hw_resc.resv_rx_rings || rx_changed) {
> if (!bd->netdev || indir_lost ||
> !netif_is_rxfh_configured(bd->netdev))
> - bnge_set_dflt_rss_indir_tbl(bd);
> + bnge_set_dflt_rss_indir_tbl(bd, NULL);
> + bnge_refill_dflt_rss_ctxs(bd);
> }
[ ... ]
> 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)
> +{
> + struct ethtool_rxfh_context *ctx;
> + unsigned long context;
> + bool resize = false;
> + u32 tbl_size;
> +
> + if (!bd->netdev)
> + return;
> +
> + tbl_size = bnge_get_rxfh_indir_size(bd);
> + mutex_lock(&bd->netdev->ethtool->rss_lock);
> + xa_for_each(&bd->netdev->ethtool->rss_ctx, context, ctx) {
> + if (ctx->indir_size != tbl_size) {
> + resize = true;
> + break;
> + }
> + }
> + mutex_unlock(&bd->netdev->ethtool->rss_lock);
> +
> + /* bnge_check_rss_ctxs_lost() already dropped every context with a
> + * user table when the table size changed, even if the table could
> + * have been folded. Only the default contexts are resized here.
> + */
> + 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]
Does this send RSS notifications that carry the wrong indirection table
for contexts using the default table?
ethtool_rxfh_ctxs_resize() in net/ethtool/common.c replicates the old
entries into the new size and then notifies each context:
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);
}
The ETHTOOL_MSG_RSS_NTF payload is built right away from
ethtool_rxfh_context_indir(ctx), so it contains the old ring layout
stretched to the new size.
Only after that does bnge_refill_dflt_rss_ctxs() overwrite the table
with i % bd->rx_nr_rings for the new ring count.
bnge_fill_hw_rss_tbl() later programs that rewritten table into the
VNIC. No second notification is sent.
For example, going from 64 to 128 entries, the notified entry 64 is the
old tbl[0] == 0. The stored and programmed value is 64 % M, where M is
the new ring count.
When the ring count changes but bnge_get_rxfh_indir_size() stays the
same, there is no resize at all. The default context tables are
rewritten and no notification goes out.
In both cases, a listener such as ethtool --monitor ends up with a table
that matches neither the kernel state nor the hardware. Could the
default contexts be refilled first, with the notifications sent after
the final table is written?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130055736.2306367-1-vikas.gupta%40broadcom.com
Technical Details
Message-ID:
<179610718092.3146.10172007538898640839@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-374741-linux-kernel-netdev=dewy.ruReferences:
<20261130055736.2306367-6-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-374741-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v11 05/10] bnge: add ethtool support to manage RSS contexts Date: Tue, 01 Dec 2026 06:39:40 +0000 Organization: Usenet Network Message-ID: <179610718092.3146.10172007538898640839@kernel.org> References: <20261130055736.2306367-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="1637588"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:kZfQsqtm7rGsANKxQyOlWXqTTxY= sha256:SwbX2IdLGzgwBCwVArhKrD92BGi0sVthCs0gbG7OeJ4= sha1:PAxOITOS4OjbLTJ/HVK++vNTEiQ= sha256:cEjFDVAQZ9cXGnXlzcNsTqSUvCJWRM7NFA4gKMz2g/U= 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 0FCC2117269; Tue, 1 Dec 2026 09:40:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[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, 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 5YSd6LiKmKGJ; Tue, 1 Dec 2026 09:40:09 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374741-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B9DA6117265; Tue, 1 Dec 2026 09:39:58 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 41A3B266D0; Tue, 1 Dec 2026 06:39: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=1796107183; b=G74RP1LvR5tyA+lz0/a+N8w2ODiFzdqpVjCiC8QfWD4eBqnI/WDYCrTTPUOydK3GZvvg heIPe8FjiN+r2Nq1uCkmi+VsIiG4mLmYOPcO/60mQj7FOkGpzzKYQyqaq2r1g1WrK0cQn rwpe0Yd71AmAvB8CfOhDCf+jLpF++1vrc3+sFZ26n8Tl4zeAVgpis70McKlRqu+m2d8Pp tXZAGnz1ShxCRor4bpmWmp2wtvrxJbuoSTQwTt22i0eGT7u+hlBLt/PObiS6FFbCiRGtC GopBTnWCjJa8zloFv60rnpo+VP9pH3kwG5hjvWu2fS9GW/KueLH5Lbfa7scn7HX9hFw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107183; 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=Hdyo3Z5UVqSuk5bBO0yAGJf+HLyq+vKhRrIMB915/SM=; b=wY69wSWE8ye5i/jglPEgcRxR/76rOwF5oMS3J3W45wH9OlKVVLIec3n63Y8KBPsSlBul we2GE+tfr9GiOf7cZI4OSdZC3Bt0I04L+o2TFJ99KPBMom97jae6XxqaXbDotgvUJNpXS gBTFb1b9TzZP5SdGB+Iqxh1Rh9Sfuc87KFq4Z5FlHkuK9Eg3i2ViVLdvYC4e+5IvUqGHz 2h/hSyPvdkz8ifnb87qwptzpoL4X9mDUmG2N/pZUIWgXm5dlso8K10OEyg8hoKzdT21vJ 0JevgZH3/+s+Yf8lEkaDAUQN0LtEt8DBGnWu7yKUF7MNmNLTVC4mu2dhVh02aZuJw8A== 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=FbZmk+4j; 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 69C4C606A6B3; Tue, 1 Dec 2026 06:39:43 +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=FbZmk+4j 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=1796107182; b=FAoADPWkcJ6bZTEHc4hipyAiQYXnMtmAw4kdjfgziNKBxFglEg7pJZzH4Z9XcC/HU+Ea 3RMb1RcJhK/BEdOosa/6EEsaEqXHv8VRTVjwtWKBNoU+PE/KiODz0hLQQMpfVO7uvaX3Y WsMzdQygQc6Z4D8a5yKPsydjc/RWX8WSro3bCVxdTqx71bZukUbHI2XjO2oe9r2SW5AZZ BRrtDAEpdJjInu34X9c6R4G58/RRBhMhUUpr7LBDaqROb7w2NcDsIUf6MkIkZTXesYgmZ PeXPR3nwXE7VWyPdH97D/WZY/kzkkh4SnLN3BJgyHt6bxqjXxRyXYd08a6buImQFN/A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107182; 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=Hdyo3Z5UVqSuk5bBO0yAGJf+HLyq+vKhRrIMB915/SM=; b=a8OAq3nUGhp3HnWkko0uW8alXEoHFI0gjvmRGRuCvmONgfHDuPA0SRlIxK/clnMSd1mB RCjE4bTRHGFYOpAktIQxFjbtC/1+3ORJHiBnGW2VAHibd+euEYxj6+8sSzuAnLWMZNCtT qRW4lieQ4i85jhB9PuEWyWHicPsH4Zm6hfwGCmhCT5chuD64jEx/kT9iDEFDZN9fDSrIp llIF8ZAw+pK/LVFJpJxTcl+YOzPZXO9H05kI/PJYIFWR5CuSc9QoD/HlE8VO6dIxaDXLo gHYuTHKo7pINnEz3CCJ4bKPHzWNITF0KogrKjI50abneypu/OpovSYW0oNpiJNOuFiQ== 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=FbZmk+4j; 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 8C0C6606A6A5; Tue, 1 Dec 2026 06:39:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64EC41F000C1; Tue, 1 Dec 2026 06:39:41 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107182; bh=Hdyo3Z5UVqSuk5bBO0yAGJf+HLyq+vKhRrIMB915/SM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FbZmk+4jRWX2T+np6TFPp0+to793XsvW2Qya3C54wQsU2lHF8poAivWWdKbmrWT+Y cGxvxyr+cfStWUGKtRKhfp0vTJOv6yI0C5Vbz1k8/fJGVvCyE15ZILa7Z9z4npeDzQ 9Iz2Xf+gVztqZ/iv9G3aMi4a1vT0aMWV6nI9Ctf8N6j1319Ya4yO8yrepu4DY9kejo 5b6bQCUmh/O3zy1gWZhHcelwF6VlPUU8PLPZ6yBpw2f8mjEk+hMvXU+V6ojJ/zDpUO Vb9HWMzRBFiCx1mVs0RsDEvRpuzAJjHgOYrOjynV93CULHnKX0ijEcDiSvgAS5wlQw eJpTAqiIysGuQ== 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: <20261130055736.2306367-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