> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
> Sent: Tuesday, October 25, 2022 5:50 PM
> To: Guo, Junfeng <junfeng....@intel.com>; Zhang, Qi Z
> <qi.z.zh...@intel.com>; Wu, Jingjing <jingjing...@intel.com>; Xing, Beilei
> <beilei.x...@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun...@intel.com>
> Subject: Re: [PATCH v11 05/18] net/idpf: add support for device start and
> stop
> 
> On 10/24/22 16:12, Junfeng Guo wrote:
> > Add dev ops dev_start, dev_stop and link_update.
> >
> > Signed-off-by: Beilei Xing <beilei.x...@intel.com>
> > Signed-off-by: Xiaoyun Li <xiaoyun...@intel.com>
> > Signed-off-by: Junfeng Guo <junfeng....@intel.com>
> > ---
> >   drivers/net/idpf/idpf_ethdev.c | 89
> ++++++++++++++++++++++++++++++++++
> >   drivers/net/idpf/idpf_ethdev.h |  5 ++
> >   2 files changed, 94 insertions(+)
> >
> > diff --git a/drivers/net/idpf/idpf_ethdev.c
> > b/drivers/net/idpf/idpf_ethdev.c index 1d2075f466..4c7a2d0748 100644
> > --- a/drivers/net/idpf/idpf_ethdev.c
> > +++ b/drivers/net/idpf/idpf_ethdev.c
> > @@ -29,17 +29,42 @@ static const char * const idpf_valid_args[] = {
> >   };
> > +static int
> > +idpf_start_queues(struct rte_eth_dev *dev) {
> > +   struct idpf_rx_queue *rxq;
> > +   struct idpf_tx_queue *txq;
> > +   int err = 0;
> > +   int i;
> > +
> > +   for (i = 0; i < dev->data->nb_tx_queues; i++) {
> > +           txq = dev->data->tx_queues[i];
> > +           if (txq == NULL || txq->tx_deferred_start)
> > +                   continue;
> > +
> > +           PMD_DRV_LOG(ERR, "Start Tx queues not supported yet");
> > +           return -ENOTSUP;
> > +   }
> > +
> > +   for (i = 0; i < dev->data->nb_rx_queues; i++) {
> > +           rxq = dev->data->rx_queues[i];
> > +           if (rxq == NULL || rxq->rx_deferred_start)
> > +                   continue;
> > +
> > +           PMD_DRV_LOG(ERR, "Start Rx queues not supported yet");
> > +           return -ENOTSUP;
> > +   }
> > +
> > +   return err;
> > +}
> > +
> > +static int
> > +idpf_dev_start(struct rte_eth_dev *dev) {
> > +   struct idpf_vport *vport = dev->data->dev_private;
> > +
> > +   if (dev->data->mtu > vport->max_mtu) {
> > +           PMD_DRV_LOG(ERR, "MTU should be less than %d", vport-
> >max_mtu);
> > +           return -1;
> > +   }
> > +
> > +   vport->max_pkt_len = dev->data->mtu + IDPF_ETH_OVERHEAD;
> > +
> > +   if (idpf_start_queues(dev) != 0) {
> > +           PMD_DRV_LOG(ERR, "Failed to start queues");
> > +           return -1;
> > +   }
> > +
> > +   if (idpf_vc_ena_dis_vport(vport, true) != 0) {
> > +           PMD_DRV_LOG(ERR, "Failed to enable vport");
> 
> Don't you need to stop queues here?

In this patch, we didn't implement start HW queues, so I will remove start 
queues here
And add start_queues/stop_queues once the APIs are finished.

> 
> > +           return -1;
> > +   }
> > +
> > +   return 0;
> > +}
> > +
> > +static int
> > +idpf_dev_stop(struct rte_eth_dev *dev) {
> > +   struct idpf_vport *vport = dev->data->dev_private;
> 
> Stop queues?

Same.
> 
> > +
> > +   idpf_vc_ena_dis_vport(vport, false);
> > +
> > +   return 0;
> > +}
> > +
> >   static int
> >   idpf_dev_close(struct rte_eth_dev *dev)
> >   {

Reply via email to