Article View: linux.kernel.netdev
Article #22119Re: [PATCH net-next v7 02/15] ice: prepare RSS LUT config for runtime LUT changes
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 21:57
Date: Tue, 24 Nov 2026 21:57
162 lines
14666 bytes
14666 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The ice_cfg_rdma_fltr() change
(drivers/net/ethernet/intel/ice/ice_switch.c) fixes a user-visible…
- [Low] The commit message says pf->rss_lut_lock protects "q_opt_rss of
the VSI context" and is taken "around VSI context writes that include…
- [Low] The patch adds scoped_guard() (a scope-based cleanup helper) to
functions that also use goto-based cleanup labels.
--
ice: prepare RSS LUT config for runtime LUT changes
This commit adds pf->rss_lut_lock to protect the RSS LUT config of a VSI.
It now sets the default LUT type and size only on VSI init, and it caps the
RSS queue count to what the LUT type can address. It also changes
ice_cfg_rdma_fltr() to take the Q_OPT section from vsi->info instead of the
cached VSI context.
> diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> index 432da05c48c08..f614b9360f7bd 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -595,6 +595,7 @@ struct ice_pf {
> struct mutex tc_mutex; /* lock to protect TC changes */
> struct mutex adev_mutex; /* lock to protect aux device access */
> struct mutex lag_mutex; /* protect ice_lag struct in PF */
> + struct mutex rss_lut_lock; /* protect VSI RSS LUT config */
[Severity: Low]
The commit message says this lock protects "q_opt_rss of the VSI context"
and is taken "around VSI context writes that include q_opt_rss". Do the VF
virtchnl paths follow that contract?
In drivers/net/ethernet/intel/ice/virt/rss.c, these callers don't take
rss_lut_lock, either at this commit or at the end of the series:
ice_vc_rss_hash_update()
read-modify-write of vsi->info.q_opt_rss, then a Q_OPT VSI update
ice_vc_config_rss_hfunc()
ice_set_rss_hfunc(vsi, hfunc)
ice_vc_config_rss_lut()
ice_set_rss_lut(vsi, vrl->lut, ICE_LUT_VSI_SIZE)
reads vsi->rss_lut_type and vsi->global_lut_id
ice_set_rxfh() now calls the same ice_set_rss_hfunc() helper under
scoped_guard(mutex, &pf->rss_lut_lock), so the ethtool and virtchnl paths
don't match.
Today vf->cfg_lock, taken in ice_vc_process_vf_msg(), serializes these VF
handlers. The later devlink VF LUT change also takes vf->cfg_lock, so I
couldn't find a concrete race.
Should the virtchnl paths take rss_lut_lock too? Or should the commit
message and the lock comment be narrowed to what the lock actually covers?
Later in the series, vsi->rss_table_size replaces the hard-coded
ICE_LUT_VSI_SIZE in ice_vc_config_rss_lut().
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index dffa213734f10..6d1e506b69cd8 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -3645,11 +3645,13 @@ ice_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> if (!rxfh->indir)
> return 0;
>
> - lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
> - if (!lut)
> - return -ENOMEM;
> + scoped_guard(mutex, &pf->rss_lut_lock) {
> + lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
> + if (!lut)
> + return -ENOMEM;
>
> - err = ice_get_rss(vsi, rxfh->key, lut, vsi->rss_table_size);
> + err = ice_get_rss(vsi, rxfh->key, lut, vsi->rss_table_size);
> + }
> if (err)
> goto out;
[Severity: Low]
This isn't a bug, but this function now uses both scoped_guard() and
goto-based cleanup. include/linux/cleanup.h says:
the expectation is that usage of "goto" and cleanup helpers is never
mixed in the same function.
Here lut is allocated inside the guard, which has an early return. It is
then freed by hand through goto out after the guard ends.
The same mix appears in:
ice_vsi_cfg_rss_lut_key() - lut freed at goto ice_vsi_cfg_rss_exit
ice_vsi_cfg_def() - scoped_guard() followed by goto unroll_get_qs
ice_set_channels() - scoped_guard() next to goto adev_unlock
ice_vsi_set_dflt_rss_lut() and ice_vsi_manage_rss_lut() also kzalloc() lut
inside the guard and kfree() it outside.
No current path leaks, because lut is NULL on the early return. The pattern
is still there at the end of the series.
Could these functions use plain mutex_lock()/mutex_unlock()? Or could lut
become __free(kfree) and the goto labels be dropped?
[ ... ]
> diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
> index d873eda9af826..70eed3bcc404b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_switch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_switch.c
[ ... ]
> @@ -1850,9 +1852,10 @@ ice_cfg_rdma_fltr(struct ice_hw *hw, u16 vsi_handle, bool enable)
> if (!ctx)
> return -ENOMEM;
>
> - ctx->info.q_opt_rss = cached_ctx->info.q_opt_rss;
> - ctx->info.q_opt_tc = cached_ctx->info.q_opt_tc;
> - ctx->info.q_opt_flags = cached_ctx->info.q_opt_flags;
> + /* not from the cached ctx, that misses later RSS changes */
> + ctx->info.q_opt_rss = info->q_opt_rss;
> + ctx->info.q_opt_tc = info->q_opt_tc;
> + ctx->info.q_opt_flags = info->q_opt_flags;
[Severity: Low]
This change fixes a user-visible bug, which the commit message admits
("which the toggle reverted"). Could it be split out as a standalone fix
for net with a Fixes: tag?
ice_set_rss_hfunc() and the NO_INIT path of ice_vsi_init() both go through
ice_update_vsi(). That function only sends the AQ command and doesn't
refresh hw->vsi_ctx[].
Before this patch, an irdma probe or remove then did:
ice_rdma_update_vsi_filter()
ice_cfg_rdma_fltr()
ctx->info.q_opt_rss = cached_ctx->info.q_opt_rss; (stale hash bits)
ice_update_vsi()
So hardware silently went back to plain Toeplitz after a symmetric-xor hash
was set with ethtool -X. Meanwhile vsi->rss_hfunc and ethtool still
reported symmetric-xor.
As submitted, the fix depends on the new pf->rss_lut_lock and the changed
ice_cfg_rdma_fltr() signature, so stable trees can't pick it up. A
standalone version could carry:
Fixes: 352e9bf23813 ("ice: enable symmetric-xor RSS for Toeplitz hash function")
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121230123.316391-1-przemyslaw.kitszel%40intel.com
Technical Details
Message-ID:
<179555744667.3135.6613548571231576927@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-370798-linux-kernel-netdev=dewy.ruReferences:
<20261121230123.316391-3-przemyslaw.kitszel@intel.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-370798-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v7 02/15] ice: prepare RSS LUT config for runtime LUT changes Date: Tue, 24 Nov 2026 21:57:26 +0000 Organization: Usenet Network Message-ID: <179555744667.3135.6613548571231576927@kernel.org> References: <20261121230123.316391-3-przemyslaw.kitszel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="47248"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Y54EcpRzChNQv2/b2QCUFLDVo9Q= sha256:v7XAejc5HCEU92+U9VdxktsbfPwpl64x6vJbR1UleZk= sha1:xQyDJEi80ULNWiokjqm+qyLSWpo= sha256:VJuIf0tcs1lF8QQ8joWtSWWmj6rxSDH2DoIivoMZ1oA= 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 E04E2125E36; Wed, 25 Nov 2026 00:57:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 rpQCFIKMu6LW; Wed, 25 Nov 2026 00:57:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370798-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2CF9F125E37; Wed, 25 Nov 2026 00:57:33 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id E624D36ECD; Tue, 24 Nov 2026 21:57:29 +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=1795557449; b=xpDPHCNeT/jOVwGfC1AuIjxpvYdsbynZQJDEQXQ9KsXj9RtRgc0tve06vrZ3gb3VHrTA 0D69EjUq35D7WchncnRmXyQo41BF+j9MDKOQ63PCzlgxM0dz76oe29cTra+kxqS/5AMtC IkbaEN9xJysGATWE9CBl7D10p2rE2v0mH5Cz/OLpKdodTEtsT4lhfAgSHvGuDv1F2bWl6 xpjtnmgxloTZJyT5cppGGKSY+4d+O0ObmmmSUBcCQIpFjLEG0m39/uk3K1Pgs6+XJjZMb 53r52QKioXTog05Iou2HG6Dp66woBb/95a4hgvhcQYevNuwJ39uq7shZG0FplZe542g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795557449; 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=0P7+ZyyVCZ1JDeUcm9y05PO0ngvsEzwcfMmqkUmPnIQ=; b=Of1yxyPORQgd7ts06D5rITvdDia0JIkwBmaDT6nCpwxIsm4gG/DStYgHA1s1Ky7USWPh BTBmoAT1fKSs4hnUEXZPdNwOSxCxwUfChCR+d/xnRm+0gC7LFeeKPAfqkkwGSFVK5r1Fj PRDobm9d1WblU+lHhLZmGE4SAmqDTo/1iconu8WQO/ruwv1EMp8CFrw/a6uZMlWcgXFvG qR7G/UpxGvxOUU7sL86Etj6NRPdZHc+6EnvDnFlhD83F1g8TK9XscNRKdP8O8lUo+3PoE mpahyTYklKJSeCrNUtYfsFD/1W2154UIAui/r+Nz8YvIDXSOUKh86RvqTI8t12TTQZA== 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=WwRkCnR5; 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 BDC13606A32C; Tue, 24 Nov 2026 21:57:29 +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=WwRkCnR5 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=1795557448; b=x59Q7mwIPyxWiIiAr5szkHg0XCoIuvr0kAZwWLBSKD9MsLnQdQDOkXDoDL8tVyQgfDK8 UQQULfe7qcCH1Xtnggf5GxlStNOQrQCAywZZoAIDU/B1yv8tLrXx7N3zdStqQymlKuEug zjXhAbuKDEZJknlkOkrqsUUU7JtKDNeu0dzj6gOpg1ZMMx8JTSRc91wsW4/oiEtu3QxUG OUosiK4cSFHyASLa1I96m1EKBKID6ID+14HVSP8l11aqF27p9XbzVX89GHKu7fh6FrXao sCUrHP1YS5L4MZ83FVJUHNzGASTWML8hIQetGKm6aeNb90mns8HOA+zHBSLQfq2yclw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795557448; 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=0P7+ZyyVCZ1JDeUcm9y05PO0ngvsEzwcfMmqkUmPnIQ=; b=sSi0JDIuNptdAg0PPWis55OnTEsHCXMC5KSKbvB8STpk/W7+mazbjeaQn+EL/SKeHt8e RMyK56ZrFgSDAxJDOnembrwhszb0ubbk/+N+w2KZU5xQWETFHXyQ6larexXJrffyS0+yo K+4i1FDzNsKsupm/WckxRwncCj/Ul3SmIbKtB7z19pmByGrIqrp/dFcESbMCXGZvJoXc8 Gl6yCbymhSCW5wAkSnqpzAkN2nFt/bCDbPALawCKk6JoWIClcSWkA0L0a/tDz8K7mHOgm za0voY2ZVBp87NkCG8Tdv46dbnQM6R5dgVsUV4mNi/mtknZYADgzcHJSY9/EAEverVg== 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=WwRkCnR5; 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 DA16B606A31E for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 21:57:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 203491F000C0; Tue, 24 Nov 2026 21:57:27 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795557448; bh=0P7+ZyyVCZ1JDeUcm9y05PO0ngvsEzwcfMmqkUmPnIQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WwRkCnR5eKQTfXqn1TatJB+cOHSUotBze826HDfN8Ifao81IjsrydIpX7hQc5eNaf dsLrDiiEsRkvKVssDrUJaOukiyHhyuLr3HrdpVn9OCqbZQoYCSH7U0NtmZT0XJkONy 1UHbcWpGTc03sGlnMceptrQGU4ww1dnXmjKtWMIPisduU2+s1wZen6mHxdfyrFHsv/ Z9ptTVC3D8hZ3uF1WFuLozyDOcpMSQl/EZHGlaVWaSjX31/gueX9GE3qyBsAQvKAOr 9IKfyL2ASrfftKIdBMqVIKM/sIMILu3JKYlOEowtYxW+/kKq4mF/ktZzvNca8W8PO0 wJQRxSrnzKvXQ== X-Cc: netdev@vger.kernel.org, kuba@kernel.org, jiri@resnulli.us, anthony.l.nguyen@intel.com, aleksandr.loktionov@intel.com, mschmidt@redhat.com, edumazet@kernel.org, horms@kernel.org, pabeni@redhat.com, davem@davemloft.net, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, andrew+netdev@lunn.ch, saeedm@nvidia.com, tariqt@nvidia.com, leon@kernel.org, mbloch@nvidia.com, jacob.e.keller@intel.com, jedrzej.jagielski@intel.com, anzaki@gmail.com, brett.creeley@amd.com, ohartoov@nvidia.com, poros@redhat.com, donald.hunter@gmail.com X-In-Reply-To: <20261121230123.316391-3-przemyslaw.kitszel@intel.com> X-sashiko-severity: Low 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