From: "Xu, Ting" <ting.xu@intel.com> To: "Yang, Qiming" <qiming.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org> Cc: "Zhang, Qi Z" <qi.z.zhang@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>, "Ye, Xiaolong" <xiaolong.ye@intel.com> Subject: Re: [dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF Date: Tue, 9 Jun 2020 07:35:00 +0000 Message-ID: <0ee801adc7374b2e940d65bd98ca5cca@intel.com> (raw) In-Reply-To: <BN6PR11MB001752089F24CD055CB2F8D5E5850@BN6PR11MB0017.namprd11.prod.outlook.com> Hi, Qiming, > -----Original Message----- > From: Yang, Qiming <qiming.yang@intel.com> > Sent: Monday, June 8, 2020 3:36 PM > To: Xu, Ting <ting.xu@intel.com>; dev@dpdk.org > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Mcnamara, John > <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com> > Subject: RE: [PATCH v1 09/12] net/ice: add queue start and stop for DCF > > > > > -----Original Message----- > > From: Xu, Ting <ting.xu@intel.com> > > Sent: Saturday, June 6, 2020 04:18 > > To: dev@dpdk.org > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming > > <qiming.yang@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; > > Kovacevic, Marko <marko.kovacevic@intel.com> > > Subject: [PATCH v1 09/12] net/ice: add queue start and stop for DCF > > > > From: Qi Zhang <qi.z.zhang@intel.com> > > > > 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 <qi.z.zhang@intel.com> > > --- > > 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(-) > > > > Snip... > > > +} > > 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 = 0; i < dev->data->nb_tx_queues; i++) { txq = > > +dev->data->tx_queues[i]; if (txq->tx_deferred_start) continue; if > > +(ice_dcf_tx_queue_start(dev, i) != 0) { PMD_DRV_LOG(ERR, "Fail to > > +start queue %u", i); return -1; > > If queue start fail, should stop the queue already started > 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 follow the current iavf, since it actually needs this modification to stop started queues as well? > > +} > > +} > > + > > +for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = > > +dev->data->rx_queues[i]; if (rxq->rx_deferred_start) continue; if > > +(ice_dcf_rx_queue_start(dev, i) != 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 != 0) { > > +rte_intr_disable(intr_handle); rte_intr_enable(intr_handle); } > > + > > +ret = ice_dcf_start_queues(dev); > > +if (ret) { > > +PMD_DRV_LOG(ERR, "Failed to enable queues"); return ret; } > > + > > dev->data->dev_link.link_status = ETH_LINK_UP; > > > > return 0; > > } > > > > +static void > > +ice_dcf_stop_queues(struct rte_eth_dev *dev) { struct ice_dcf_adapter > > +*ad = dev->data->dev_private; struct ice_dcf_hw *hw = &ad->real_hw; > > +struct ice_rx_queue *rxq; struct ice_tx_queue *txq; int ret, i; > > + > > +/* Stop All queues */ > > +ret = ice_dcf_disable_queues(hw); > > +if (ret) > > +PMD_DRV_LOG(WARNING, "Fail to stop queues"); > > + > > +for (i = 0; i < dev->data->nb_tx_queues; i++) { txq = > > +dev->data->tx_queues[i]; if (!txq) continue; > > +txq->tx_rel_mbufs(txq); > > +reset_tx_queue(txq); > > +dev->data->tx_queue_state[i] = > > RTE_ETH_QUEUE_STATE_STOPPED; > > +} > > +for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = > > +dev->data->rx_queues[i]; if (!rxq) continue; > > +rxq->rx_rel_mbufs(rxq); > > +reset_rx_queue(rxq); > > +dev->data->rx_queue_state[i] = > > RTE_ETH_QUEUE_STATE_STOPPED; > > +} > > +} > > + > > static void > > 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; > > > > if (ad->pf.adapter_stopped == 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 = NULL; > > +} > > + > > dev->data->dev_link.link_status = ETH_LINK_DOWN; > > ad->pf.adapter_stopped = 1; } @@ -476,6 +781,10 @@ static const > > struct eth_dev_ops ice_dcf_eth_dev_ops = { > > .tx_queue_setup = ice_tx_queue_setup, > > .rx_queue_release = ice_rx_queue_release, > > .tx_queue_release = ice_tx_queue_release, > > +.rx_queue_start = ice_dcf_rx_queue_start, > > +.tx_queue_start = ice_dcf_tx_queue_start, > > +.rx_queue_stop = ice_dcf_rx_queue_stop, > > +.tx_queue_stop = ice_dcf_tx_queue_stop, > > .link_update = ice_dcf_link_update, > > .stats_get = ice_dcf_stats_get, > > .stats_reset = ice_dcf_stats_reset, > > -- > > 2.17.1 >
next prev parent reply other threads:[~2020-06-09 7:35 UTC|newest] Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-05 20:17 [dpdk-dev] [PATCH v1 00/12] enable DCF datapath configuration Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 01/12] net/ice: init RSS and supported RXDID in DCF Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 02/12] net/ice: complete device info get " Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 03/12] net/ice: complete dev configure " Ting Xu 2020-06-05 14:56 ` Ye Xiaolong 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 04/12] net/ice: complete queue setup " Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 05/12] net/ice: add stop flag for device start / stop Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 06/12] net/ice: add Rx queue init in DCF Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 07/12] net/ice: init RSS during DCF start Ting Xu 2020-06-05 15:26 ` Ye Xiaolong 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 08/12] net/ice: add queue config in DCF Ting Xu 2020-06-07 10:11 ` Ye Xiaolong 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF Ting Xu 2020-06-07 12:28 ` Ye Xiaolong 2020-06-08 7:35 ` Yang, Qiming 2020-06-09 7:35 ` Xu, Ting [this message] 2020-06-10 5:03 ` Yang, Qiming 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 10/12] net/ice: enable stats " Ting Xu 2020-06-07 10:19 ` Ye Xiaolong 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 11/12] net/ice: set MAC filter during dev start " Ting Xu 2020-06-05 20:17 ` [dpdk-dev] [PATCH v1 12/12] doc: enable DCF datapath configuration Ting Xu 2020-06-05 14:41 ` Ye Xiaolong 2020-06-09 7:50 ` Xu, Ting 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 00/12] " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 01/12] net/ice: init RSS and supported RXDID in DCF Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 02/12] net/ice: complete device info get " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 03/12] net/ice: complete dev configure " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 04/12] net/ice: complete queue setup " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 05/12] net/ice: add stop flag for device start / stop Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 06/12] net/ice: add Rx queue init in DCF Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 07/12] net/ice: init RSS during DCF start Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 08/12] net/ice: add queue config in DCF Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 09/12] net/ice: add queue start and stop for DCF Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 10/12] net/ice: enable stats " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 11/12] net/ice: set MAC filter during dev start " Ting Xu 2020-06-11 17:08 ` [dpdk-dev] [PATCH v2 12/12] doc: enable DCF datapath configuration Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 00/12] " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 01/12] net/ice: init RSS and supported RXDID in DCF Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 02/12] net/ice: complete device info get " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 03/12] net/ice: complete dev configure " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 04/12] net/ice: complete queue setup " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 05/12] net/ice: add stop flag for device start / stop Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 06/12] net/ice: add Rx queue init in DCF Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 07/12] net/ice: init RSS during DCF start Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 08/12] net/ice: add queue config in DCF Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 09/12] net/ice: add queue start and stop for DCF Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 10/12] net/ice: enable stats " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 11/12] net/ice: set MAC filter during dev start " Ting Xu 2020-06-19 8:50 ` [dpdk-dev] [PATCH v4 12/12] doc: enable DCF datapath configuration Ting Xu 2020-06-22 4:48 ` Zhang, Qi Z 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 00/12] " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 01/12] net/ice: init RSS and supported RXDID in DCF Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 02/12] net/ice: complete device info get " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 03/12] net/ice: complete dev configure " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 04/12] net/ice: complete queue setup " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 05/12] net/ice: add stop flag for device start / stop Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 06/12] net/ice: add Rx queue init in DCF Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 07/12] net/ice: init RSS during DCF start Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 08/12] net/ice: add queue config in DCF Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 09/12] net/ice: add queue start and stop for DCF Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 10/12] net/ice: enable stats " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 11/12] net/ice: set MAC filter during dev start " Ting Xu 2020-06-23 2:38 ` [dpdk-dev] [PATCH v5 12/12] doc: enable DCF datapath configuration Ting Xu 2020-06-29 2:43 ` [dpdk-dev] [PATCH v5 00/12] " Yang, Qiming 2020-06-29 5:36 ` 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=0ee801adc7374b2e940d65bd98ca5cca@intel.com \ --to=ting.xu@intel.com \ --cc=dev@dpdk.org \ --cc=john.mcnamara@intel.com \ --cc=marko.kovacevic@intel.com \ --cc=qi.z.zhang@intel.com \ --cc=qiming.yang@intel.com \ --cc=xiaolong.ye@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
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git