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 60899A0C43; Tue, 19 Oct 2021 13:28:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E57741179; Tue, 19 Oct 2021 13:27:51 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D35754116C; Tue, 19 Oct 2021 13:27:47 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="208585268" X-IronPort-AV: E=Sophos;i="5.85,384,1624345200"; d="scan'208";a="208585268" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 04:27:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,384,1624345200"; d="scan'208";a="661772619" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga005.jf.intel.com with ESMTP; 19 Oct 2021 04:27:40 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 04:27:39 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 19:27:37 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2242.012; Tue, 19 Oct 2021 19:27:37 +0800 From: "Zhang, Qi Z" To: "Xu, Ting" , "dev@dpdk.org" CC: "Yang, Qiming" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ice: fix TM hierarchy commit flag not reset correctly Thread-Index: AQHXwMkSY/R8tYWUWEyuRWfT6UiHhKvaNf8g Date: Tue, 19 Oct 2021 11:27:37 +0000 Message-ID: <84dbb17625844ad88822bd2b783cb1db@intel.com> References: <20211014065152.102685-1-ting.xu@intel.com> In-Reply-To: <20211014065152.102685-1-ting.xu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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" > -----Original Message----- > From: Xu, Ting > Sent: Thursday, October 14, 2021 2:52 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Yang, Qiming > ; Xu, Ting ; stable@dpdk.org > Subject: [PATCH] net/ice: fix TM hierarchy commit flag not reset correctl= y >=20 > After DCF commits TM hierarchy configuration, the commit flag is set to a= void > duplicated commit. But the flag is not reset after device stop, which pre= vents > the update of hierarchy configuration unless close the device. It is not > reasonable. This patch fix to reset the commit flag after device stop. Th= en users > can delete and add nodes to commit a new TM hierarchy configuration. >=20 > Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF") > Cc: stable@dpdk.org >=20 > 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(+) >=20 > diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_e= thdev.c > index 3eb3b077e6..23e2d91c13 100644 > --- a/drivers/net/ice/ice_dcf_ethdev.c > +++ b/drivers/net/ice/ice_dcf_ethdev.c > @@ -529,6 +529,11 @@ ice_dcf_dev_start(struct rte_eth_dev *dev) > return -EIO; > } >=20 > + 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 =3D 0; >=20 > hw->num_queue_pairs =3D RTE_MAX(dev->data->nb_rx_queues, @@ -620,6 > +625,7 @@ ice_dcf_dev_stop(struct rte_eth_dev *dev) > struct ice_dcf_adapter *dcf_ad =3D dev->data->dev_private; > struct rte_intr_handle *intr_handle =3D dev->intr_handle; > struct ice_adapter *ad =3D &dcf_ad->parent; > + struct ice_dcf_hw *hw =3D &dcf_ad->real_hw; >=20 > if (ad->pf.adapter_stopped =3D=3D 1) { > PMD_DRV_LOG(DEBUG, "Port is already stopped"); @@ -640,6 > +646,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 =3D ETH_LINK_DOWN; > ad->pf.adapter_stopped =3D 1; > + hw->tm_conf.committed =3D false; >=20 > return 0; > } > diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sc= hed.c > index dcf2723494..65c4c82a5b 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 =3D 0; > int i, ret_val; >=20 > + /* check if port is stopped */ > + if (adapter->parent.pf.adapter_stopped !=3D 1) { adapter_stopped is defined as a boolean > + PMD_DRV_LOG(ERR, "Please stop port first"); > + ret_val =3D ICE_ERR_NOT_READY; > + goto err; > + } > + > ret_val =3D 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