From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Michal Kubiak <michal.kubiak@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 15:07:56 +0200 [thread overview]
Message-ID: <a214afa6-e9d7-4152-9b43-146cf7ce0076@intel.com> (raw)
In-Reply-To: <20250509094233.197245-4-michal.kubiak@intel.com>
> +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
IOW, would be good to check if this line (and the semi-obvious and
half-wrong comment) could be removed.
you could keep my RB tag, thank you again for the series!
> + } 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;
> +}
next prev parent reply other threads:[~2025-05-09 13:08 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 [this message]
2025-05-09 14:45 ` Michal Kubiak
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=a214afa6-e9d7-4152-9b43-146cf7ce0076@intel.com \
--to=przemyslaw.kitszel@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=michal.kubiak@intel.com \
--cc=netdev@vger.kernel.org \
/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).