[dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF
Xu, Ting
ting.xu at intel.com
Tue Jun 9 09:35:00 CEST 2020
Hi, Qiming,
> -----Original Message-----
> From: Yang, Qiming <qiming.yang at intel.com>
> Sent: Monday, June 8, 2020 3:36 PM
> To: Xu, Ting <ting.xu at intel.com>; dev at dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Mcnamara, John
> <john.mcnamara at intel.com>; Kovacevic, Marko <marko.kovacevic at intel.com>
> Subject: RE: [PATCH v1 09/12] net/ice: add queue start and stop for DCF
>
>
>
> > -----Original Message-----
> > From: Xu, Ting <ting.xu at intel.com>
> > Sent: Saturday, June 6, 2020 04:18
> > To: dev at dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Yang, Qiming
> > <qiming.yang at intel.com>; Mcnamara, John <john.mcnamara at intel.com>;
> > Kovacevic, Marko <marko.kovacevic at intel.com>
> > Subject: [PATCH v1 09/12] net/ice: add queue start and stop for DCF
> >
> > From: Qi Zhang <qi.z.zhang at 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 at 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
>
More information about the dev
mailing list