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 AA89942B19; Mon, 15 May 2023 22:28:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6702940A80; Mon, 15 May 2023 22:28:49 +0200 (CEST) Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com [209.85.222.49]) by mails.dpdk.org (Postfix) with ESMTP id A54D64021F for ; Mon, 15 May 2023 22:28:47 +0200 (CEST) Received: by mail-ua1-f49.google.com with SMTP id a1e0cc1a2514c-77f693190caso3964029241.0 for ; Mon, 15 May 2023 13:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684182527; x=1686774527; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ETO9jR0UYjIM80Iq4OHZVEEo7qxB1zyHE0aqFFQsdEU=; b=ebbzjUKPO8nur9kSQrNzANOcud/uulBS0IfOaRPf8GCClRgpHkA/g+O3cKMKD3SjfH G5lkjWYzznVoW/ak569YAc4zUo/JdKvG6qXuXDG5cIgkoHYbGlEy8hldMzkBR+sa/Py0 Yn8uu+gK3MnkGw5RXON0ghEe18EgDaCP1xohBBVRXjSQyE3rjtAE1ck4ws4CUORiH8WH Ss9+nuf7TAl+kI1N8JVBLJwlziXNEgSQ/AekJBUhv25DXLflxi5aUIo/DD2L4RBgce6u l7TqVtsnQb5/h7y5sdgT8PSJ+7DQkE6xcF56VhjzV42tXuIlsmoOxB/rpH/Y/GLGXu1h BQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684182527; x=1686774527; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ETO9jR0UYjIM80Iq4OHZVEEo7qxB1zyHE0aqFFQsdEU=; b=TGH2EL3cnlQMKLH5pXQ59M4TYg7N/phCCXsT1nZjFrDyGoap4MXI1J+kRA8QclpZvA jbLkT8uBW/Phpy0985JvM/POfUSm9de6nLGLZqzbkUTHwOszHtWNsmVTBsV2BZa/iqfC D5d7+5owtBwEcAKOLunycxMXPlVDdiLIosundaM1v0Mb2O75MhLoQTlNrqCwjD/6geCr bVFH7KDpOLTYsrO+l1Vu4ACDP+ziakKfSNCQeWQ3I48/LzRJUKmL/ED4dPTVc1FcVlhc NPjjoTYIagpIt2Lm6tXEq3zvDNSfD3+LtNL+kZ+uEaTx+VO5estgqnDByU9MfvB6FAPK ye8g== X-Gm-Message-State: AC+VfDwly7akqFHg4+GWTbVHm9wPqGVzS5FRpqiVt/sxlbChhwOx2X5K ugyJcDuaRr2u16DGhHjoe6OUjjYYMoBpPVE+jtHaIw== X-Google-Smtp-Source: ACHHUZ7nvk2Iy/LyGsl3o2hnnvZ+Q/T5YhVla9ezKb15O0MCj6p4xjVR1MgmJ6eN+O45ihlPdgNT7jYlepMKMJtxXdM= X-Received: by 2002:a67:f4ca:0:b0:42f:ef76:cc45 with SMTP id s10-20020a67f4ca000000b0042fef76cc45mr14022288vsn.14.1684182526693; Mon, 15 May 2023 13:28:46 -0700 (PDT) MIME-Version: 1.0 References: <20230509030729.2680451-1-junfeng.guo@intel.com> In-Reply-To: <20230509030729.2680451-1-junfeng.guo@intel.com> From: Rushil Gupta Date: Mon, 15 May 2023 13:28:35 -0700 Message-ID: Subject: Re: [PATCH] net/gve: support queue start and stop operations To: Junfeng Guo Cc: qi.z.zhang@intel.com, ferruh.yigit@amd.com, dev@dpdk.org, joshwash@google.com, jeroendb@google.com Content-Type: multipart/alternative; boundary="0000000000003e049f05fbc14d6b" 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 --0000000000003e049f05fbc14d6b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable tested-by: Rushil Gupta On Mon, May 8, 2023 at 8:07=E2=80=AFPM Junfeng Guo = wrote: > Add support for queue operations for GQI: > - gve_rx_queue_start > - gve_tx_queue_start > - gve_rx_queue_stop > - gve_tx_queue_stop > > Add support for queue operations for DQO: > - gve_rx_queue_start_dqo > - gve_tx_queue_start_dqo > - gve_rx_queue_stop_dqo > - gve_tx_queue_stop_dqo > > Also move the funcs of rxq_mbufs_alloc into the corresponding files. > > Signed-off-by: Junfeng Guo > --- > drivers/net/gve/gve_ethdev.c | 166 +++++++++++------------------------ > drivers/net/gve/gve_ethdev.h | 36 ++++++++ > drivers/net/gve/gve_rx.c | 96 ++++++++++++++++++-- > drivers/net/gve/gve_rx_dqo.c | 97 ++++++++++++++++++-- > drivers/net/gve/gve_tx.c | 54 ++++++++++-- > drivers/net/gve/gve_tx_dqo.c | 54 ++++++++++-- > 6 files changed, 364 insertions(+), 139 deletions(-) > > diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c > index 8b6861a24f..1dcb3b3a01 100644 > --- a/drivers/net/gve/gve_ethdev.c > +++ b/drivers/net/gve/gve_ethdev.c > @@ -104,81 +104,6 @@ gve_dev_configure(struct rte_eth_dev *dev) > return 0; > } > > -static int > -gve_refill_pages(struct gve_rx_queue *rxq) > -{ > - struct rte_mbuf *nmb; > - uint16_t i; > - int diag; > - > - diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], > rxq->nb_rx_desc); > - if (diag < 0) { > - for (i =3D 0; i < rxq->nb_rx_desc - 1; i++) { > - nmb =3D rte_pktmbuf_alloc(rxq->mpool); > - if (!nmb) > - break; > - rxq->sw_ring[i] =3D nmb; > - } > - if (i < rxq->nb_rx_desc - 1) > - return -ENOMEM; > - } > - rxq->nb_avail =3D 0; > - rxq->next_avail =3D rxq->nb_rx_desc - 1; > - > - for (i =3D 0; i < rxq->nb_rx_desc; i++) { > - if (rxq->is_gqi_qpl) { > - rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(i = * > PAGE_SIZE); > - } else { > - if (i =3D=3D rxq->nb_rx_desc - 1) > - break; > - nmb =3D rxq->sw_ring[i]; > - rxq->rx_data_ring[i].addr =3D > rte_cpu_to_be_64(rte_mbuf_data_iova(nmb)); > - } > - } > - > - rte_write32(rte_cpu_to_be_32(rxq->next_avail), rxq->qrx_tail); > - > - return 0; > -} > - > -static int > -gve_refill_dqo(struct gve_rx_queue *rxq) > -{ > - struct rte_mbuf *nmb; > - uint16_t i; > - int diag; > - > - diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], > rxq->nb_rx_desc); > - if (diag < 0) { > - rxq->stats.no_mbufs_bulk++; > - for (i =3D 0; i < rxq->nb_rx_desc - 1; i++) { > - nmb =3D rte_pktmbuf_alloc(rxq->mpool); > - if (!nmb) > - break; > - rxq->sw_ring[i] =3D nmb; > - } > - if (i < rxq->nb_rx_desc - 1) { > - rxq->stats.no_mbufs +=3D rxq->nb_rx_desc - 1 - i; > - return -ENOMEM; > - } > - } > - > - for (i =3D 0; i < rxq->nb_rx_desc; i++) { > - if (i =3D=3D rxq->nb_rx_desc - 1) > - break; > - nmb =3D rxq->sw_ring[i]; > - rxq->rx_ring[i].buf_addr =3D > rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb)); > - rxq->rx_ring[i].buf_id =3D rte_cpu_to_le_16(i); > - } > - > - rxq->nb_rx_hold =3D 0; > - rxq->bufq_tail =3D rxq->nb_rx_desc - 1; > - > - rte_write32(rxq->bufq_tail, rxq->qrx_tail); > - > - return 0; > -} > - > static int > gve_link_update(struct rte_eth_dev *dev, __rte_unused int > wait_to_complete) > { > @@ -208,65 +133,68 @@ gve_link_update(struct rte_eth_dev *dev, > __rte_unused int wait_to_complete) > } > > static int > -gve_dev_start(struct rte_eth_dev *dev) > +gve_start_queues(struct rte_eth_dev *dev) > { > - uint16_t num_queues =3D dev->data->nb_tx_queues; > struct gve_priv *priv =3D dev->data->dev_private; > - struct gve_tx_queue *txq; > - struct gve_rx_queue *rxq; > + uint16_t num_queues; > uint16_t i; > - int err; > + int ret; > > + num_queues =3D dev->data->nb_tx_queues; > priv->txqs =3D (struct gve_tx_queue **)dev->data->tx_queues; > - err =3D gve_adminq_create_tx_queues(priv, num_queues); > - if (err) { > - PMD_DRV_LOG(ERR, "failed to create %u tx queues.", > num_queues); > - return err; > - } > - for (i =3D 0; i < num_queues; i++) { > - txq =3D priv->txqs[i]; > - txq->qtx_tail =3D > - &priv->db_bar2[rte_be_to_cpu_32(txq->qres->db_index)]; > - txq->qtx_head =3D > - > &priv->cnt_array[rte_be_to_cpu_32(txq->qres->counter_index)]; > - > - rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), > txq->ntfy_addr); > - } > + ret =3D gve_adminq_create_tx_queues(priv, num_queues); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Failed to create %u tx queues.", > num_queues); > + return ret; > + } > + for (i =3D 0; i < num_queues; i++) > + if (gve_tx_queue_start(dev, i) !=3D 0) { > + PMD_DRV_LOG(ERR, "Fail to start Tx queue %d", i); > + goto err_tx; > + } > > num_queues =3D dev->data->nb_rx_queues; > priv->rxqs =3D (struct gve_rx_queue **)dev->data->rx_queues; > - err =3D gve_adminq_create_rx_queues(priv, num_queues); > - if (err) { > - PMD_DRV_LOG(ERR, "failed to create %u rx queues.", > num_queues); > + ret =3D gve_adminq_create_rx_queues(priv, num_queues); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Failed to create %u rx queues.", > num_queues); > goto err_tx; > } > for (i =3D 0; i < num_queues; i++) { > - rxq =3D priv->rxqs[i]; > - rxq->qrx_tail =3D > - &priv->db_bar2[rte_be_to_cpu_32(rxq->qres->db_index)]; > - > - rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), > rxq->ntfy_addr); > - > if (gve_is_gqi(priv)) > - err =3D gve_refill_pages(rxq); > + ret =3D gve_rx_queue_start(dev, i); > else > - err =3D gve_refill_dqo(rxq); > - if (err) { > - PMD_DRV_LOG(ERR, "Failed to refill for RX"); > + ret =3D gve_rx_queue_start_dqo(dev, i); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Fail to start Rx queue %d", i); > goto err_rx; > } > } > > - dev->data->dev_started =3D 1; > - gve_link_update(dev, 0); > - > return 0; > > err_rx: > gve_stop_rx_queues(dev); > err_tx: > gve_stop_tx_queues(dev); > - return err; > + return ret; > +} > + > +static int > +gve_dev_start(struct rte_eth_dev *dev) > +{ > + int ret; > + > + ret =3D gve_start_queues(dev); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Failed to start queues"); > + return ret; > + } > + > + dev->data->dev_started =3D 1; > + gve_link_update(dev, 0); > + > + return 0; > } > > static int > @@ -573,6 +501,10 @@ static const struct eth_dev_ops gve_eth_dev_ops =3D = { > .tx_queue_setup =3D gve_tx_queue_setup, > .rx_queue_release =3D gve_rx_queue_release, > .tx_queue_release =3D gve_tx_queue_release, > + .rx_queue_start =3D gve_rx_queue_start, > + .tx_queue_start =3D gve_tx_queue_start, > + .rx_queue_stop =3D gve_rx_queue_stop, > + .tx_queue_stop =3D gve_tx_queue_stop, > .link_update =3D gve_link_update, > .stats_get =3D gve_dev_stats_get, > .stats_reset =3D gve_dev_stats_reset, > @@ -591,6 +523,10 @@ static const struct eth_dev_ops gve_eth_dev_ops_dqo = =3D > { > .tx_queue_setup =3D gve_tx_queue_setup_dqo, > .rx_queue_release =3D gve_rx_queue_release_dqo, > .tx_queue_release =3D gve_tx_queue_release_dqo, > + .rx_queue_start =3D gve_rx_queue_start_dqo, > + .tx_queue_start =3D gve_tx_queue_start_dqo, > + .rx_queue_stop =3D gve_rx_queue_stop_dqo, > + .tx_queue_stop =3D gve_tx_queue_stop_dqo, > .link_update =3D gve_link_update, > .stats_get =3D gve_dev_stats_get, > .stats_reset =3D gve_dev_stats_reset, > @@ -877,12 +813,12 @@ gve_dev_init(struct rte_eth_dev *eth_dev) > > if (gve_is_gqi(priv)) { > eth_dev->dev_ops =3D &gve_eth_dev_ops; > - eth_dev->rx_pkt_burst =3D gve_rx_burst; > - eth_dev->tx_pkt_burst =3D gve_tx_burst; > + gve_set_rx_function(eth_dev); > + gve_set_tx_function(eth_dev); > } else { > eth_dev->dev_ops =3D &gve_eth_dev_ops_dqo; > - eth_dev->rx_pkt_burst =3D gve_rx_burst_dqo; > - eth_dev->tx_pkt_burst =3D gve_tx_burst_dqo; > + gve_set_rx_function_dqo(eth_dev); > + gve_set_tx_function_dqo(eth_dev); > } > > eth_dev->data->mac_addrs =3D &priv->dev_addr; > diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h > index 53a75044c5..cd62debd22 100644 > --- a/drivers/net/gve/gve_ethdev.h > +++ b/drivers/net/gve/gve_ethdev.h > @@ -367,6 +367,18 @@ gve_tx_queue_release(struct rte_eth_dev *dev, > uint16_t qid); > void > gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid); > > +int > +gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); > + > +int > +gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id); > + > +int > +gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); > + > +int > +gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); > + > void > gve_stop_tx_queues(struct rte_eth_dev *dev); > > @@ -379,6 +391,12 @@ gve_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); > uint16_t > gve_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); > > +void > +gve_set_rx_function(struct rte_eth_dev *dev); > + > +void > +gve_set_tx_function(struct rte_eth_dev *dev); > + > /* Below functions are used for DQO */ > > int > @@ -397,6 +415,18 @@ gve_tx_queue_release_dqo(struct rte_eth_dev *dev, > uint16_t qid); > void > gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid); > > +int > +gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id); > + > +int > +gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id); > + > +int > +gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id); > + > +int > +gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id); > + > void > gve_stop_tx_queues_dqo(struct rte_eth_dev *dev); > > @@ -409,4 +439,10 @@ gve_rx_burst_dqo(void *rxq, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts); > uint16_t > gve_tx_burst_dqo(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)= ; > > +void > +gve_set_rx_function_dqo(struct rte_eth_dev *dev); > + > +void > +gve_set_tx_function_dqo(struct rte_eth_dev *dev); > + > #endif /* _GVE_ETHDEV_H_ */ > diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c > index f2f6202404..b8c92ccda0 100644 > --- a/drivers/net/gve/gve_rx.c > +++ b/drivers/net/gve/gve_rx.c > @@ -414,11 +414,91 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_= t > queue_id, > return err; > } > > +static int > +gve_rxq_mbufs_alloc(struct gve_rx_queue *rxq) > +{ > + struct rte_mbuf *nmb; > + uint16_t i; > + int diag; > + > + diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], > rxq->nb_rx_desc); > + if (diag < 0) { > + for (i =3D 0; i < rxq->nb_rx_desc - 1; i++) { > + nmb =3D rte_pktmbuf_alloc(rxq->mpool); > + if (!nmb) > + break; > + rxq->sw_ring[i] =3D nmb; > + } > + if (i < rxq->nb_rx_desc - 1) > + return -ENOMEM; > + } > + rxq->nb_avail =3D 0; > + rxq->next_avail =3D rxq->nb_rx_desc - 1; > + > + for (i =3D 0; i < rxq->nb_rx_desc; i++) { > + if (rxq->is_gqi_qpl) { > + rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(i = * > PAGE_SIZE); > + } else { > + if (i =3D=3D rxq->nb_rx_desc - 1) > + break; > + nmb =3D rxq->sw_ring[i]; > + rxq->rx_data_ring[i].addr =3D > rte_cpu_to_be_64(rte_mbuf_data_iova(nmb)); > + } > + } > + > + rte_write32(rte_cpu_to_be_32(rxq->next_avail), rxq->qrx_tail); > + > + return 0; > +} > + > +int > +gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) > +{ > + struct gve_priv *hw =3D dev->data->dev_private; > + struct gve_rx_queue *rxq; > + int ret; > + > + if (rx_queue_id >=3D dev->data->nb_rx_queues) > + return -EINVAL; > + > + rxq =3D dev->data->rx_queues[rx_queue_id]; > + > + rxq->qrx_tail =3D > &hw->db_bar2[rte_be_to_cpu_32(rxq->qres->db_index)]; > + > + rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), rxq->ntfy_addr); > + > + ret =3D gve_rxq_mbufs_alloc(rxq); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Failed to alloc Rx queue mbuf"); > + return ret; > + } > + > + dev->data->rx_queue_state[rx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STARTED; > + > + return 0; > +} > + > +int > +gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) > +{ > + struct gve_rx_queue *rxq; > + > + if (rx_queue_id >=3D dev->data->nb_rx_queues) > + return -EINVAL; > + > + rxq =3D dev->data->rx_queues[rx_queue_id]; > + gve_release_rxq_mbufs(rxq); > + gve_reset_rxq(rxq); > + > + dev->data->rx_queue_state[rx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + > + return 0; > +} > + > void > gve_stop_rx_queues(struct rte_eth_dev *dev) > { > struct gve_priv *hw =3D dev->data->dev_private; > - struct gve_rx_queue *rxq; > uint16_t i; > int err; > > @@ -429,9 +509,13 @@ gve_stop_rx_queues(struct rte_eth_dev *dev) > if (err !=3D 0) > PMD_DRV_LOG(WARNING, "failed to destroy rxqs"); > > - for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > - rxq =3D dev->data->rx_queues[i]; > - gve_release_rxq_mbufs(rxq); > - gve_reset_rxq(rxq); > - } > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + if (gve_rx_queue_stop(dev, i) !=3D 0) > + PMD_DRV_LOG(WARNING, "Fail to stop Rx queue %d", > i); > +} > + > +void > +gve_set_rx_function(struct rte_eth_dev *dev) > +{ > + dev->rx_pkt_burst =3D gve_rx_burst; > } > diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c > index 1d6b21359c..236aefd2a8 100644 > --- a/drivers/net/gve/gve_rx_dqo.c > +++ b/drivers/net/gve/gve_rx_dqo.c > @@ -333,11 +333,92 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, > uint16_t queue_id, > return err; > } > > +static int > +gve_rxq_mbufs_alloc_dqo(struct gve_rx_queue *rxq) > +{ > + struct rte_mbuf *nmb; > + uint16_t i; > + int diag; > + > + diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], > rxq->nb_rx_desc); > + if (diag < 0) { > + rxq->stats.no_mbufs_bulk++; > + for (i =3D 0; i < rxq->nb_rx_desc - 1; i++) { > + nmb =3D rte_pktmbuf_alloc(rxq->mpool); > + if (!nmb) > + break; > + rxq->sw_ring[i] =3D nmb; > + } > + if (i < rxq->nb_rx_desc - 1) { > + rxq->stats.no_mbufs +=3D rxq->nb_rx_desc - 1 - i; > + return -ENOMEM; > + } > + } > + > + for (i =3D 0; i < rxq->nb_rx_desc; i++) { > + if (i =3D=3D rxq->nb_rx_desc - 1) > + break; > + nmb =3D rxq->sw_ring[i]; > + rxq->rx_ring[i].buf_addr =3D > rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb)); > + rxq->rx_ring[i].buf_id =3D rte_cpu_to_le_16(i); > + } > + > + rxq->nb_rx_hold =3D 0; > + rxq->bufq_tail =3D rxq->nb_rx_desc - 1; > + > + rte_write32(rxq->bufq_tail, rxq->qrx_tail); > + > + return 0; > +} > + > +int > +gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id) > +{ > + struct gve_priv *hw =3D dev->data->dev_private; > + struct gve_rx_queue *rxq; > + int ret; > + > + if (rx_queue_id >=3D dev->data->nb_rx_queues) > + return -EINVAL; > + > + rxq =3D dev->data->rx_queues[rx_queue_id]; > + > + rxq->qrx_tail =3D > &hw->db_bar2[rte_be_to_cpu_32(rxq->qres->db_index)]; > + > + rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), rxq->ntfy_addr); > + > + ret =3D gve_rxq_mbufs_alloc_dqo(rxq); > + if (ret !=3D 0) { > + PMD_DRV_LOG(ERR, "Failed to alloc Rx queue mbuf"); > + return ret; > + } > + > + dev->data->rx_queue_state[rx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STARTED; > + > + return 0; > +} > + > +int > +gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id) > +{ > + struct gve_rx_queue *rxq; > + > + if (rx_queue_id >=3D dev->data->nb_rx_queues) > + return -EINVAL; > + > + rxq =3D dev->data->rx_queues[rx_queue_id]; > + gve_release_rxq_mbufs_dqo(rxq); > + gve_reset_rxq_dqo(rxq); > + > + dev->data->rx_queue_state[rx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + > + return 0; > +} > + > void > gve_stop_rx_queues_dqo(struct rte_eth_dev *dev) > { > struct gve_priv *hw =3D dev->data->dev_private; > - struct gve_rx_queue *rxq; > uint16_t i; > int err; > > @@ -345,9 +426,13 @@ gve_stop_rx_queues_dqo(struct rte_eth_dev *dev) > if (err !=3D 0) > PMD_DRV_LOG(WARNING, "failed to destroy rxqs"); > > - for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > - rxq =3D dev->data->rx_queues[i]; > - gve_release_rxq_mbufs_dqo(rxq); > - gve_reset_rxq_dqo(rxq); > - } > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) > + if (gve_rx_queue_stop_dqo(dev, i) !=3D 0) > + PMD_DRV_LOG(WARNING, "Fail to stop Rx queue %d", > i); > +} > + > +void > +gve_set_rx_function_dqo(struct rte_eth_dev *dev) > +{ > + dev->rx_pkt_burst =3D gve_rx_burst_dqo; > } > diff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c > index 13dc807623..2e0d001109 100644 > --- a/drivers/net/gve/gve_tx.c > +++ b/drivers/net/gve/gve_tx.c > @@ -664,11 +664,49 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_= t > queue_id, uint16_t nb_desc, > return err; > } > > +int > +gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) > +{ > + struct gve_priv *hw =3D dev->data->dev_private; > + struct gve_tx_queue *txq; > + > + if (tx_queue_id >=3D dev->data->nb_tx_queues) > + return -EINVAL; > + > + txq =3D dev->data->tx_queues[tx_queue_id]; > + > + txq->qtx_tail =3D > &hw->db_bar2[rte_be_to_cpu_32(txq->qres->db_index)]; > + txq->qtx_head =3D > + &hw->cnt_array[rte_be_to_cpu_32(txq->qres->counter_index)= ]; > + > + rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), txq->ntfy_addr); > + > + dev->data->rx_queue_state[tx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STARTED; > + > + return 0; > +} > + > +int > +gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) > +{ > + struct gve_tx_queue *txq; > + > + if (tx_queue_id >=3D dev->data->nb_tx_queues) > + return -EINVAL; > + > + txq =3D dev->data->tx_queues[tx_queue_id]; > + gve_release_txq_mbufs(txq); > + gve_reset_txq(txq); > + > + dev->data->tx_queue_state[tx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + > + return 0; > +} > + > void > gve_stop_tx_queues(struct rte_eth_dev *dev) > { > struct gve_priv *hw =3D dev->data->dev_private; > - struct gve_tx_queue *txq; > uint16_t i; > int err; > > @@ -679,9 +717,13 @@ gve_stop_tx_queues(struct rte_eth_dev *dev) > if (err !=3D 0) > PMD_DRV_LOG(WARNING, "failed to destroy txqs"); > > - for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > - txq =3D dev->data->tx_queues[i]; > - gve_release_txq_mbufs(txq); > - gve_reset_txq(txq); > - } > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + if (gve_tx_queue_stop(dev, i) !=3D 0) > + PMD_DRV_LOG(WARNING, "Fail to stop Tx queue %d", > i); > +} > + > +void > +gve_set_tx_function(struct rte_eth_dev *dev) > +{ > + dev->tx_pkt_burst =3D gve_tx_burst; > } > diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c > index b38eeaea4b..e0d144835b 100644 > --- a/drivers/net/gve/gve_tx_dqo.c > +++ b/drivers/net/gve/gve_tx_dqo.c > @@ -373,11 +373,49 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, > uint16_t queue_id, > return err; > } > > +int > +gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id) > +{ > + struct gve_priv *hw =3D dev->data->dev_private; > + struct gve_tx_queue *txq; > + > + if (tx_queue_id >=3D dev->data->nb_tx_queues) > + return -EINVAL; > + > + txq =3D dev->data->tx_queues[tx_queue_id]; > + > + txq->qtx_tail =3D > &hw->db_bar2[rte_be_to_cpu_32(txq->qres->db_index)]; > + txq->qtx_head =3D > + &hw->cnt_array[rte_be_to_cpu_32(txq->qres->counter_index)= ]; > + > + rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), txq->ntfy_addr); > + > + dev->data->rx_queue_state[tx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STARTED; > + > + return 0; > +} > + > +int > +gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id) > +{ > + struct gve_tx_queue *txq; > + > + if (tx_queue_id >=3D dev->data->nb_tx_queues) > + return -EINVAL; > + > + txq =3D dev->data->tx_queues[tx_queue_id]; > + gve_release_txq_mbufs_dqo(txq); > + gve_reset_txq_dqo(txq); > + > + dev->data->tx_queue_state[tx_queue_id] =3D > RTE_ETH_QUEUE_STATE_STOPPED; > + > + return 0; > +} > + > void > gve_stop_tx_queues_dqo(struct rte_eth_dev *dev) > { > struct gve_priv *hw =3D dev->data->dev_private; > - struct gve_tx_queue *txq; > uint16_t i; > int err; > > @@ -385,9 +423,13 @@ gve_stop_tx_queues_dqo(struct rte_eth_dev *dev) > if (err !=3D 0) > PMD_DRV_LOG(WARNING, "failed to destroy txqs"); > > - for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > - txq =3D dev->data->tx_queues[i]; > - gve_release_txq_mbufs_dqo(txq); > - gve_reset_txq_dqo(txq); > - } > + for (i =3D 0; i < dev->data->nb_tx_queues; i++) > + if (gve_tx_queue_stop_dqo(dev, i) !=3D 0) > + PMD_DRV_LOG(WARNING, "Fail to stop Tx queue %d", > i); > +} > + > +void > +gve_set_tx_function_dqo(struct rte_eth_dev *dev) > +{ > + dev->tx_pkt_burst =3D gve_tx_burst_dqo; > } > -- > 2.34.1 > > --0000000000003e049f05fbc14d6b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
tested-by: Rushil Gupta <rushilg@google.com>

On Mon, May 8,= 2023 at 8:07=E2=80=AFPM Junfeng Guo <junfeng.guo@intel.com> wrote:
Add support for queue operati= ons for GQI:
=C2=A0- gve_rx_queue_start
=C2=A0- gve_tx_queue_start
=C2=A0- gve_rx_queue_stop
=C2=A0- gve_tx_queue_stop

Add support for queue operations for DQO:
=C2=A0- gve_rx_queue_start_dqo
=C2=A0- gve_tx_queue_start_dqo
=C2=A0- gve_rx_queue_stop_dqo
=C2=A0- gve_tx_queue_stop_dqo

Also move the funcs of rxq_mbufs_alloc into the corresponding files.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
=C2=A0drivers/net/gve/gve_ethdev.c | 166 +++++++++++-----------------------= -
=C2=A0drivers/net/gve/gve_ethdev.h |=C2=A0 36 ++++++++
=C2=A0drivers/net/gve/gve_rx.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 96 ++++++++++++++= ++++--
=C2=A0drivers/net/gve/gve_rx_dqo.c |=C2=A0 97 ++++++++++++++++++--
=C2=A0drivers/net/gve/gve_tx.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 54 ++++++++++-- =C2=A0drivers/net/gve/gve_tx_dqo.c |=C2=A0 54 ++++++++++--
=C2=A06 files changed, 364 insertions(+), 139 deletions(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c index 8b6861a24f..1dcb3b3a01 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -104,81 +104,6 @@ gve_dev_configure(struct rte_eth_dev *dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0}

-static int
-gve_refill_pages(struct gve_rx_queue *rxq)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct rte_mbuf *nmb;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t i;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0int diag;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, = &rxq->sw_ring[0], rxq->nb_rx_desc);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (diag < 0) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i <= ; rxq->nb_rx_desc - 1; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rte_pktmbuf_alloc(rxq->mpool);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (!nmb)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->sw_ring[i] =3D nmb;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i < rxq->= nb_rx_desc - 1)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return -ENOMEM;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->nb_avail =3D 0;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->next_avail =3D rxq->nb_rx_desc - 1;<= br> -
-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < rxq->nb_rx_desc; i++) {=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rxq->is_gqi_= qpl) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(i * PAGE_SIZE);=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (i =3D=3D rxq->nb_rx_desc - 1)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rxq->sw_ring[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(rte_mbuf_data_i= ova(nmb));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(rxq->next_avail= ), rxq->qrx_tail);
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
-}
-
-static int
-gve_refill_dqo(struct gve_rx_queue *rxq)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct rte_mbuf *nmb;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t i;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0int diag;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, = &rxq->sw_ring[0], rxq->nb_rx_desc);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (diag < 0) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->stats.no_mb= ufs_bulk++;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i <= ; rxq->nb_rx_desc - 1; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rte_pktmbuf_alloc(rxq->mpool);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (!nmb)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->sw_ring[i] =3D nmb;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i < rxq->= nb_rx_desc - 1) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->stats.no_mbufs +=3D rxq->nb_rx_desc - 1 - i;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return -ENOMEM;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < rxq->nb_rx_desc; i++) {=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i =3D=3D rxq-&g= t;nb_rx_desc - 1)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0break;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0nmb =3D rxq->sw_= ring[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->rx_ring[i].= buf_addr =3D rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->rx_ring[i].= buf_id =3D rte_cpu_to_le_16(i);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->nb_rx_hold =3D 0;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->bufq_tail =3D rxq->nb_rx_desc - 1; -
-=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rxq->bufq_tail, rxq->qrx_tail= );
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
-}
-
=C2=A0static int
=C2=A0gve_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_com= plete)
=C2=A0{
@@ -208,65 +133,68 @@ gve_link_update(struct rte_eth_dev *dev, __rte_unused= int wait_to_complete)
=C2=A0}

=C2=A0static int
-gve_dev_start(struct rte_eth_dev *dev)
+gve_start_queues(struct rte_eth_dev *dev)
=C2=A0{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t num_queues =3D dev->data->nb_tx_= queues;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct gve_priv *priv =3D dev->data->dev_= private;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t num_queues;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t i;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0int err;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;

+=C2=A0 =C2=A0 =C2=A0 =C2=A0num_queues =3D dev->data->nb_tx_queues; =C2=A0 =C2=A0 =C2=A0 =C2=A0 priv->txqs =3D (struct gve_tx_queue **)dev-&= gt;data->tx_queues;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D gve_adminq_create_tx_queues(priv, num_q= ueues);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (err) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;failed to create %u tx queues.", num_queues);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return err;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < num_queues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D priv->tx= qs[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_tail = =3D
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&priv->db_ba= r2[rte_be_to_cpu_32(txq->qres->db_index)];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_head = =3D
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&priv->cnt_a= rray[rte_be_to_cpu_32(txq->qres->counter_index)];
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu= _to_be_32(GVE_IRQ_MASK), txq->ntfy_addr);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gve_adminq_create_tx_queues(priv, num_q= ueues);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;Failed to create %u tx queues.", num_queues);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < num_queues; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gve_tx_queue_st= art(dev, i) !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(ERR, "Fail to start Tx queue %d", i);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0goto err_tx;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0 =C2=A0 num_queues =3D dev->data->nb_rx_queues; =C2=A0 =C2=A0 =C2=A0 =C2=A0 priv->rxqs =3D (struct gve_rx_queue **)dev-&= gt;data->rx_queues;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D gve_adminq_create_rx_queues(priv, num_q= ueues);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (err) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;failed to create %u rx queues.", num_queues);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gve_adminq_create_rx_queues(priv, num_q= ueues);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;Failed to create %u rx queues.", num_queues);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto err_tx;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (i =3D 0; i < num_queues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D priv->rx= qs[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->qrx_tail = =3D
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&priv->db_ba= r2[rte_be_to_cpu_32(rxq->qres->db_index)];
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu= _to_be_32(GVE_IRQ_MASK), rxq->ntfy_addr);
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (gve_is_gqi(priv= ))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0err =3D gve_refill_pages(rxq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ret =3D gve_rx_queue_start(dev, i);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0err =3D gve_refill_dqo(rxq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (err) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(ERR, "Failed to refill for RX");
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ret =3D gve_rx_queue_start_dqo(dev, i);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) { +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(ERR, "Fail to start Rx queue %d", i);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 goto err_rx;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

-=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->dev_started =3D 1;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_link_update(dev, 0);
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;

=C2=A0err_rx:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 gve_stop_rx_queues(dev);
=C2=A0err_tx:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 gve_stop_tx_queues(dev);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return err;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;
+}
+
+static int
+gve_dev_start(struct rte_eth_dev *dev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gve_start_queues(dev);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;Failed to start queues");
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->dev_started =3D 1;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_link_update(dev, 0);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
=C2=A0}

=C2=A0static int
@@ -573,6 +501,10 @@ static const struct eth_dev_ops gve_eth_dev_ops =3D {<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 .tx_queue_setup=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_tx_queue_setup,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .rx_queue_release=C2=A0 =C2=A0 =C2=A0=3D gve_rx= _queue_release,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .tx_queue_release=C2=A0 =C2=A0 =C2=A0=3D gve_tx= _queue_release,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.rx_queue_start=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_rx_queue_start,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.tx_queue_start=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_tx_queue_start,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.rx_queue_stop=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D g= ve_rx_queue_stop,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.tx_queue_stop=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D g= ve_tx_queue_stop,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .link_update=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =3D gve_link_update,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .stats_get=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =3D gve_dev_stats_get,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .stats_reset=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =3D gve_dev_stats_reset,
@@ -591,6 +523,10 @@ static const struct eth_dev_ops gve_eth_dev_ops_dqo = =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .tx_queue_setup=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_tx_queue_setup_dqo,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .rx_queue_release=C2=A0 =C2=A0 =C2=A0=3D gve_rx= _queue_release_dqo,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .tx_queue_release=C2=A0 =C2=A0 =C2=A0=3D gve_tx= _queue_release_dqo,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.rx_queue_start=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_rx_queue_start_dqo,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.tx_queue_start=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D g= ve_tx_queue_start_dqo,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.rx_queue_stop=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D g= ve_rx_queue_stop_dqo,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.tx_queue_stop=C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D g= ve_tx_queue_stop_dqo,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .link_update=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =3D gve_link_update,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .stats_get=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =3D gve_dev_stats_get,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .stats_reset=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =3D gve_dev_stats_reset,
@@ -877,12 +813,12 @@ gve_dev_init(struct rte_eth_dev *eth_dev)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (gve_is_gqi(priv)) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 eth_dev->dev_ops= =3D &gve_eth_dev_ops;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0eth_dev->rx_pkt_= burst =3D gve_rx_burst;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0eth_dev->tx_pkt_= burst =3D gve_tx_burst;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_set_rx_function= (eth_dev);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_set_tx_function= (eth_dev);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 } else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 eth_dev->dev_ops= =3D &gve_eth_dev_ops_dqo;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0eth_dev->rx_pkt_= burst =3D gve_rx_burst_dqo;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0eth_dev->tx_pkt_= burst =3D gve_tx_burst_dqo;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_set_rx_function= _dqo(eth_dev);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_set_tx_function= _dqo(eth_dev);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 eth_dev->data->mac_addrs =3D &priv-&g= t;dev_addr;
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h index 53a75044c5..cd62debd22 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -367,6 +367,18 @@ gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t= qid);
=C2=A0void
=C2=A0gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);

+int
+gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+
+int
+gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
+int
+gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+
+int
+gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
=C2=A0void
=C2=A0gve_stop_tx_queues(struct rte_eth_dev *dev);

@@ -379,6 +391,12 @@ gve_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uin= t16_t nb_pkts);
=C2=A0uint16_t
=C2=A0gve_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);=

+void
+gve_set_rx_function(struct rte_eth_dev *dev);
+
+void
+gve_set_tx_function(struct rte_eth_dev *dev);
+
=C2=A0/* Below functions are used for DQO */

=C2=A0int
@@ -397,6 +415,18 @@ gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint= 16_t qid);
=C2=A0void
=C2=A0gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);

+int
+gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
+int
+gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+
+int
+gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
+int
+gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+
=C2=A0void
=C2=A0gve_stop_tx_queues_dqo(struct rte_eth_dev *dev);

@@ -409,4 +439,10 @@ gve_rx_burst_dqo(void *rxq, struct rte_mbuf **rx_pkts,= uint16_t nb_pkts);
=C2=A0uint16_t
=C2=A0gve_tx_burst_dqo(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pk= ts);

+void
+gve_set_rx_function_dqo(struct rte_eth_dev *dev);
+
+void
+gve_set_tx_function_dqo(struct rte_eth_dev *dev);
+
=C2=A0#endif /* _GVE_ETHDEV_H_ */
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index f2f6202404..b8c92ccda0 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -414,11 +414,91 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t = queue_id,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return err;
=C2=A0}

+static int
+gve_rxq_mbufs_alloc(struct gve_rx_queue *rxq)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct rte_mbuf *nmb;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t i;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int diag;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, = &rxq->sw_ring[0], rxq->nb_rx_desc);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (diag < 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i <= ; rxq->nb_rx_desc - 1; i++) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rte_pktmbuf_alloc(rxq->mpool);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (!nmb)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->sw_ring[i] =3D nmb;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i < rxq->= nb_rx_desc - 1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return -ENOMEM;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->nb_avail =3D 0;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->next_avail =3D rxq->nb_rx_desc - 1;<= br> +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < rxq->nb_rx_desc; i++) {=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rxq->is_gqi_= qpl) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(i * PAGE_SIZE);=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (i =3D=3D rxq->nb_rx_desc - 1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rxq->sw_ring[i];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->rx_data_ring[i].addr =3D rte_cpu_to_be_64(rte_mbuf_data_i= ova(nmb));
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(rxq->next_avail= ), rxq->qrx_tail);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_priv *hw =3D dev->data->dev_pr= ivate;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rx_queue_id >=3D dev->data->nb_rx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->data->rx_queues[rx_queue_id]= ;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->qrx_tail =3D &hw->db_bar2[rte_be= _to_cpu_32(rxq->qres->db_index)];
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), rxq= ->ntfy_addr);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gve_rxq_mbufs_alloc(rxq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;Failed to alloc Rx queue mbuf");
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[rx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STARTED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rx_queue_id >=3D dev->data->nb_rx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->data->rx_queues[rx_queue_id]= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_rxq_mbufs(rxq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_rxq(rxq);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[rx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STOPPED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
=C2=A0void
=C2=A0gve_stop_rx_queues(struct rte_eth_dev *dev)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct gve_priv *hw =3D dev->data->dev_pr= ivate;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t i;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int err;

@@ -429,9 +509,13 @@ gve_stop_rx_queues(struct rte_eth_dev *dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (err !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMD_DRV_LOG(WARNING= , "failed to destroy rxqs");

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_rx_que= ues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->dat= a->rx_queues[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_rxq_mbu= fs(rxq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_rxq(rxq);=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_rx_que= ues; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gve_rx_queue_st= op(dev, i) !=3D 0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(WARNING, "Fail to stop Rx queue %d", i); +}
+
+void
+gve_set_rx_function(struct rte_eth_dev *dev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->rx_pkt_burst =3D gve_rx_burst;
=C2=A0}
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c index 1d6b21359c..236aefd2a8 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -333,11 +333,92 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint1= 6_t queue_id,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return err;
=C2=A0}

+static int
+gve_rxq_mbufs_alloc_dqo(struct gve_rx_queue *rxq)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct rte_mbuf *nmb;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t i;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int diag;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0diag =3D rte_pktmbuf_alloc_bulk(rxq->mpool, = &rxq->sw_ring[0], rxq->nb_rx_desc);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (diag < 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->stats.no_mb= ufs_bulk++;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i <= ; rxq->nb_rx_desc - 1; i++) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0nmb =3D rte_pktmbuf_alloc(rxq->mpool);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (!nmb)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->sw_ring[i] =3D nmb;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i < rxq->= nb_rx_desc - 1) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0rxq->stats.no_mbufs +=3D rxq->nb_rx_desc - 1 - i;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return -ENOMEM;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < rxq->nb_rx_desc; i++) {=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (i =3D=3D rxq-&g= t;nb_rx_desc - 1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0break;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0nmb =3D rxq->sw_= ring[i];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->rx_ring[i].= buf_addr =3D rte_cpu_to_le_64(rte_mbuf_data_iova_default(nmb));
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->rx_ring[i].= buf_id =3D rte_cpu_to_le_16(i);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->nb_rx_hold =3D 0;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->bufq_tail =3D rxq->nb_rx_desc - 1; +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rxq->bufq_tail, rxq->qrx_tail= );
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_priv *hw =3D dev->data->dev_pr= ivate;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rx_queue_id >=3D dev->data->nb_rx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->data->rx_queues[rx_queue_id]= ;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq->qrx_tail =3D &hw->db_bar2[rte_be= _to_cpu_32(rxq->qres->db_index)];
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), rxq= ->ntfy_addr);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D gve_rxq_mbufs_alloc_dqo(rxq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret !=3D 0) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PMD_DRV_LOG(ERR, &q= uot;Failed to alloc Rx queue mbuf");
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[rx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STARTED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (rx_queue_id >=3D dev->data->nb_rx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->data->rx_queues[rx_queue_id]= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_rxq_mbufs_dqo(rxq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_rxq_dqo(rxq);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[rx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STOPPED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
=C2=A0void
=C2=A0gve_stop_rx_queues_dqo(struct rte_eth_dev *dev)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct gve_priv *hw =3D dev->data->dev_pr= ivate;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_rx_queue *rxq;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t i;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int err;

@@ -345,9 +426,13 @@ gve_stop_rx_queues_dqo(struct rte_eth_dev *dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (err !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMD_DRV_LOG(WARNING= , "failed to destroy rxqs");

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_rx_que= ues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxq =3D dev->dat= a->rx_queues[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_rxq_mbu= fs_dqo(rxq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_rxq_dqo(r= xq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_rx_que= ues; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gve_rx_queue_st= op_dqo(dev, i) !=3D 0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(WARNING, "Fail to stop Rx queue %d", i); +}
+
+void
+gve_set_rx_function_dqo(struct rte_eth_dev *dev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->rx_pkt_burst =3D gve_rx_burst_dqo;
=C2=A0}
diff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c
index 13dc807623..2e0d001109 100644
--- a/drivers/net/gve/gve_tx.c
+++ b/drivers/net/gve/gve_tx.c
@@ -664,11 +664,49 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t = queue_id, uint16_t nb_desc,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return err;
=C2=A0}

+int
+gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_priv *hw =3D dev->data->dev_pr= ivate;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (tx_queue_id >=3D dev->data->nb_tx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->data->tx_queues[tx_queue_id]= ;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_tail =3D &hw->db_bar2[rte_be= _to_cpu_32(txq->qres->db_index)];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_head =3D
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&hw->cnt_arr= ay[rte_be_to_cpu_32(txq->qres->counter_index)];
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), txq= ->ntfy_addr);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[tx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STARTED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (tx_queue_id >=3D dev->data->nb_tx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->data->tx_queues[tx_queue_id]= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_txq_mbufs(txq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_txq(txq);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->tx_queue_state[tx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STOPPED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
=C2=A0void
=C2=A0gve_stop_tx_queues(struct rte_eth_dev *dev)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct gve_priv *hw =3D dev->data->dev_pr= ivate;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t i;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int err;

@@ -679,9 +717,13 @@ gve_stop_tx_queues(struct rte_eth_dev *dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (err !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMD_DRV_LOG(WARNING= , "failed to destroy txqs");

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_tx_que= ues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->dat= a->tx_queues[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_txq_mbu= fs(txq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_txq(txq);=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_tx_que= ues; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gve_tx_queue_st= op(dev, i) !=3D 0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(WARNING, "Fail to stop Tx queue %d", i); +}
+
+void
+gve_set_tx_function(struct rte_eth_dev *dev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->tx_pkt_burst =3D gve_tx_burst;
=C2=A0}
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c index b38eeaea4b..e0d144835b 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -373,11 +373,49 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint1= 6_t queue_id,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return err;
=C2=A0}

+int
+gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_priv *hw =3D dev->data->dev_pr= ivate;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (tx_queue_id >=3D dev->data->nb_tx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->data->tx_queues[tx_queue_id]= ;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_tail =3D &hw->db_bar2[rte_be= _to_cpu_32(txq->qres->db_index)];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq->qtx_head =3D
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&hw->cnt_arr= ay[rte_be_to_cpu_32(txq->qres->counter_index)];
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0rte_write32(rte_cpu_to_be_32(GVE_IRQ_MASK), txq= ->ntfy_addr);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->rx_queue_state[tx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STARTED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
+int
+gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (tx_queue_id >=3D dev->data->nb_tx_= queues)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->data->tx_queues[tx_queue_id]= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_txq_mbufs_dqo(txq);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_txq_dqo(txq);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->tx_queue_state[tx_queue_id] = =3D RTE_ETH_QUEUE_STATE_STOPPED;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
=C2=A0void
=C2=A0gve_stop_tx_queues_dqo(struct rte_eth_dev *dev)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct gve_priv *hw =3D dev->data->dev_pr= ivate;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t i;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int err;

@@ -385,9 +423,13 @@ gve_stop_tx_queues_dqo(struct rte_eth_dev *dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (err !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMD_DRV_LOG(WARNING= , "failed to destroy txqs");

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_tx_que= ues; i++) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txq =3D dev->dat= a->tx_queues[i];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_release_txq_mbu= fs_dqo(txq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gve_reset_txq_dqo(t= xq);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i < dev->data->nb_tx_que= ues; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (gve_tx_queue_st= op_dqo(dev, i) !=3D 0)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0PMD_DRV_LOG(WARNING, "Fail to stop Tx queue %d", i); +}
+
+void
+gve_set_tx_function_dqo(struct rte_eth_dev *dev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev->tx_pkt_burst =3D gve_tx_burst_dqo;
=C2=A0}
--
2.34.1

--0000000000003e049f05fbc14d6b--