From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 84CCBA04FA; Tue, 9 Jun 2020 09:35:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B390C2142; Tue, 9 Jun 2020 09:35:09 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 67ACE1F1C for ; Tue, 9 Jun 2020 09:35:08 +0200 (CEST) IronPort-SDR: 5pCWAiLrvm6LdwMbN4NjBpnDevnieZjoY98E7l5pZJbXRxtHrhu/NrX6PdiZvuX+ZvH2lL7vmn iTeXQFoPk3XQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 00:35:07 -0700 IronPort-SDR: uicLvmHmnhqbOdXBPEXHEpkanzLHaM0ccqkTm1Il4/7254hyIx5aWVr9874WH/esoVTVJR5cD7 35wkzrEIhp4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,490,1583222400"; d="scan'208";a="270807207" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 09 Jun 2020 00:35:06 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jun 2020 00:35:02 -0700 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 9 Jun 2020 15:35:00 +0800 Received: from shsmsx605.ccr.corp.intel.com ([10.109.6.215]) by SHSMSX605.ccr.corp.intel.com ([10.109.6.215]) with mapi id 15.01.1713.004; Tue, 9 Jun 2020 15:35:00 +0800 From: "Xu, Ting" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Mcnamara, John" , "Kovacevic, Marko" , "Ye, Xiaolong" Thread-Topic: [PATCH v1 09/12] net/ice: add queue start and stop for DCF Thread-Index: AQHWPWduzg5xs1U0OkSrNUOnJR/zfqjP445A Date: Tue, 9 Jun 2020 07:35:00 +0000 Message-ID: <0ee801adc7374b2e940d65bd98ca5cca@intel.com> References: <20200605201737.33766-1-ting.xu@intel.com> <20200605201737.33766-10-ting.xu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action 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 v1 09/12] net/ice: add queue start and stop for DCF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hi, Qiming, > -----Original Message----- > From: Yang, Qiming > Sent: Monday, June 8, 2020 3:36 PM > To: Xu, Ting ; dev@dpdk.org > Cc: Zhang, Qi Z ; Mcnamara, John > ; Kovacevic, Marko > Subject: RE: [PATCH v1 09/12] net/ice: add queue start and stop for DCF >=20 >=20 >=20 > > -----Original Message----- > > From: Xu, Ting > > Sent: Saturday, June 6, 2020 04:18 > > To: dev@dpdk.org > > Cc: Zhang, Qi Z ; Yang, Qiming > > ; Mcnamara, John ; > > Kovacevic, Marko > > Subject: [PATCH v1 09/12] net/ice: add queue start and stop for DCF > > > > From: Qi Zhang > > > > Add queue start and stop in DCF. Support queue enable and disable > > through virtual channel. Add support for Rx queue mbufs allocation and > queue reset. > > > > Signed-off-by: Qi Zhang > > --- > > drivers/net/ice/ice_dcf.c | 57 ++++++ > > drivers/net/ice/ice_dcf.h | 3 +- > > drivers/net/ice/ice_dcf_ethdev.c | 309 > > +++++++++++++++++++++++++++++++ > > 3 files changed, 368 insertions(+), 1 deletion(-) > > >=20 > Snip... >=20 > > +} > > diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h > > index > > 9470d1df7..68e1661c0 100644 > > --- a/drivers/net/ice/ice_dcf.h > > +++ b/drivers/net/ice/ice_dcf.h > > @@ -70,5 +70,6 @@ void ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, > > struct ice_dcf_hw *hw); int ice_dcf_init_rss(struct ice_dcf_hw *hw); > > int ice_dcf_configure_queues(struct ice_dcf_hw *hw); int > > ice_dcf_config_irq_map(struct ice_dcf_hw *hw); > > - > > +int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool > > +rx, bool on); int ice_dcf_disable_queues(struct ice_dcf_hw *hw); > > #endif /* _ICE_DCF_H_ */ > > diff --git a/drivers/net/ice/ice_dcf_ethdev.c > > b/drivers/net/ice/ice_dcf_ethdev.c > > index 9605fb8ed..59113fc4b 100644 > > --- a/drivers/net/ice/ice_dcf_ethdev.c > > +++ b/drivers/net/ice/ice_dcf_ethdev.c > > @@ -226,6 +226,259 @@ static int ice_dcf_config_rx_queues_irqs(struct > > rte_eth_dev *dev, > > return 0; > > } > > > . > > +static int > > +ice_dcf_start_queues(struct rte_eth_dev *dev) { struct ice_rx_queue > > +*rxq; struct ice_tx_queue *txq; int i; > > + > > +for (i =3D 0; i < dev->data->nb_tx_queues; i++) { txq =3D > > +dev->data->tx_queues[i]; if (txq->tx_deferred_start) continue; if > > +(ice_dcf_tx_queue_start(dev, i) !=3D 0) { PMD_DRV_LOG(ERR, "Fail to > > +start queue %u", i); return -1; >=20 > If queue start fail, should stop the queue already started >=20 This operation can only be seen in ice and i40e PF driver. In iavf or even = earlier i40evf, they did not stop the already started queues when failed. I am not sure if this operation is suitable for DCF? Or we should not follo= w the current iavf, since it actually needs this modification to stop start= ed queues as well? > > +} > > +} > > + > > +for (i =3D 0; i < dev->data->nb_rx_queues; i++) { rxq =3D > > +dev->data->rx_queues[i]; if (rxq->rx_deferred_start) continue; if > > +(ice_dcf_rx_queue_start(dev, i) !=3D 0) { PMD_DRV_LOG(ERR, "Fail to > > +start queue %u", i); return -1; } } > > + > > +return 0; > > +} > > + > > static int > > ice_dcf_dev_start(struct rte_eth_dev *dev) { @@ -266,20 +519,72 @@ > > ice_dcf_dev_start(struct rte_eth_dev *dev) return ret; } > > > > +if (dev->data->dev_conf.intr_conf.rxq !=3D 0) { > > +rte_intr_disable(intr_handle); rte_intr_enable(intr_handle); } > > + > > +ret =3D ice_dcf_start_queues(dev); > > +if (ret) { > > +PMD_DRV_LOG(ERR, "Failed to enable queues"); return ret; } > > + > > dev->data->dev_link.link_status =3D ETH_LINK_UP; > > > > return 0; > > } > > > > +static void > > +ice_dcf_stop_queues(struct rte_eth_dev *dev) { struct ice_dcf_adapter > > +*ad =3D dev->data->dev_private; struct ice_dcf_hw *hw =3D &ad->real_hw= ; > > +struct ice_rx_queue *rxq; struct ice_tx_queue *txq; int ret, i; > > + > > +/* Stop All queues */ > > +ret =3D ice_dcf_disable_queues(hw); > > +if (ret) > > +PMD_DRV_LOG(WARNING, "Fail to stop queues"); > > + > > +for (i =3D 0; i < dev->data->nb_tx_queues; i++) { txq =3D > > +dev->data->tx_queues[i]; if (!txq) continue; > > +txq->tx_rel_mbufs(txq); > > +reset_tx_queue(txq); > > +dev->data->tx_queue_state[i] =3D > > RTE_ETH_QUEUE_STATE_STOPPED; > > +} > > +for (i =3D 0; i < dev->data->nb_rx_queues; i++) { rxq =3D > > +dev->data->rx_queues[i]; if (!rxq) continue; > > +rxq->rx_rel_mbufs(rxq); > > +reset_rx_queue(rxq); > > +dev->data->rx_queue_state[i] =3D > > RTE_ETH_QUEUE_STATE_STOPPED; > > +} > > +} > > + > > static void > > 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; > > > > if (ad->pf.adapter_stopped =3D=3D 1) > > return; > > > > +ice_dcf_stop_queues(dev); > > + > > +rte_intr_efd_disable(intr_handle); > > +if (intr_handle->intr_vec) { > > +rte_free(intr_handle->intr_vec); > > +intr_handle->intr_vec =3D NULL; > > +} > > + > > dev->data->dev_link.link_status =3D ETH_LINK_DOWN; > > ad->pf.adapter_stopped =3D 1; } @@ -476,6 +781,10 @@ static const > > struct eth_dev_ops ice_dcf_eth_dev_ops =3D { > > .tx_queue_setup =3D ice_tx_queue_setup, > > .rx_queue_release =3D ice_rx_queue_release, > > .tx_queue_release =3D ice_tx_queue_release, > > +.rx_queue_start =3D ice_dcf_rx_queue_start, > > +.tx_queue_start =3D ice_dcf_tx_queue_start, > > +.rx_queue_stop =3D ice_dcf_rx_queue_stop, > > +.tx_queue_stop =3D ice_dcf_tx_queue_stop, > > .link_update =3D ice_dcf_link_update, > > .stats_get =3D ice_dcf_stats_get, > > .stats_reset =3D ice_dcf_stats_reset, > > -- > > 2.17.1 >=20