[v2] net/gve: Fix TX/RX queue setup and stop

Message ID 1721914264-2394611-1-git-send-email-tathagat.dpdk@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/gve: Fix TX/RX queue setup and stop |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Tathagat Priyadarshi July 25, 2024, 1:31 p.m. UTC
The PR aims to update the TX/RQ queue setup/stop routines that are
unique to DQO, so that they may be called for instances that use the
DQO RDA format during dev start/stop

Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
---
 drivers/net/gve/gve_ethdev.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
  

Comments

Tathagat Priyadarshi July 26, 2024, 10:37 a.m. UTC | #1
Hi @Ferruh Yigit <ferruh.yigit@amd.com>

I have updated v2
https://patches.dpdk.org/project/dpdk/patch/1721914264-2394611-1-git-send-email-tathagat.dpdk@gmail.com/
and sent it in reply to the previous message id (
https://patches.dpdk.org/project/dpdk/patch/1721828129-2393364-1-git-send-email-tathagat.dpdk@gmail.com/)
, let me know if this is fine.



On Thu, Jul 25, 2024 at 6:59 PM Tathagat Priyadarshi <
tathagat.dpdk@gmail.com> wrote:

> The PR aims to update the TX/RQ queue setup/stop routines that are
> unique to DQO, so that they may be called for instances that use the
> DQO RDA format during dev start/stop
>
> Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
> ---
>  drivers/net/gve/gve_ethdev.c | 29 +++++++++++++++++++++++------
>  1 file changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
> index ca92277..a20092e 100644
> --- a/drivers/net/gve/gve_ethdev.c
> +++ b/drivers/net/gve/gve_ethdev.c
> @@ -288,11 +288,16 @@ struct gve_queue_page_list *
>                 PMD_DRV_LOG(ERR, "Failed to create %u tx queues.",
> num_queues);
>                 return ret;
>         }
> -       for (i = 0; i < num_queues; i++)
> -               if (gve_tx_queue_start(dev, i) != 0) {
> +       for (i = 0; i < num_queues; i++) {
> +               if (gve_is_gqi(priv))
> +                       ret = gve_tx_queue_start(dev, i);
> +               else
> +                       ret = gve_tx_queue_start_dqo(dev, i);
> +               if (ret != 0) {
>                         PMD_DRV_LOG(ERR, "Fail to start Tx queue %d", i);
>                         goto err_tx;
>                 }
> +       }
>
>         num_queues = dev->data->nb_rx_queues;
>         priv->rxqs = (struct gve_rx_queue **)dev->data->rx_queues;
> @@ -315,9 +320,15 @@ struct gve_queue_page_list *
>         return 0;
>
>  err_rx:
> -       gve_stop_rx_queues(dev);
> +       if (gve_is_gqi(priv))
> +               gve_stop_rx_queues(dev);
> +       else
> +               gve_stop_rx_queues_dqo(dev);
>  err_tx:
> -       gve_stop_tx_queues(dev);
> +       if (gve_is_gqi(priv))
> +               gve_stop_tx_queues(dev);
> +       else
> +               gve_stop_tx_queues_dqo(dev);
>         return ret;
>  }
>
> @@ -362,10 +373,16 @@ struct gve_queue_page_list *
>  static int
>  gve_dev_stop(struct rte_eth_dev *dev)
>  {
> +       struct gve_priv *priv = dev->data->dev_private;
>         dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
>
> -       gve_stop_tx_queues(dev);
> -       gve_stop_rx_queues(dev);
> +       if (gve_is_gqi(priv)) {
> +               gve_stop_tx_queues(dev);
> +               gve_stop_rx_queues(dev);
> +       } else {
> +               gve_stop_tx_queues_dqo(dev);
> +               gve_stop_rx_queues_dqo(dev);
> +       }
>
>         dev->data->dev_started = 0;
>
> --
> 1.8.3.1
>
>
  
Ferruh Yigit July 26, 2024, 11:33 a.m. UTC | #2
On 7/26/2024 11:37 AM, Tathagat Priyadarshi wrote:
> Hi @Ferruh Yigit <mailto:ferruh.yigit@amd.com> 
> 
> I have updated v2 https://patches.dpdk.org/project/dpdk/
> patch/1721914264-2394611-1-git-send-email-tathagat.dpdk@gmail.com/
> <https://patches.dpdk.org/project/dpdk/patch/1721914264-2394611-1-git-
> send-email-tathagat.dpdk@gmail.com/>
> and sent it in reply to the previous message id (https://
> patches.dpdk.org/project/dpdk/patch/1721828129-2393364-1-git-send-email-
> tathagat.dpdk@gmail.com/ <https://patches.dpdk.org/project/dpdk/
> patch/1721828129-2393364-1-git-send-email-tathagat.dpdk@gmail.com/
>>) , let me know if this is fine. 
> 
> 

Looks good, thanks.

I will wait for Joshua's ack.
  
Joshua Washington July 29, 2024, 6:10 p.m. UTC | #3
Acked-by: Joshua Washington <joshwash@google.com>
  
Ferruh Yigit July 30, 2024, 11:26 a.m. UTC | #4
On 7/26/2024 12:33 PM, Ferruh Yigit wrote:
> On 7/26/2024 11:37 AM, Tathagat Priyadarshi wrote:
>> Hi @Ferruh Yigit <mailto:ferruh.yigit@amd.com> 
>>
>> I have updated v2 https://patches.dpdk.org/project/dpdk/
>> patch/1721914264-2394611-1-git-send-email-tathagat.dpdk@gmail.com/
>> <https://patches.dpdk.org/project/dpdk/patch/1721914264-2394611-1-git-
>> send-email-tathagat.dpdk@gmail.com/>
>> and sent it in reply to the previous message id (https://
>> patches.dpdk.org/project/dpdk/patch/1721828129-2393364-1-git-send-email-
>> tathagat.dpdk@gmail.com/ <https://patches.dpdk.org/project/dpdk/
>> patch/1721828129-2393364-1-git-send-email-tathagat.dpdk@gmail.com/
>>> ) , let me know if this is fine. 
>>
>>
> 
> Looks good, thanks.
> 
> I will wait for Joshua's ack.
> 

Hi Tathagat, Joshua,

Can you please provide the fixes tag?
  

Patch

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index ca92277..a20092e 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -288,11 +288,16 @@  struct gve_queue_page_list *
 		PMD_DRV_LOG(ERR, "Failed to create %u tx queues.", num_queues);
 		return ret;
 	}
-	for (i = 0; i < num_queues; i++)
-		if (gve_tx_queue_start(dev, i) != 0) {
+	for (i = 0; i < num_queues; i++) {
+		if (gve_is_gqi(priv))
+			ret = gve_tx_queue_start(dev, i);
+		else
+			ret = gve_tx_queue_start_dqo(dev, i);
+		if (ret != 0) {
 			PMD_DRV_LOG(ERR, "Fail to start Tx queue %d", i);
 			goto err_tx;
 		}
+	}
 
 	num_queues = dev->data->nb_rx_queues;
 	priv->rxqs = (struct gve_rx_queue **)dev->data->rx_queues;
@@ -315,9 +320,15 @@  struct gve_queue_page_list *
 	return 0;
 
 err_rx:
-	gve_stop_rx_queues(dev);
+	if (gve_is_gqi(priv))
+		gve_stop_rx_queues(dev);
+	else
+		gve_stop_rx_queues_dqo(dev);
 err_tx:
-	gve_stop_tx_queues(dev);
+	if (gve_is_gqi(priv))
+		gve_stop_tx_queues(dev);
+	else
+		gve_stop_tx_queues_dqo(dev);
 	return ret;
 }
 
@@ -362,10 +373,16 @@  struct gve_queue_page_list *
 static int
 gve_dev_stop(struct rte_eth_dev *dev)
 {
+	struct gve_priv *priv = dev->data->dev_private;
 	dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
 
-	gve_stop_tx_queues(dev);
-	gve_stop_rx_queues(dev);
+	if (gve_is_gqi(priv)) {
+		gve_stop_tx_queues(dev);
+		gve_stop_rx_queues(dev);
+	} else {
+		gve_stop_tx_queues_dqo(dev);
+		gve_stop_rx_queues_dqo(dev);
+	}
 
 	dev->data->dev_started = 0;