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 6FBF6A0C4B; Thu, 21 Oct 2021 08:03:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED7734117A; Thu, 21 Oct 2021 08:03:01 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 78FE840142; Thu, 21 Oct 2021 08:03:00 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10143"; a="215872465" X-IronPort-AV: E=Sophos;i="5.87,168,1631602800"; d="scan'208";a="215872465" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 23:02:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,168,1631602800"; d="scan'208";a="494973554" Received: from dpdk-xuting-third.sh.intel.com ([10.67.111.93]) by orsmga008.jf.intel.com with ESMTP; 20 Oct 2021 23:02:48 -0700 From: Ting Xu To: dev@dpdk.org Cc: qi.z.zhang@intel.com, qiming.yang@intel.com, Ting Xu , stable@dpdk.org Date: Thu, 21 Oct 2021 05:54:07 +0000 Message-Id: <20211021055407.129489-1-ting.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211014065152.102685-1-ting.xu@intel.com> References: <20211014065152.102685-1-ting.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/ice: fix TM hierarchy commit flag not reset correctly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" After DCF commits TM hierarchy configuration, the commit flag is set to avoid duplicated commit. But the flag is not reset after device stop, which prevents the update of hierarchy configuration unless close the device. It is not reasonable. This patch fix to reset the commit flag after device stop. Then users can delete and add nodes to commit a new TM hierarchy configuration. Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF") Cc: stable@dpdk.org Signed-off-by: Ting Xu --- drivers/net/ice/ice_dcf_ethdev.c | 7 +++++++ drivers/net/ice/ice_dcf_sched.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index b8a537cb85..12bdd745df 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -528,6 +528,11 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) return -EIO; } + if (hw->tm_conf.root && !hw->tm_conf.committed) { + PMD_DRV_LOG(ERR, "please call hierarchy_commit() before starting the port"); + return -EIO; + } + ad->pf.adapter_stopped = 0; hw->num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues, @@ -619,6 +624,7 @@ ice_dcf_dev_stop(struct rte_eth_dev *dev) struct ice_dcf_adapter *dcf_ad = dev->data->dev_private; struct rte_intr_handle *intr_handle = dev->intr_handle; struct ice_adapter *ad = &dcf_ad->parent; + struct ice_dcf_hw *hw = &dcf_ad->real_hw; if (ad->pf.adapter_stopped == 1) { PMD_DRV_LOG(DEBUG, "Port is already stopped"); @@ -639,6 +645,7 @@ ice_dcf_dev_stop(struct rte_eth_dev *dev) ice_dcf_add_del_all_mac_addr(&dcf_ad->real_hw, false); dev->data->dev_link.link_status = ETH_LINK_DOWN; ad->pf.adapter_stopped = 1; + hw->tm_conf.committed = false; return 0; } diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c index dcf2723494..a231c1e60b 100644 --- a/drivers/net/ice/ice_dcf_sched.c +++ b/drivers/net/ice/ice_dcf_sched.c @@ -754,6 +754,13 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev, uint8_t num_elem = 0; int i, ret_val; + /* check if port is stopped */ + if (!adapter->parent.pf.adapter_stopped) { + PMD_DRV_LOG(ERR, "Please stop port first"); + ret_val = ICE_ERR_NOT_READY; + goto err; + } + ret_val = ice_dcf_commit_check(hw); if (ret_val) goto fail_clear; @@ -871,5 +878,6 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev, ice_dcf_tm_conf_uninit(dev); ice_dcf_tm_conf_init(dev); } +err: return ret_val; } -- 2.25.1