Skip to content

Commit ef9dc56

Browse files
Mukul Katiyarbruce-richardson
authored andcommitted
net/ice: properly handle TM hierarchy deletion
When a TM hierarchy is fully deleted and then committed, the hardware scheduler nodes may be left with any bandwidth limits that were programmed by the previous hierarchy commit. These stale limits may remain in effect the next time the device starts, permanently throttling traffic even though the TM hierarchy was removed. Fix this by resetting all descendant hardware scheduler nodes to their default state when committing an empty hierarchy. Also restore the port queue count to its hardware default and clear the committed flag so the port starts cleanly without any TM configuration applied. Fixes: 715d449 ("net/ice: enhance Tx scheduler hierarchy support") Cc: stable@dpdk.org Signed-off-by: Mukul Katiyar <mukul@versa-networks.com> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
1 parent a3c1981 commit ef9dc56

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ Moti Haimovsky <motih@mellanox.com>
11321132
Muhammad Ahmad <muhammad.ahmad@emumba.com>
11331133
Muhammad Bilal <m.bilal@emumba.com>
11341134
Mukesh Dua <mukesh.dua81@gmail.com>
1135+
Mukul Katiyar <mukul@versa-networks.com>
11351136
Murphy Yang <murphyx.yang@intel.com>
11361137
Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>
11371138
Muthurajan Jayakumar <muthurajan.jayakumar@intel.com>

drivers/net/intel/ice/ice_tm.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,19 @@ create_sched_node_recursive(struct ice_pf *pf, struct ice_port_info *pi,
805805
return 0;
806806
}
807807

808+
static void
809+
reset_hw_node_recursive(struct ice_hw *hw, struct ice_sched_node *node)
810+
{
811+
uint16_t i;
812+
813+
for (i = 0; i < node->num_children; i++) {
814+
reset_hw_node_recursive(hw, node->children[i]);
815+
if (ice_cfg_hw_node(hw, NULL, node->children[i]))
816+
PMD_DRV_LOG(WARNING, "Failed to reset node %u to default configuration",
817+
node->children[i]->info.node_teid);
818+
}
819+
}
820+
808821
static int
809822
commit_new_hierarchy(struct rte_eth_dev *dev)
810823
{
@@ -820,8 +833,15 @@ commit_new_hierarchy(struct rte_eth_dev *dev)
820833
struct ice_sched_node *new_vsi_root = hw->vsi_ctx[pf->main_vsi->idx]->sched.vsi_node[0];
821834

822835
if (sw_root == NULL) {
823-
PMD_DRV_LOG(ERR, "No root node defined in TM hierarchy");
824-
return -1;
836+
if (!pf->tm_conf.committed) {
837+
PMD_DRV_LOG(ERR, "No root node defined in TM hierarchy");
838+
return -EINVAL;
839+
}
840+
/* TM hierarchy deleted. Restore default scheduler state. */
841+
reset_hw_node_recursive(hw, hw->vsi_ctx[pf->main_vsi->idx]->sched.vsi_node[0]);
842+
pf->main_vsi->nb_qps = pf->lan_nb_qps;
843+
pf->tm_conf.committed = false;
844+
return ice_alloc_lan_q_ctx(hw, 0, 0, pf->main_vsi->nb_qps);
825845
}
826846

827847
/* handle case where VSI node needs to move DOWN the hierarchy */

0 commit comments

Comments
 (0)