From: netdev-bot+sashiko@kernel.org
To: vikas.gupta@broadcom.com
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
Subject: Re: [PATCH net-next v6 04/10] bnge: add RXFH ethtool support
Date: Tue, 10 Nov 2026 16:19:13 +0000 [thread overview]
Message-ID: <179432755388.994134.9789036024798595217@kernel.org> (raw)
In-Reply-To: <20261106093524.838341-5-vikas.gupta@broadcom.com>
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 adds bnge_set_rxfh_fields() (bnge_ethtool.c:856),
which lets userspace change bd->rss_hash_cfg while the interface is…
--
bnge: add RXFH ethtool support
This commit adds ethtool RXFH operations to bnge for reading and
programming the RSS hash key, indirection table and hash fields. The set
operations are only allowed while the device is down. It also changes the
default RSS key to the system-wide netdev_rss_key_fill() key.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> index 2467e44de291a..878fe4888160f 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
[ ... ]
> +static int bnge_set_rxfh_fields(struct net_device *dev,
> + const struct ethtool_rxfh_fields *cmd,
> + struct netlink_ext_ack *extack)
> +{
[ ... ]
> + if (bd->rss_hash_cfg == rss_hash_cfg)
> + return 0;
> +
> + if (netif_running(dev)) {
> + NL_SET_ERR_MSG_MOD(extack,
> + "RSS configuration can only be changed while the interface is down");
> + return -EBUSY;
> + }
> +
> + bd->rss_hash_cfg = rss_hash_cfg;
> +
> + return 0;
[Severity: Medium]
Could the hash fields set here be silently replaced at the next open on
firmware that advertises BNGE_RSS_CAP_RSS_HASH_TYPE_DELTA?
The new value is only stored in bd->rss_hash_cfg and 0 is returned at
once. Firmware first sees it on open, via
bnge_open_core()->bnge_init_chip()->bnge_setup_vnic()->
bnge_hwrm_vnic_set_rss(). That path always sends the full state, with no
INCLUDE/EXCLUDE flag:
drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c:__bnge_hwrm_vnic_set_rss() {
...
req->hash_type = cpu_to_le32(bd->rss_hash_cfg);
...
}
Right after that, bnge_init_chip() reads the value back from firmware and
writes it over the stored one:
drivers/net/ethernet/broadcom/bnge/bnge_netdev.c:bnge_init_chip() {
...
if (bd->rss_cap & BNGE_RSS_CAP_RSS_HASH_TYPE_DELTA)
bnge_hwrm_update_rss_hash_cfg(bn);
...
}
drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c:bnge_hwrm_update_rss_hash_cfg() {
...
if (!bnge_hwrm_req_send(bd, req))
bd->rss_hash_cfg =
le32_to_cpu(resp->hash_type) ?: bd->rss_hash_cfg;
...
}
bnxt uses the same HWRM interface, and it switches to delta semantics
whenever this capability is set:
bnxt_set_dflt_rss_hash_type() sets rss_hash_delta = rss_hash_cfg
bnxt_set_rxfh_fields() sets rss_hash_delta = old ^ new
__bnxt_hwrm_vnic_set_rss() sends HASH_TYPE_INCLUDE/EXCLUDE
If DELTA-mode firmware does not apply a plain full-state hash_type as
requested, would the user's "ethtool -N <dev> rx-flow-hash ..." setting
be dropped at the next "ip link set up"? In that case there is no error
or extack warning, and bd->rss_hash_cfg quietly takes on firmware's
value.
Before this patch the full-state send and the readback already existed,
but nothing user-driven changed rss_hash_cfg. Later patches in the series
don't seem to add INCLUDE/EXCLUDE handling or a check of the readback
against the requested value.
Should __bnge_hwrm_vnic_set_rss() use INCLUDE/EXCLUDE when
BNGE_RSS_CAP_RSS_HASH_TYPE_DELTA is set? Alternatively, should the
readback be checked against the requested configuration?
> +
> +err_l3_shared:
> + NL_SET_ERR_MSG_MOD(extack,
> + "2-tuple hashing is shared by all flows of an IP version, use ip4/ip6 to disable it");
> + return -EINVAL;
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106093524.838341-1-vikas.gupta%40broadcom.com
next prev parent reply other threads:[~2026-11-10 16:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 9:35 [PATCH net-next v6 00/10] add features to bnge Vikas Gupta
2026-11-06 9:35 ` [PATCH net-next v6 01/10] bnge: restructure VNIC and filter code Vikas Gupta
2026-11-06 9:35 ` [PATCH net-next v6 02/10] bnge: add NTUPLE/ARFS VNIC Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 03/10] bnge: add helper functions for multi RSS contexts Vikas Gupta
2026-11-06 9:35 ` [PATCH net-next v6 04/10] bnge: add RXFH ethtool support Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko [this message]
2026-11-06 9:35 ` [PATCH net-next v6 05/10] bnge: add ethtool support to manage RSS contexts Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 06/10] bnge: remove refcount from L2 filter Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 07/10] bnge: add NTUPLE filter infrastructure Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 08/10] bnge: add NTUPLE filter support in ethtool Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 09/10] bnge: add aRFS flow steering ndo support Vikas Gupta
2026-11-10 16:19 ` netdev-bot+sashiko
2026-11-06 9:35 ` [PATCH net-next v6 10/10] bnge: add cpu_rmap support for IRQ affinity Vikas Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179432755388.994134.9789036024798595217@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=bhargava.marreddy@broadcom.com \
--cc=davem@davemloft.net \
--cc=dharmender.garg@broadcom.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rahul-rg.gupta@broadcom.com \
--cc=rajashekar.hudumula@broadcom.com \
--cc=vikas.gupta@broadcom.com \
--cc=vsrama-krishna.nemani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®