[PATCH] net/ice: fix tm configuration cannot be clear

Kaiwen Deng kaiwenx.deng at intel.com
Tue Aug 29 08:23:48 CEST 2023


When the device is stopped, DPDK resets the commit flag so that
we can update the hierarchy configuration. The commit flag is also
used to determine if the hierarchy configuration needs to be cleared.
When DPDK exits, it always stops the device first and also resets
the commit flag result in the hierarchy configuration is not cleared.

This patch adds a new flag "need_clear" to determine if the
hierarchy configuration needs to be cleared.

Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF")
Cc: stable at dpdk.org

Signed-off-by: Kaiwen Deng <kaiwenx.deng at intel.com>
---
 drivers/net/ice/ice_dcf.c       | 2 +-
 drivers/net/ice/ice_dcf.h       | 1 +
 drivers/net/ice/ice_dcf_sched.c | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 7f8f5163ac..45d44ab73c 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -877,7 +877,7 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 
 	if (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_QOS)
-		if (hw->tm_conf.committed) {
+		if (hw->tm_conf.need_clear) {
 			ice_dcf_clear_bw(hw);
 			ice_dcf_tm_conf_uninit(eth_dev);
 		}
diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h
index aa2a723f2a..af23b569f5 100644
--- a/drivers/net/ice/ice_dcf.h
+++ b/drivers/net/ice/ice_dcf.h
@@ -78,6 +78,7 @@ struct ice_dcf_tm_conf {
 	uint32_t nb_tc_node;
 	uint32_t nb_vsi_node;
 	bool committed;
+	bool need_clear;
 };
 
 struct ice_dcf_eth_stats {
diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c
index a231c1e60b..5437fabb58 100644
--- a/drivers/net/ice/ice_dcf_sched.c
+++ b/drivers/net/ice/ice_dcf_sched.c
@@ -51,6 +51,7 @@ ice_dcf_tm_conf_init(struct rte_eth_dev *dev)
 	hw->tm_conf.nb_tc_node = 0;
 	hw->tm_conf.nb_vsi_node = 0;
 	hw->tm_conf.committed = false;
+	hw->tm_conf.need_clear = false;
 }
 
 void
@@ -870,6 +871,8 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev,
 		   ICE_NONDMA_TO_NONDMA);
 
 	hw->tm_conf.committed = true;
+	hw->tm_conf.need_clear = true;
+
 	return ret_val;
 
 fail_clear:
-- 
2.25.1



More information about the stable mailing list