From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D56261F000C1; Tue, 1 Dec 2026 06:39:39 +0000 (UTC) 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== Subject: Re: [PATCH net-next v11 04/10] bnge: add RXFH ethtool support 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 Date: Tue, 01 Dec 2026 06:39:39 +0000 Message-ID: <179610717939.3146.6640777046198275654@kernel.org> In-Reply-To: <20261130055736.2306367-5-vikas.gupta@broadcom.com> References: <20261130055736.2306367-5-vikas.gupta@broadcom.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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 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