🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25002

Re: [PATCH net-next v11 04/10] bnge: add RXFH ethtool support

#25002
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:39
188 lines
14678 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

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_get_rxfh_fields()
  (drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c), the…
- [Low] bnge_reserve_rings()
  (drivers/net/ethernet/broadcom/bnge/bnge_resc.c) treats any change in…

--

bnge: add RXFH ethtool support

This adds ethtool get/set_rxfh and get/set_rxfh_fields support to bnge.
Configuration changes are only allowed while the device is down. It also
moves the default RSS key to netdev_rss_key_fill(), and makes
bnge_reserve_rings() keep a user-configured indirection table when it
still fits, reporting a reset table with ethtool_rxfh_indir_lost().

> 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 u64 bnge_get_ethtool_ipv6_rss(struct bnge_dev *bd)
> +{
> +	if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6)
> +		return RXH_IP_SRC | RXH_IP_DST;
> +	if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL)
> +		return RXH_IP_SRC | RXH_IP_DST | RXH_IP6_FL;
> +	return 0;
> +}

[ ... ]

> +	case TCP_V6_FLOW:
> +		if (bd->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6)
> +			cmd->data |= RXH_IP_SRC | RXH_IP_DST |
> +				     RXH_L4_B_0_1 | RXH_L4_B_2_3;
> +		cmd->data |= bnge_get_ethtool_ipv6_rss(bd);
> +		break;

[ ... ]

> +static int bnge_set_rxfh_fields(struct net_device *dev,
> +				const struct ethtool_rxfh_fields *cmd,
> +				struct netlink_ext_ack *extack)
> +{

[ ... ]

> +	if (cmd->data == RXH_4TUPLE ||
> +	    cmd->data == (RXH_4TUPLE | RXH_IP6_FL))
> +		tuple = 4;

[ ... ]

> +	case IPV6_FLOW:
> +		if (cmd->data & RXH_IP6_FL) {
> +			rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL;
> +			rss_hash_cfg &= ~VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6;
> +		} else if (tuple == 2 ||
> +			   (tuple == 4 &&
> +			    (rss_hash_cfg &
> +			     VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL))) {
> +			rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6;
> +			rss_hash_cfg &= ~VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6_FLOW_LABEL;

[Severity: Medium]

Can the hardware hash on the L4 ports and the IPv6 flow label at the same
time?

bnge_set_rxfh_fields() accepts RXH_4TUPLE | RXH_IP6_FL as tuple 4. For
tcp6 this sets TCP_IPV6 and IPV6_FLOW_LABEL and clears IPV6. After that,
bnge_get_rxfh_fields() reports tcp6 as RXH_4TUPLE | RXH_IP6_FL, because
the TCP_V6_FLOW case ORs in bnge_get_ethtool_ipv6_rss().

The RX completion hash types decoded by bnge_rss_ext_op() in
bnge_hw_def.h appear to cover only the 4-tuple or the flow-label 3-tuple:

#define EXT_OP_INNER_4		0x0
#define EXT_OP_OUTER_4		0x2
#define EXT_OP_INNFL_3		0x8
#define EXT_OP_OUTFL_3		0xa

None of these is a ports-plus-flow-label type. That would mean TCP over
IPv6 is still hashed on the 4-tuple only.

If so, "ethtool -N <dev> rx-flow-hash tcp6 sdfnl" doesn't change tcp6
hashing. What it does change is all other IPv6 traffic, which moves from
the 2-tuple hash to the flow-label 3-tuple hash.

The reverse also happens. Setting plain RXH_4TUPLE on tcp6 while the
flow label is enabled takes the "tuple == 4 && IPV6_FLOW_LABEL" branch
above. That turns off flow-label hashing for every IPv6 flow type.

For comparison, bnxt_set_rxfh_fields() only accepts RXH_IP6_FL with the
2-tuple. Should bnge reject RXH_4TUPLE | RXH_IP6_FL in the same way?
And should bnge_get_rxfh_fields() stop reporting RXH_IP6_FL for an L4
flow type when that type's 4-tuple hash is enabled?

This code is unchanged at the end of the series.

[ ... ]

> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> index 5207091a72901..c1064e53cfbf8 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c

[ ... ]

> @@ -372,16 +386,31 @@ int bnge_reserve_rings(struct bnge_dev *bd)
>  	if (!bd->num_tc)
>  		bd->tx_nr_rings_per_tc = bd->tx_nr_rings;
>  
> -	if (rx_rings != bd->rx_nr_rings)
> +	rx_changed = rx_rings != bd->rx_nr_rings;
> +	if (rx_changed) {
>  		dev_warn(bd->dev, "RX rings resv reduced to %d than earlier %d requested\n",
>  			 rx_rings, bd->rx_nr_rings);
> +		indir_lost = bd->netdev &&
> +			     netif_is_rxfh_configured(bd->netdev) &&
> +			     (bnge_cal_nr_rss_ctxs(bd->rx_nr_rings) !=
> +			      bnge_cal_nr_rss_ctxs(rx_rings) ||
> +			      bnge_get_max_rss_ring(bd) >= rx_rings);
> +	}

[Severity: Low]

Is a change in bnge_cal_nr_rss_ctxs() enough by itself to treat the
user's table as lost?

bnge_get_rxfh_indir_size() is nr_rss_ctxs * BNGE_RSS_TABLE_ENTRIES, so a
change in the context count means the table shrinks. The ethtool core
already provides ethtool_rxfh_indir_can_resize() and
ethtool_rxfh_indir_resize() for this case. ethtool_rxfh_can_resize()
allows a shrink when the table is periodic:

	if (new_size < old_size) {
		if (new_size < user_size)
			return false;
		if (old_size % new_size)
			return false;
		if (!ethtool_rxfh_is_periodic(tbl, old_size, new_size))
			return false;
		return true;
	}

A short table set over netlink is replicated across the device table, so
it meets these conditions. One example is a 64-entry user table whose
entries all point at rings below the new rx count.

In bnge_reserve_rings() such a table is still reset by
bnge_set_dflt_rss_indir_tbl(). ethtool_rxfh_indir_lost() is then called,
which does three things:

- logs "device error, RSS indirection table lost"
- clears rss_indir_user_size
- sends ETHTOOL_MSG_RSS_NTF

The ethtool_rxfh_indir_lost() kernel-doc says to call it when the device
can no longer maintain the user-configured indirection table.

bnxt_reserve_rings() uses the same conservative condition. The commit
message also says the table is reset when it no longer "fits", so this
looks intentional.

Would it make sense to check with the core helpers whether the table can
be folded into the smaller size before dropping it?

This code is unchanged at the end of the series.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130055736.2306367-1-vikas.gupta%40broadcom.com
Technical Details
Message-ID: <179610717939.3146.6640777046198275654@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.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-374740-linux-kernel-netdev=dewy.ru
References: <20261130055736.2306367-5-vikas.gupta@broadcom.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.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-374740-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v11 04/10] bnge: add RXFH ethtool support
Date: Tue, 01 Dec 2026 06:39:39 +0000
Organization: Usenet Network
Message-ID: <179610717939.3146.6640777046198275654@kernel.org>
References: <20261130055736.2306367-5-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="1637642"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/ai6mCtwwja8NSMMQVdjEt8seUE= sha256:rgnnmWQ7mqF07bn7vpGwmJd/GHABpH2VTuycHEfABxQ=
	sha1:yINhPo3kQOoI3mPNDDGytBP/os0= sha256:FSM5ZrWTZ0RRY5eaEtjoen3bBZu2TB+s85GhHi2wBkk=
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 65F2D117269; Tue,  1 Dec 2026 09:40:20 +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 Z3eS_zjXGehK;
	Tue,  1 Dec 2026 09:40:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374740-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 73482117264; Tue,  1 Dec 2026 09:40:08 +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 DD1DE279EB; Tue,  1 Dec 2026 06:40:00 +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=1796107187;
	b=XV1Y6ENl8IuhG5R9rj67AHsyd7tJg8aFtnAsW0+4DmlwclV5/WvJkNWd2oTAsSg+KTtn
	 3rrPbnzUM5OR9w8suI5dEK6LnC/NCWR7wj8Ji4FIeJ2yICw5hipYVS1g1Ii+T6Dgu8PFt
	 newfLUqX/YYp71lx+PvMHMNoE6fcXbErvIJUa2dOcLgwdpvdsl/d3LCLv1iwmUSNXtjdx
	 luEPyeTH1ZRmHbeJL5VvM0/LJwVmDUP2AjBoCvfzgsI+Au1usEJNLJVOWDwXf2SPub07Z
	 cHCmP3xPAWuVkBunD+cE9kpjhAzUy3c0doM+GE3PHe6nBFfRxFK1HA2rm3o/RrQbjsg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796107187;
	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=pzMaEtI0gDp7NitsJVLqlzM5kqkH7oOSbJZdOXLUEtI=;
	b=nvTAeq3VtTdAb6acytsfAFA9IZ4PJSRXpiOWmJmeyyV0OvJjUVoxejrN1JIhLta6na8B
	 YPKf2X3X0gF39IoPDoxXPtEBpwuFQqqiYJm11V80jJZ79rH3z/hFvBhAZzj1jNf4sRjyR
	 ChtcSjfJeX25CLaxf4c2bKiW45lb40WlMw+5j/qLZjmi9FpPwVFkuWBmI2v4apUmADsaD
	 ybms9/XhE7RvixR2+RDahx8TET5mkCPu02xK686I+i0hLvAbPc6Ro8joYSyU35q8dDJgU
	 v5hNBJe2oSBm+BGTc7N+5Ns0pNwukHQSjG2OkU5bwG4kkh6DBpt0YB4WOerx5QvJcTQ==
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=T7oFHa6z;
	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 EB1FA606A68F;
	Tue,  1 Dec 2026 06:39:46 +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=T7oFHa6z
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=1796107181;
	b=yY7u2PfIkQcyCO3Wvtw1zERJeb29P9Pkstdy2qG4xKHVxnNDVgxCXjsmyvEzQ5u0PUwF
	 rBMsswgC1R0a1t0qtM2s3YU/QVcT2An59rh7rAwOhlvLyAHRZP8DpcLsKBD/DZFOu/bk0
	 tpdRlr64mjPfAGbzJvTq76l85SU2cAYsfjVnyandAOG5nlNMRLfCIhpbLv1stkms+P/5V
	 /J0MQ+WSaOirCLcWQ9ZFlPre2WQSFbateWhOQaJTkcKcXzlKUJu+A884ZfzGfExk2cKNn
	 iXVqjLd2lwdTZpjccsv9Zf+u6fY0KD6OOqFPJ+zjklkEMbZG9afk1jN28bgd3g5AwAg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796107181;
	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=pzMaEtI0gDp7NitsJVLqlzM5kqkH7oOSbJZdOXLUEtI=;
	b=3RynyPD5ivfV4I7u26kMaUMm7bE+jav4VRNCNUwy0niNyjji5IzDFhS6xD7wzFnCuY5a
	 OJxlITfwTEfXzMZIPBx8Go34Y0Jo0PXdpces2sxZjtG2rTCONcL4YG0rg0Iji5q/f880A
	 HAkznwrs4DcoAlYJywCy6rxJ5Kwn7KySfk9ate22Dev8NsOcnSyc8vsgfxhplqXH07tVN
	 L2JlO2mBZmcbxNPTuWZjzKp07w2mXrxwgFf8yDdItt97JD6D0nibvDQZ67uOwJj5mjhpF
	 5tkaqHKM28sqCD6xpfAZbx7c7tgX7ohAMUpbP895LrVHzfiE/uJw92B9muEqnBd+tmw==
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=T7oFHa6z;
	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 16960606A695;
	Tue,  1 Dec 2026 06:39:40 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D56261F000C1;
	Tue,  1 Dec 2026 06:39:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796107180;
	bh=pzMaEtI0gDp7NitsJVLqlzM5kqkH7oOSbJZdOXLUEtI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=T7oFHa6z7QZl1h6KB9iJ8aawJo0FU2hFiIIrP5B0ZNTrxNKzJ3q2nwbMctrGPHsz/
	 HNuarqb0lr1MCEOqpaouLa8/dJOqdjK7Wq6pa8yT0kFaC4y+gXZgUxCz3JNHkqAUjw
	 eLrV0rFu8NBYL+2P3/awNsGPyHs/twgi1eF8Kr4ngEIavT5fYSrvDAx0vhjFCwlHFy
	 xEtOr7D4UobR8IWLo0vRHk5Oh3nFCTmDrPojyRSmsvXciml1LWevbWbLFmUXKrbNQ+
	 Ka51wfj6eA6zGjCEHde858ZNCeKf0z+nPAlwDHqP1o4oOx2QW0JUGUoikoXH/aBA9N
	 bXS7Ux6AqB8VA==
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-5-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