From: Bruce Richardson <bruce.richardson@intel.com>
To: Ciara Loftus <ciara.loftus@intel.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH v3 2/2] net/iavf: add restore command to testpmd
Date: Fri, 10 Oct 2025 17:36:18 +0100 [thread overview]
Message-ID: <aOk2AsqVlJ1q90EM@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20251009102835.926479-2-ciara.loftus@intel.com>
On Thu, Oct 09, 2025 at 10:28:35AM +0000, Ciara Loftus wrote:
> This patch adds an IAVF testpmd command "port restore <port_id>" which
> will send a request to the PF to reset the given VF, followed by the
> VF then reinitialising and restarting itself.
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> drivers/net/intel/iavf/iavf_testpmd.c | 52 +++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/drivers/net/intel/iavf/iavf_testpmd.c b/drivers/net/intel/iavf/iavf_testpmd.c
> index 775179fc01..2432e015b3 100644
> --- a/drivers/net/intel/iavf/iavf_testpmd.c
> +++ b/drivers/net/intel/iavf/iavf_testpmd.c
> @@ -69,6 +69,52 @@ static cmdline_parse_inst_t cmd_enable_tx_lldp = {
> },
> };
>
> +struct cmd_restore_result {
> + cmdline_fixed_string_t port;
> + cmdline_fixed_string_t restore;
> + portid_t port_id;
> +};
> +
> +static cmdline_parse_token_string_t cmd_restore_port =
> + TOKEN_STRING_INITIALIZER(struct cmd_restore_result,
> + port, "port");
> +static cmdline_parse_token_string_t cmd_restore_restore =
> + TOKEN_STRING_INITIALIZER(struct cmd_restore_result,
> + restore, "restore");
> +static cmdline_parse_token_num_t cmd_restore_port_id =
> + TOKEN_NUM_INITIALIZER(struct cmd_restore_result,
> + port_id, RTE_UINT16);
> +
> +static void
> +cmd_restore_parsed(void *parsed_result,
> + __rte_unused struct cmdline *cl, __rte_unused void *data)
> +{
> + struct cmd_restore_result *res = parsed_result;
> + int ret;
> +
> + if (port_id_is_invalid(res->port_id, ENABLED_WARN))
> + return;
> +
> + ret = rte_pmd_iavf_restore(res->port_id);
> + if (ret < 0)
> + fprintf(stderr, "Request to restore VF failed for port %u: %s\n",
> + res->port_id, rte_strerror(-ret));
> + else
> + printf("VF restore requested for port %u\n", res->port_id);
> +}
> +
> +static cmdline_parse_inst_t cmd_restore = {
> + .f = cmd_restore_parsed,
> + .data = NULL,
> + .help_str = "port restore <port_id>",
> + .tokens = {
> + (void *)&cmd_restore_port,
> + (void *)&cmd_restore_restore,
> + (void *)&cmd_restore_port_id,
> + NULL,
> + },
> +};
> +
> static struct testpmd_driver_commands iavf_cmds = {
> .commands = {
> {
> @@ -76,7 +122,13 @@ static struct testpmd_driver_commands iavf_cmds = {
> "set tx lldp (on|off)\n"
> " Set iavf Tx lldp packet(currently only supported on)\n\n",
> },
> + {
> + &cmd_restore,
> + "port restore (port_id)\n"
> + " Send a request to the PF to reset the VF, then restore the port\n\n",
> + },
> { NULL, NULL },
> },
Same comment on naming as with previous patch. Otherwise LGTM.
/Bruce
next prev parent reply other threads:[~2025-10-10 16:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 14:30 [PATCH 1/2] net/iavf: support VF initiated resets Ciara Loftus
2025-09-29 14:30 ` [PATCH 2/2] net/iavf: add reset VF command to testpmd Ciara Loftus
2025-09-30 9:07 ` [PATCH 1/2] net/iavf: support VF initiated resets Bruce Richardson
2025-09-30 12:30 ` Stephen Hemminger
2025-10-01 8:37 ` Loftus, Ciara
2025-10-03 10:29 ` Loftus, Ciara
2025-10-08 10:13 ` Thomas Monjalon
2025-10-09 10:30 ` Loftus, Ciara
2025-10-09 14:58 ` Thomas Monjalon
2025-10-10 13:48 ` Loftus, Ciara
2025-10-03 10:23 ` [PATCH v2 " Ciara Loftus
2025-10-03 10:23 ` [PATCH v2 2/2] net/iavf: add restore command to testpmd Ciara Loftus
2025-10-09 10:28 ` [PATCH v3 1/2] net/iavf: support VF initiated resets Ciara Loftus
2025-10-09 10:28 ` [PATCH v3 2/2] net/iavf: add restore command to testpmd Ciara Loftus
2025-10-10 16:36 ` Bruce Richardson [this message]
2025-10-10 16:29 ` [PATCH v3 1/2] net/iavf: support VF initiated resets Bruce Richardson
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=aOk2AsqVlJ1q90EM@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=ciara.loftus@intel.com \
--cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).