net/gve: Fix TX/RX queue setup and stop

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

Checks

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

Commit Message

Tathagat Priyadarshi July 24, 2024, 1:35 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>
Acked-by: Joshua Washington <joshwash@google.com>
---
 drivers/net/gve/gve_ethdev.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
  

Comments

Ferruh Yigit July 25, 2024, 12:38 p.m. UTC | #1
On 7/24/2024 2:35 PM, Tathagat Priyadarshi 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>
> Acked-by: Joshua Washington <joshwash@google.com>
>


Is this v3 ?

And I can see Joshua's ack, but I didn't see it explicitly, did you work
together in background for this?
  
Tathagat Priyadarshi July 25, 2024, 12:51 p.m. UTC | #2
Hi Ferruh,

It’s my mistake, there was a coding error in the first email and i did send
out v2, but it somehow didn't go through and i kept getting failure emails,
So i fixed and repushed it only to find out later that v2 was also updated.
So i had to defer the previous PR.

I have added Acked by Joshua, since the diff was originally shared with him
and he was okay with it.

Regards,
TP


On Thu, 25 Jul 2024 at 18:08, Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 7/24/2024 2:35 PM, Tathagat Priyadarshi 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>
> > Acked-by: Joshua Washington <joshwash@google.com>
> >
>
>
> Is this v3 ?
>
> And I can see Joshua's ack, but I didn't see it explicitly, did you work
> together in background for this?
>
  
Ferruh Yigit July 25, 2024, 1:09 p.m. UTC | #3
On 7/25/2024 1:51 PM, Tathagat Priyadarshi wrote:
> Hi Ferruh,
> 
> It’s my mistake, there was a coding error in the first email and i did
> send out v2, but it somehow didn't go through and i kept getting failure
> emails, So i fixed and repushed it only to find out later that v2 was
> also updated. So i had to defer the previous PR.
> 

So, this patch and v2 are same, if so lets continue with v2 one, as it
has proper versioning. Can you update patchwork accordingly?


btw, not really matters but PR is "Pull Request" and this is a
terminology mostly related to github based development. In mail list
based development we call it patch, or "patch series"/patchset (if
multiple patches are together).

> I have added Acked by Joshua, since the diff was originally shared with
> him and he was okay with it.
> 

Better to have this publicly, and explicitly so it is recorded.

@Joshua, if you are OK with patch, can you please ack/review?

> Regards,
> TP
> 
> 
> On Thu, 25 Jul 2024 at 18:08, Ferruh Yigit <ferruh.yigit@amd.com
> <mailto:ferruh.yigit@amd.com>> wrote:
> 
>     On 7/24/2024 2:35 PM, Tathagat Priyadarshi 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
>     <mailto:tathagat.dpdk@gmail.com>>
>     > Acked-by: Joshua Washington <joshwash@google.com
>     <mailto:joshwash@google.com>>
>     >
> 
> 
>     Is this v3 ?
> 
>     And I can see Joshua's ack, but I didn't see it explicitly, did you work
>     together in background for this?
>
  

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;