[PATCH v2] net/gve: add reset path

Stephen Hemminger stephen at networkplumber.org
Wed Jan 21 21:58:12 CET 2026


On Wed, 21 Jan 2026 19:30:18 +0000
"Jasper Tran O'Leary" <jtranoleary at 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.


More information about the dev mailing list