* [PATCH v2] net/gve: add reset path
@ 2026-01-21 19:30 Jasper Tran O'Leary
2026-01-21 20:58 ` Stephen Hemminger
2026-01-21 22:00 ` [PATCH v3] " Jasper Tran O'Leary
0 siblings, 2 replies; 4+ messages in thread
From: Jasper Tran O'Leary @ 2026-01-21 19:30 UTC (permalink / raw)
To: stephen; +Cc: dev, Jasper Tran O'Leary, Joshua Washington
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>
---
doc/guides/nics/gve.rst | 10 ++++-
doc/guides/rel_notes/release_26_03.rst | 3 ++
drivers/net/gve/gve_ethdev.c | 40 ++++++++++++++++++++
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, 60 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/gve.rst b/doc/guides/nics/gve.rst
index 2a6798d..415d060 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,11 @@ 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. The device must be stopped prior to calling the reset
+function. It is the application's responsibility to reinitialize the device
+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..b280382 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,42 @@ 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;
+ }
+
+ if (dev->data->dev_started) {
+ PMD_DRV_LOG(ERR,
+ "Must stop device on port %u before reset.",
+ dev->data->port_id);
+ return -EBUSY;
+ }
+
+ /* 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 +1106,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 +1133,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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] net/gve: add reset path
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 ` [PATCH v3] " Jasper Tran O'Leary
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2026-01-21 20:58 UTC (permalink / raw)
To: Jasper Tran O'Leary; +Cc: dev, Joshua Washington
On Wed, 21 Jan 2026 19:30:18 +0000
"Jasper Tran O'Leary" <jtranoleary@google.com> wrote:
> +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;
> + }
> +
> + if (dev->data->dev_started) {
> + PMD_DRV_LOG(ERR,
> + "Must stop device on port %u before reset.",
> + dev->data->port_id);
> + return -EBUSY;
> + }
That check is not necessary, because rte_eth_dev_reset always does stop:
int
rte_eth_dev_reset(uint16_t port_id)
{
struct rte_eth_dev *dev;
int ret;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
if (dev->dev_ops->dev_reset == NULL)
return -ENOTSUP;
ret = rte_eth_dev_stop(port_id);
if (ret != 0) {
RTE_ETHDEV_LOG_LINE(ERR,
"Failed to stop device (port %u) before reset: %s - ignore",
port_id, rte_strerror(-ret));
}
ret = eth_err(port_id, dev->dev_ops->dev_reset(dev));
rte_ethdev_trace_reset(port_id, ret);
return ret;
}
And therefore the documentation should be updated as well.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3] net/gve: add reset path
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
2026-01-22 0:58 ` Stephen Hemminger
1 sibling, 1 reply; 4+ messages in thread
From: Jasper Tran O'Leary @ 2026-01-21 22:00 UTC (permalink / raw)
To: stephen; +Cc: dev, Jasper Tran O'Leary, Joshua Washington
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3] net/gve: add reset path
2026-01-21 22:00 ` [PATCH v3] " Jasper Tran O'Leary
@ 2026-01-22 0:58 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2026-01-22 0:58 UTC (permalink / raw)
To: Jasper Tran O'Leary; +Cc: dev, Joshua Washington
On Wed, 21 Jan 2026 22:00:35 +0000
"Jasper Tran O'Leary" <jtranoleary@google.com> wrote:
> 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>
> ---
Thanks, updated to this version in next-net
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-22 0:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v3] " Jasper Tran O'Leary
2026-01-22 0:58 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox