Skip to contentSkip to conversation

net/ice: fix support for 3 scheduler levels

PATCH In review Bruce Richardson 2 participants 3 messages May 6, 2025 – May 22, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix support for 3 scheduler levels

When using only 3 scheduler levels, the VSI node needs to be a node further down the scheduler hierarchy, rather than one up it as with all other possible level settings (5-9). Take account of this possibility in the code.

Fixes 4ace7701eb44 ("net/ice: provide parameter to limit scheduler layers")
---
 drivers/net/intel/ice/ice_tm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/ice/ice_tm.c +12 -0
index ff3a6cd77f..f2d8e12181 100644
@@ -818,6 +818,18 @@ commit_new_hierarchy(struct rte_eth_dev *dev)
 	uint8_t qg_lvl = q_lvl - 1;
 
 	struct ice_sched_node *new_vsi_root = hw->vsi_ctx[pf->main_vsi->idx]->sched.vsi_node[0];
+	/* handle case where VSI node needs to move DOWN the hierarchy */
+	while (new_vsi_root->tx_sched_layer < new_root_level) {
+		if (new_vsi_root->num_children == 0)
+			return -1;
+		/* remove all child nodes but the first */
+		while (new_vsi_root->num_children > 1)
+			free_sched_node_recursive(pi, new_vsi_root,
+					new_vsi_root->children[1],
+					new_vsi_root->vsi_handle);
+		new_vsi_root = new_vsi_root->children[0];
+	}
+	/* handle case where VSI node needs to move UP the hierarchy */
 	while (new_vsi_root->tx_sched_layer > new_root_level)
 		new_vsi_root = new_vsi_root->parent;
 
Signature · 1 line
2.45.2
Acked-by on v1 1/1
#1 lore raw
Quoted 27 lines

When using only 3 scheduler levels, the VSI node needs to be a node further down the scheduler hierarchy, rather than one up it as with all other possible level settings (5-9). Take account of this possibility in the code.

Fixes 4ace7701eb44 ("net/ice: provide parameter to limit scheduler layers")
---
 drivers/net/intel/ice/ice_tm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/ice/ice_tm.c +4 -0
index ff3a6cd77f..f2d8e12181 100644
@@ -818,6 +818,18 @@ commit_new_hierarchy(struct rte_eth_dev *dev)
 	uint8_t qg_lvl = q_lvl - 1;
 
 	struct ice_sched_node *new_vsi_root = hw->vsi_ctx[pf->main_vsi-
 >idx]->sched.vsi_node[0];
+	/* handle case where VSI node needs to move DOWN the hierarchy */
+	while (new_vsi_root->tx_sched_layer < new_root_level) {
+		if (new_vsi_root->num_children == 0)
+			return -1;

drivers/net/intel/ice/ice_tm.c commit_new_hierarchy(struct rte_eth_dev *dev) · line 835

Quoted 10 lines
drivers/net/intel/ice/ice_tm.c +8 -0
+		/* remove all child nodes but the first */
+		while (new_vsi_root->num_children > 1)
+			free_sched_node_recursive(pi, new_vsi_root,
+					new_vsi_root->children[1],
+					new_vsi_root->vsi_handle);
+		new_vsi_root = new_vsi_root->children[0];
+	}
+	/* handle case where VSI node needs to move UP the hierarchy */
 	while (new_vsi_root->tx_sched_layer > new_root_level)
 		new_vsi_root = new_vsi_root->parent;
Quoted 3 lines

--
2.45.2

author Applied
#2 lore raw
Quoted 23 lines · Ciara
Quoted 23 lines

When using only 3 scheduler levels, the VSI node needs to be a node further down the scheduler hierarchy, rather than one up it as with all other possible level settings (5-9). Take account of this possibility in the code.

Fixes 4ace7701eb44 ("net/ice: provide parameter to limit scheduler layers")
---
 drivers/net/intel/ice/ice_tm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/ice/ice_tm.c +0 -0
index ff3a6cd77f..f2d8e12181 100644
@@ -818,6 +818,18 @@ commit_new_hierarchy(struct rte_eth_dev *dev)
 	uint8_t qg_lvl = q_lvl - 1;
 
 	struct ice_sched_node *new_vsi_root = hw->vsi_ctx[pf->main_vsi-
 >idx]->sched.vsi_node[0];
Quoted 17 lines
Quoted 4 lines
drivers/net/intel/ice/ice_tm.c +4 -0
+	/* handle case where VSI node needs to move DOWN the hierarchy */
+	while (new_vsi_root->tx_sched_layer < new_root_level) {
+		if (new_vsi_root->num_children == 0)
+			return -1;

drivers/net/intel/ice/ice_tm.c commit_new_hierarchy(struct rte_eth_dev *dev) · line 834

Quoted 10 lines
drivers/net/intel/ice/ice_tm.c +8 -0
+		/* remove all child nodes but the first */
+		while (new_vsi_root->num_children > 1)
+			free_sched_node_recursive(pi, new_vsi_root,
+					new_vsi_root->children[1],
+					new_vsi_root->vsi_handle);
+		new_vsi_root = new_vsi_root->children[0];
+	}
+	/* handle case where VSI node needs to move UP the hierarchy */
 	while (new_vsi_root->tx_sched_layer > new_root_level)
 		new_vsi_root = new_vsi_root->parent;

Applied to dpdk-next-net-intel.

/Bruce