Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jacob Keller" <jacob.e.keller@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH iwl-next v2 2/6] ice: count number of VSIS in agg_vsi_list
Date: Fri, 09 Oct 2026 20:27:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-166033@kernel.org> (raw)
In-Reply-To: <20261009-jk-cleanup-vsi-aggregator-nodes-v2-2-313964c25c7b@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ice: num_vsis inflated and stale entry left on VSI move failure
--

commit a9d16d503219ec18b5a73776a1a7f4b0b851cd1b
Author: Jacob Keller <jacob.e.keller@intel.com>

ice: count number of VSIS in agg_vsi_list

This patch adds a member num_vsis to the ice_sched_agg_info structure to track
the number of VSIs associated with an aggregator node. The counter is
incremented when adding a VSI to the list and decremented when removing it,
avoiding the need to iterate over the agg_vsi_list.

> diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c
> index bcfc9db69e17e..08d0f685f6c45 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sched.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sched.c

[ ... ]

> @@ -2915,24 +2920,26 @@ ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id,
>  		/* add VSI ID into the aggregator list */
>  		agg_vsi_info->vsi_handle = vsi_handle;
>  		list_add(&agg_vsi_info->list_entry, &agg_info->agg_vsi_list);
> +		agg_info->num_vsis++;
>  	}
>  	/* Move VSI node to new aggregator node for requested TC(s) */
>  	ice_for_each_traffic_class(tc) {
>  		if (!ice_is_tc_ena(*tc_bitmap, tc))
>  			continue;
>  
>  		/* Move VSI to new aggregator */
>  		status = ice_sched_move_vsi_to_agg(pi, vsi_handle, agg_id, tc);
>  		if (status)
>  			break;

[Severity: Medium]
If ice_sched_move_vsi_to_agg() fails and returns an error here, the loop will
break. Should the function roll back the agg_info->num_vsis increment and remove
the newly added agg_vsi_info from agg_info->agg_vsi_list before returning?

Without a rollback, a stale VSI entry with an empty tc_bitmap remains in the
aggregator list, permanently inflating the num_vsis counter. If subsequent code
relies on num_vsis to enforce limits like ICE_MAX_VSIS_IN_AGG_NODE, this could
cause the aggregator to prematurely reject new VSIs.

>  
>  		set_bit(tc, agg_vsi_info->tc_bitmap);
>  		if (old_agg_vsi_info)
>  			clear_bit(tc, old_agg_vsi_info->tc_bitmap);
>  	}
>  	if (old_agg_vsi_info && !old_agg_vsi_info->tc_bitmap[0]) {
>  		list_del(&old_agg_vsi_info->list_entry);
>  		devm_kfree(ice_hw_to_dev(pi->hw), old_agg_vsi_info);
> +		old_agg_info->num_vsis--;
>  	}
>  	return status;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261009-jk-cleanup-vsi-aggregator-nodes-v2-0-313964c25c7b@intel.com?part=2

  reply	other threads:[~2026-10-09 20:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 20:11 [PATCH iwl-next v2 0/6] ice: refactor aggregator node logic Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 1/6] ice: convert hw->agg_list from linked list to xarray Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 2/6] ice: count number of VSIS in agg_vsi_list Jacob Keller
2026-10-09 20:27   ` sashiko-bot [this message]
2026-10-09 23:11     ` Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 3/6] ice: extract aggregator allocation out of ice_sched_cfg_agg Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 4/6] ice: pass agg_info instead of performing lookup Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 5/6] ice: remove ice_agg_node wrapper structure Jacob Keller
2026-10-09 20:26   ` sashiko-bot
2026-10-09 23:08     ` Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 6/6] ice: remove unused aggregator node functions Jacob Keller

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=sashiko-outbox-166033@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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