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 13/15] ice: represent RSS LUTs as devlink resources
Date: Tue, 24 Nov 2026 21:57:43 +0000 [thread overview]
Message-ID: <179555746365.3135.16915597788151062216@kernel.org> (raw)
In-Reply-To: <20261121230123.316391-14-przemyslaw.kitszel@intel.com>
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 4
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).
- [High] Possible ABBA deadlock between the per-PF devlink instance lock
and rtnl.
- [Low] The per-PF runtime devlink resource "rss_lut" is registered once
at probe (ice_devl_pf_resources_register() in ice_probe()) and…
- [Low] In ice_setup_tc_mqprio_qdisc()
(drivers/net/ethernet/intel/ice/ice_main.c), the new rejection "RSS…
- [Low] Cleanup guideline violation (mixing goto and guards).
- [Low] The commit body does not mention a change to existing ADQ error
handling.
--
ice: represent RSS LUTs as devlink resources
This patch exposes the E800 RSS LUTs as devlink resources. Each PF gets a
runtime rss_lut resource to switch between its 2048-entry PF LUT and a
512-entry global LUT, and the whole-device instance reports read-only
rss_lut_512 and rss_lut_2048 counters. The user indirection table is kept
across LUT changes and resets, and ADQ and LUT reassignment are made
mutually exclusive.
> diff --git a/drivers/net/ethernet/intel/ice/devlink/resource.c b/drivers/net/ethernet/intel/ice/devlink/resource.c
> new file mode 100644
> index 0000000000000..c07f61acdaedc
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/devlink/resource.c
> @@ -0,0 +1,643 @@
[ ... ]
> +/* ethtool core sizes RSS buffers by rss_table_size under rtnl, and the new
> + * LUT is filled based on NETIF_F_RXHASH, which is also changed under rtnl
> + */
> +static int ice_rss_lut_pf_size_set(u64 size, struct netlink_ext_ack *extack,
> + void *priv)
> +{
> + struct ice_pf *pf = priv;
> + int err;
> +
> + rtnl_lock();
> + scoped_guard(ice_adapter_devl, pf->adapter)
> + err = ice_rss_lut_set(pf, pf, size, extack);
> + rtnl_unlock();
[Severity: High]
Can this deadlock against rtnl?
The devlink core calls the runtime size_set callback with the PF devlink
instance lock held. The devl_resource_runtime_register() kernel-doc says
"Both callbacks are called with the instance lock held". So the order
here is PF devl -> rtnl.
ice_tear_down_devlink_rate_tree() takes the same PF devlink lock:
drivers/net/ethernet/intel/ice/devlink/devlink.c:ice_tear_down_devlink_rate_tree() {
devlink = priv_to_devlink(pf);
devl_lock(devlink);
mutex_lock(&pf->vfs.table_lock);
...
}
Its callers already hold rtnl, so the order there is rtnl -> PF devl:
- ice_setup_tc_mqprio_qdisc(), via ndo_setup_tc from tc_modify_qdisc
- ice_pf_dcb_cfg(), via dcbnl, and via the LLDP MIB change path after
rtnl_lock()
For example:
CPU0: devlink resource set pci/X path rss_lut size 512
devlink core holds PF devl
ice_rss_lut_pf_size_set()
rtnl_lock() <- waits for CPU1
CPU1: tc qdisc add dev ethX root mqprio ... hw 1 mode channel
rtnl held
ice_setup_tc_mqprio_qdisc()
ice_tear_down_devlink_rate_tree() (before the new ADQ check)
devl_lock(PF) <- waits for CPU0
The rtnl -> devl order in ice_tear_down_devlink_rate_tree() is older.
ice_devlink_reinit_down() and ice_devlink_reinit_up() already take rtnl
under devl during reload. This patch adds a devl -> rtnl edge that any
runtime devlink resource set can reach.
Could rtnl be avoided here, or could the lock order in
ice_tear_down_devlink_rate_tree() be fixed?
> +
> + return err;
> +}
[ ... ]
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> index 57425683c0d4f..a65dd342246cd 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
[ ... ]
> @@ -2471,8 +2501,15 @@ static int ice_vsi_cfg_def(struct ice_vsi *vsi)
> vsi->vsw = pf->first_sw;
>
> if (vsi->flags & ICE_VSI_FLAG_INIT) {
> - scoped_guard(mutex, &pf->rss_lut_lock)
> + scoped_guard(mutex, &pf->rss_lut_lock) {
> + u16 lut_size = vsi->rss_table_size;
> +
> ice_vsi_set_dflt_rss_lut_type(vsi);
> + if (vsi->rss_table_size != lut_size) {
> + devm_kfree(dev, vsi->rss_lut_user);
> + vsi->rss_lut_user = NULL;
> + }
> + }
> }
[ ... ]
> @@ -2615,6 +2660,9 @@ static int ice_vsi_cfg_def(struct ice_vsi *vsi)
> ice_vsi_free_q_vectors(vsi);
> unroll_vsi_init:
> ice_vsi_delete_from_hw(vsi);
> +unroll_pf_rss_lut:
> + if ((vsi->flags & ICE_VSI_FLAG_INIT) && vsi->type == ICE_VSI_PF)
> + ice_release_rss_lut_pf(pf);
> unroll_get_qs:
> ice_vsi_put_qs(vsi);
> unroll_vsi_alloc_stat:
[Severity: Low]
This isn't a bug, but this adds a new goto unwind label to
ice_vsi_cfg_def(). That function also uses
scoped_guard(mutex, &pf->rss_lut_lock), and this patch makes that guarded
block larger.
ice_setup_tc_mqprio_qdisc() has the same mix. It gains
scoped_guard(ice_adapter_devl, pf->adapter) below, and it already uses
goto config_tcf and goto exit.
include/linux/cleanup.h says goto-based cleanup and guard helpers should
not be mixed in one function. Could each of these functions use only one
of the two styles?
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 3e8cf1c5f0e81..5f0de7cf0a8e5 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
[ ... ]
> @@ -3873,6 +3876,8 @@ void ice_deinit_pf(struct ice_pf *pf)
> {
> /* note that we unroll also on ice_init_pf() failure here */
>
> + /* ice_vsi_decfg() skips it if the last VSI rebuild was NO_INIT */
> + ice_free_rss_lut_flr(pf);
> mutex_destroy(&pf->rss_lut_lock);
[Severity: Low]
Can the rss_lut size_set callback still run after this?
ice_probe() registers the per-PF rss_lut resource once, through
ice_devl_pf_resources_register(). ice_deinit_devlink() unregisters it,
but only on remove.
Devlink reload goes through ice_devlink_reinit_down() -> ice_deinit_pf().
That destroys pf->rss_lut_lock and drops the PF LUT ownership here. If
ice_devlink_reinit_up() then fails, its error path ends in
ice_deinit_pf() again:
err_load:
rtnl_lock();
ice_vsi_decfg(vsi);
rtnl_unlock();
unroll_pf_init:
ice_deinit_pf(pf);
The resource stays registered with priv == pf. Take a later
"devlink resource set ... path rss_lut size 2048":
ice_rss_lut_pf_size_set()
ice_rss_lut_set()
ice_change_rss_lut()
ICE_FLAG_RSS_ENA is still set. ice_rss_lut_type() returns ICE_LUT_VSI
because the owner slot was cleared, so the request counts as a change.
ice_change_rss_lut() then calls mutex_lock(&pf->rss_lut_lock) on the
destroyed mutex, and ice_aq_set_rss_lut() sends a command to a control
queue that has been shut down. With size 512, ice_alloc_rss_global_lut()
sends an AQ command to the dead queue in the same way.
Should the rss_lut resource follow the reload down/up lifetime, or should
the callbacks check that the PF is loaded?
[ ... ]
> @@ -9194,8 +9211,14 @@ static int ice_setup_tc_mqprio_qdisc(struct net_device *netdev, void *type_data)
> ret);
> return ret;
> }
> + scoped_guard(ice_adapter_devl, pf->adapter) {
> + if (ice_rss_lut_is_reassigned(pf)) {
> + dev_err(dev, "RSS LUTs reassigned via devlink, can't configure ADQ\n");
> + return -EOPNOTSUPP;
> + }
[Severity: Low]
Is this rejection meant to run after the devlink-rate tree has already
been torn down? Earlier in the same case:
if (pf->hw.port_info->is_custom_tx_enabled) {
dev_err(dev, "Custom Tx scheduler feature enabled, can't configure ADQ\n");
return -EBUSY;
}
ice_tear_down_devlink_rate_tree(pf);
ret = ice_validate_mqprio_qopt(vsi, mqprio_qopt);
Suppose the PF was moved to a global LUT with devlink resource set, and
"tc qdisc add ... mqprio hw 1 mode channel" is tried next. The request
fails with -EOPNOTSUPP. By then devl_rate_leaf_destroy() and
devl_rate_nodes_destroy() have already removed the VF rate leaves and
rate nodes. ice_devlink_rate_init_tx_topology() only exports them again
when the representors are recreated.
What gets lost is the default exported topology. Any rate change sets
is_custom_tx_enabled, and that case returns -EBUSY before the teardown.
A failed ice_validate_mqprio_qopt() already has the same side effect, but
this adds a new rejection reason after the teardown.
The new check depends only on the RSS LUT state. Could it go next to the
is_custom_tx_enabled check, before ice_tear_down_devlink_rate_tree()?
> + set_bit(ICE_FLAG_TC_MQPRIO, pf->flags);
> + }
> memcpy(&vsi->mqprio_qopt, mqprio_qopt, sizeof(*mqprio_qopt));
> - set_bit(ICE_FLAG_TC_MQPRIO, pf->flags);
[ ... ]
> @@ -9263,6 +9286,7 @@ static int ice_setup_tc_mqprio_qdisc(struct net_device *netdev, void *type_data)
> clear_bit(ICE_RESET_FAILED, pf->state);
> if (ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT)) {
> dev_err(dev, "Rebuild of main VSI failed again\n");
> + clear_bit(ICE_FLAG_TC_MQPRIO, pf->flags);
> return ret;
> }
> }
[ ... ]
> @@ -9315,6 +9339,7 @@ static int ice_setup_tc_mqprio_qdisc(struct net_device *netdev, void *type_data)
> if (ret) {
> vsi->all_numtc = 0;
> vsi->all_enatc = 0;
> + clear_bit(ICE_FLAG_TC_MQPRIO, pf->flags);
> }
[Severity: Low]
This isn't a bug, but these two clear_bit(ICE_FLAG_TC_MQPRIO, ...) calls
change the existing ADQ error handling.
Before this patch, a failed channel-mode setup left ICE_FLAG_TC_MQPRIO
set. That covers the second VSI rebuild failure, and ice_vsi_cfg_tc(),
ice_set_bw_limit() or ice_create_q_channels() failing.
ice_prepare_for_reset() and other code check that flag.
The commit message only says:
RSS LUTs can't be changed while ADQ is configured, or with RSS disabled,
e.g. in safe mode. ADQ can't be configured while the RSS LUTs of the PF
are reassigned.
The reason only appears in the v7 changelog below the --- line ("clear
ICE_FLAG_TC_MQPRIO when the ADQ setup fails, it blocked RSS LUT changes
until mqprio was reconfigured"), which won't be kept in git history.
Could the commit message describe this change?
> /* resume VSI */
> ice_ena_vsi(vsi, true);
--
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
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 [this message]
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=179555746365.3135.16915597788151062216@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