patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kaiwen Deng <kaiwenx.deng@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, qiming.yang@intel.com, yidingx.zhou@intel.com,
	Kaiwen Deng <kaiwenx.deng@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>, Ting Xu <ting.xu@intel.com>
Subject: [PATCH] net/ice: fix tm configuration cannot be clear
Date: Tue, 29 Aug 2023 14:23:48 +0800	[thread overview]
Message-ID: <20230829062348.647999-1-kaiwenx.deng@intel.com> (raw)

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


             reply	other threads:[~2023-08-29  6:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29  6:23 Kaiwen Deng [this message]
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

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=20230829062348.647999-1-kaiwenx.deng@intel.com \
    --to=kaiwenx.deng@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=ting.xu@intel.com \
    --cc=yidingx.zhou@intel.com \
    /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).