public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Jasper Tran O'Leary" <jtranoleary@google.com>
Cc: dev@dpdk.org, Joshua Washington <joshwash@google.com>
Subject: Re: [PATCH v2] net/gve: add reset path
Date: Wed, 21 Jan 2026 12:58:12 -0800	[thread overview]
Message-ID: <20260121125812.277dbacf@phoenix.local> (raw)
In-Reply-To: <20260121193018.2728602-1-jtranoleary@google.com>

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.

  reply	other threads:[~2026-01-21 20:58 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 [this message]
2026-01-21 22:00 ` [PATCH v3] " Jasper Tran O'Leary
2026-01-22  0:58   ` 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=20260121125812.277dbacf@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=joshwash@google.com \
    --cc=jtranoleary@google.com \
    /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