patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix tm configuration cannot be clear
@ 2023-08-29  6:23 Kaiwen Deng
  2023-09-01  5:38 ` Zhang, Qi Z
  2023-09-05  7:34 ` [PATCH v2] net/ice: fix tm configuration cannot be cleared Kaiwen Deng
  0 siblings, 2 replies; 8+ messages in thread
From: Kaiwen Deng @ 2023-08-29  6:23 UTC (permalink / raw)
  To: dev; +Cc: stable, qiming.yang, yidingx.zhou, Kaiwen Deng, Qi Zhang, Ting Xu

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@dpdk.org

Signed-off-by: Kaiwen Deng <kaiwenx.deng@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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-07  7:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29  6:23 [PATCH] net/ice: fix tm configuration cannot be clear Kaiwen Deng
2023-09-01  5:38 ` Zhang, Qi Z
2023-09-05  8:14   ` Deng, KaiwenX
2023-09-05  7:34 ` [PATCH v2] net/ice: fix tm configuration cannot be cleared Kaiwen Deng
2023-09-06  5:02   ` Zhang, Qi Z
2023-09-06  7:49   ` [PATCH v3] " Kaiwen Deng
2023-09-07  2:34     ` Wu, Wenjun1
2023-09-07  7:51       ` Zhang, Qi Z

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).