From: "Jasper Tran O'Leary" <jtranoleary@google.com>
To: stephen@networkplumber.org
Cc: dev@dpdk.org, "Jasper Tran O'Leary" <jtranoleary@google.com>,
Joshua Washington <joshwash@google.com>
Subject: [PATCH v3] net/gve: add reset path
Date: Wed, 21 Jan 2026 22:00:35 +0000 [thread overview]
Message-ID: <20260121220035.3090402-1-jtranoleary@google.com> (raw)
In-Reply-To: <20260121193018.2728602-1-jtranoleary@google.com>
Currently, the driver does not include any reset functionality and hence
cannot be reset by the application. This patch introduces a driver
callback for the `rte_eth_dev_reset` function will which reset the
device.
Also, as a precaution, null out device pointers to rx and tx queue
arrays when we release the queues during a reset.
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
---
v3:
* Remove unnecessary check that device is stopped, update documentation
accordingly.
v2:
* Remove unnecessary variable initialization.
* Document reset feature and add to release notes.
doc/guides/nics/gve.rst | 9 ++++++-
doc/guides/rel_notes/release_26_03.rst | 3 +++
drivers/net/gve/gve_ethdev.c | 33 +++++++++++++++++++++++++
drivers/net/gve/gve_rx.c | 2 ++
drivers/net/gve/gve_rx_dqo.c | 2 ++
drivers/net/gve/gve_tx.c | 2 ++
drivers/net/gve/gve_tx_dqo.c | 2 ++
7 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/gve.rst b/doc/guides/nics/gve.rst
index 2a6798d..6b4d1f7 100644
--- a/doc/guides/nics/gve.rst
+++ b/doc/guides/nics/gve.rst
@@ -34,7 +34,7 @@ to find the original base code.
GVE has 3 queue formats:
- GQI_QPL - GQI with queue page list
-- GQI_RDA - GQI with raw DMA addressing
+- GQI_RDA - GQI with raw DMA addressing (deprecated)
- DQO_RDA - DQO with raw DMA addressing
GQI_QPL queue format is queue page list mode.
@@ -102,3 +102,10 @@ Because the initial RSS hash creates a default redirection table,
the redirection table will be available for querying upon initial hash configuration.
When performing redirection table updates,
it is possible to update individual table entries.
+
+Application-Initiated Reset
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The driver allows an application to reset the gVNIC device. This function
+will tear down and reinitialize the device's resources, including queues and
+administrative queues. It is the application's responsibility to reinitialize
+and restart the device after resetting it.
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index add2251..fd0fc8e 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -55,6 +55,9 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Updated Google Virtual Ethernet (gve) ethernet driver.**
+
+ Added application-initiated device reset.
Removed Items
-------------
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 6341d89..5912fec 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -12,6 +12,8 @@
#include "gve_rss.h"
#include <ethdev_driver.h>
+static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device);
+
static void
gve_write_version(uint8_t *driver_version_register)
{
@@ -550,6 +552,35 @@ gve_dev_close(struct rte_eth_dev *dev)
return err;
}
+static int
+gve_dev_reset(struct rte_eth_dev *dev)
+{
+ struct gve_priv *priv = dev->data->dev_private;
+ int err;
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ PMD_DRV_LOG(ERR,
+ "Device reset on port %u not supported in secondary processes.",
+ dev->data->port_id);
+ return -EPERM;
+ }
+
+ /* Tear down all device resources before re-initializing. */
+ gve_free_queues(dev);
+ gve_teardown_device_resources(priv);
+ gve_adminq_free(priv);
+
+ err = gve_init_priv(priv, true);
+ if (err != 0) {
+ PMD_DRV_LOG(ERR,
+ "Failed to re-init device on port %u after reset.",
+ dev->data->port_id);
+ return err;
+ }
+
+ return 0;
+}
+
static int
gve_verify_driver_compatibility(struct gve_priv *priv)
{
@@ -1068,6 +1099,7 @@ static const struct eth_dev_ops gve_eth_dev_ops = {
.dev_start = gve_dev_start,
.dev_stop = gve_dev_stop,
.dev_close = gve_dev_close,
+ .dev_reset = gve_dev_reset,
.dev_infos_get = gve_dev_info_get,
.rx_queue_setup = gve_rx_queue_setup,
.tx_queue_setup = gve_tx_queue_setup,
@@ -1094,6 +1126,7 @@ static const struct eth_dev_ops gve_eth_dev_ops_dqo = {
.dev_start = gve_dev_start,
.dev_stop = gve_dev_stop,
.dev_close = gve_dev_close,
+ .dev_reset = gve_dev_reset,
.dev_infos_get = gve_dev_info_get,
.rx_queue_setup = gve_rx_queue_setup_dqo,
.tx_queue_setup = gve_tx_queue_setup_dqo,
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 7a91c31..625649c 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -290,6 +290,8 @@ gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
rte_memzone_free(q->qres_mz);
q->qres = NULL;
rte_free(q);
+
+ dev->data->rx_queues[qid] = NULL;
}
int
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index a0ef21b..3aa82b3 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -252,6 +252,8 @@ gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid)
rte_memzone_free(q->qres_mz);
q->qres = NULL;
rte_free(q);
+
+ dev->data->rx_queues[qid] = NULL;
}
static void
diff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c
index 015ea96..5c73c21 100644
--- a/drivers/net/gve/gve_tx.c
+++ b/drivers/net/gve/gve_tx.c
@@ -547,6 +547,8 @@ gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
rte_memzone_free(q->qres_mz);
q->qres = NULL;
rte_free(q);
+
+ dev->data->tx_queues[qid] = NULL;
}
int
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 64141ac..4c632d7 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -379,6 +379,8 @@ gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid)
rte_memzone_free(q->qres_mz);
q->qres = NULL;
rte_free(q);
+
+ dev->data->tx_queues[qid] = NULL;
}
static int
--
2.52.0.457.g6b5491de43-goog
next prev parent reply other threads:[~2026-01-21 22:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 19:30 [PATCH v2] net/gve: add reset path Jasper Tran O'Leary
2026-01-21 20:58 ` Stephen Hemminger
2026-01-21 22:00 ` Jasper Tran O'Leary [this message]
2026-01-22 0:58 ` [PATCH v3] " Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121220035.3090402-1-jtranoleary@google.com \
--to=jtranoleary@google.com \
--cc=dev@dpdk.org \
--cc=joshwash@google.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox