From: netdev-bot+sashiko@kernel.org
To: przemyslaw.kitszel@intel.com
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
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 [thread overview]
Message-ID: <179555744667.3135.6613548571231576927@kernel.org> (raw)
In-Reply-To: <20261121230123.316391-3-przemyslaw.kitszel@intel.com>
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
next prev parent reply other threads:[~2026-11-24 21:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 22:55 [PATCH net-next v7 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 01/15] iavf: keep RSS config across resets Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 02/15] ice: prepare RSS LUT config for runtime LUT changes Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko [this message]
2026-11-21 22:55 ` [PATCH net-next v7 03/15] ice: add VF queue ena/dis helper functions Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 04/15] ice: add helpers for Global RSS LUT alloc, free, vsi_update Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 05/15] ice: rename ICE_MAX_RSS_QS_PER_VF to ICE_MAX_QS_PER_VF_VCV1 Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 06/15] ice: bump to 256qs for VF Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 07/15] iavf: extend iavf_configure_queues() to support more queues Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 08/15] iavf: temporary rename of IAVF_MAX_REQ_QUEUES to IAVF_MAX_REQ_QUEUES_VCV1 Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 09/15] iavf: increase max number of queues to 256 Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 10/15] iavf: use new opcodes to request more than 16 queues Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 11/15] ice: introduce handling of virtchnl LARGE VF opcodes Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 12/15] devlink: add cmode to resources Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 13/15] ice: represent RSS LUTs as devlink resources Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 14/15] devlink: add devlink_alloc_drv() Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 15/15] ice: support up to 256 VF queues Przemek Kitszel
2026-11-24 21:57 ` netdev-bot+sashiko
2026-11-23 8:53 ` [PATCH net-next v7 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Matthieu Baerts
2026-11-23 15:03 ` Przemek Kitszel
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=179555744667.3135.6613548571231576927@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=anzaki@gmail.com \
--cc=brett.creeley@amd.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jedrzej.jagielski@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=mbloch@nvidia.com \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=ohartoov@nvidia.com \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rdunlap@infradead.org \
--cc=saeedm@nvidia.com \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.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