From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4622241B5D for ; Tue, 29 Aug 2023 08:44:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27B0A40279; Tue, 29 Aug 2023 08:44:19 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 3AACB4026A; Tue, 29 Aug 2023 08:44:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693291458; x=1724827458; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GvUPXJARiwMUDXIHSSawVJGq4w41Mqjwc75ov51RbHw=; b=ZTltMXG5aeTCkpCroRzIDb6C+U0U6zRaQtxL3u0nXjk+QubH7VKOIZpE 6b9AsS/2cjkn/HE2NJLpFQyi701Ju5vyhEJOJtTg9aHT7U00yD8wIe27x ZiQ1u1KjrTj5LaFyDj2REhZSbth5pY/e7k9ouNyKbwM9o9dQ4y9F0WF4G 7xZtHbmAXlDQT90qIuoe0HesUrTa/CHBnUCQ+6lfVTkBVpmT/rI8xyM3e K+DOJQiElRBouwNyH73cvG2mrq6f0xqJr94zGMCo+SYgZTwaM2yPAktT4 8fGCHxUX4HSPUjuKvss5odOL3KOiVVfXewmiLG80n9Ry2uPh/UNGZF5Ey g==; X-IronPort-AV: E=McAfee;i="6600,9927,10816"; a="375255175" X-IronPort-AV: E=Sophos;i="6.02,208,1688454000"; d="scan'208";a="375255175" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 23:44:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10816"; a="912304509" X-IronPort-AV: E=Sophos;i="6.02,208,1688454000"; d="scan'208";a="912304509" Received: from unknown (HELO localhost.localdomain) ([10.239.252.104]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 23:44:10 -0700 From: Kaiwen Deng To: dev@dpdk.org Cc: stable@dpdk.org, qiming.yang@intel.com, yidingx.zhou@intel.com, Kaiwen Deng , Qi Zhang , Ting Xu Subject: [PATCH] net/ice: fix tm configuration cannot be clear Date: Tue, 29 Aug 2023 14:23:48 +0800 Message-Id: <20230829062348.647999-1-kaiwenx.deng@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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