netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kubiak <michal.kubiak@intel.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: <maciej.fijalkowski@intel.com>, <aleksander.lobakin@intel.com>,
	<dawid.osuchowski@linux.intel.com>, <jacob.e.keller@intel.com>,
	<jbrandeburg@cloudflare.com>, <netdev@vger.kernel.org>,
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [PATCH iwl-net v2 3/3] ice: fix rebuilding the Tx scheduler tree for large queue counts
Date: Fri, 9 May 2025 16:45:01 +0200	[thread overview]
Message-ID: <aB4U7TBtr75ouKzi@localhost.localdomain> (raw)
In-Reply-To: <a214afa6-e9d7-4152-9b43-146cf7ce0076@intel.com>

On Fri, May 09, 2025 at 03:07:56PM +0200, Przemek Kitszel wrote:
> 
> > +ice_sched_rm_vsi_subtree(struct ice_port_info *pi,
> > +			 struct ice_sched_node *vsi_node, u8 owner, u8 tc)
> > +{
> > +	u16 vsi_handle = vsi_node->vsi_handle;
> > +	bool all_vsi_nodes_removed = true;
> > +	int j = 0;
> > +
> > +	while (vsi_node) {
> > +		struct ice_sched_node *next_vsi_node;
> > +
> > +		if (ice_sched_is_leaf_node_present(vsi_node)) {
> > +			ice_debug(pi->hw, ICE_DBG_SCHED, "VSI has leaf nodes in TC %d\n", tc);
> > +			return -EBUSY;
> > +		}
> > +		while (j < vsi_node->num_children) {
> > +			if (vsi_node->children[j]->owner == owner) {
> > +				ice_free_sched_node(pi, vsi_node->children[j]);
> > +
> > +				/* reset the counter again since the num
> > +				 * children will be updated after node removal
> > +				 */
> > +				j = 0;
> 
> I know this code is a copy-pasta, but it looks that there is no need to
> reset the counter (whole array isn't reshuffled), just don't increase it
> 
You are right. After analyzing the `ice_free_sched_node()` function, it seems
we should just keep the value of `j`. After removing the child node, other
children nodes will be shifted towards the beginning of the array.

> IOW, would be good to check if this line (and the semi-obvious and
> half-wrong comment) could be removed.

I would prefer to change the code, since I'm touching it.

> 
> you could keep my RB tag, thank you again for the series!
>

Let's wait until early next week to gather more potential comments.
Then I will address it in v3.

This minor fix will not be directly related to the core of the series,
so the v2 can still be used to test the workings of XDP on multi-core machines.

Thanks,
Michal

> > +			} else {
> > +				j++;
> > +			}
> > +		}
> > +
> > +		next_vsi_node = ice_sched_find_next_vsi_node(vsi_node);
> > +
> > +		/* remove the VSI if it has no children */
> > +		if (!vsi_node->num_children)
> > +			ice_free_sched_node(pi, vsi_node);
> > +		else
> > +			all_vsi_nodes_removed = false;
> > +
> > +		vsi_node = next_vsi_node;
> > +	}
> > +
> > +	/* clean up aggregator related VSI info if any */
> > +	if (all_vsi_nodes_removed)
> > +		ice_sched_rm_agg_vsi_info(pi, vsi_handle);
> > +
> > +	return 0;
> > +}

      reply	other threads:[~2025-05-09 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  9:42 [PATCH iwl-net v2 0/3] Fix XDP loading on machines with many CPUs Michal Kubiak
2025-05-09  9:42 ` [PATCH iwl-net v2 1/3] ice: fix Tx scheduler error handling in XDP callback Michal Kubiak
2025-05-09  9:42 ` [PATCH iwl-net v2 2/3] ice: create new Tx scheduler nodes for new queues only Michal Kubiak
2025-05-09  9:42 ` [PATCH iwl-net v2 3/3] ice: fix rebuilding the Tx scheduler tree for large queue counts Michal Kubiak
2025-05-09 13:07   ` Przemek Kitszel
2025-05-09 14:45     ` Michal Kubiak [this message]

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=aB4U7TBtr75ouKzi@localhost.localdomain \
    --to=michal.kubiak@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=dawid.osuchowski@linux.intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jbrandeburg@cloudflare.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.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;
as well as URLs for NNTP newsgroup(s).