[PATCH v4 2/4] app/testpmd: explicitly set command echoing on file load

Thomas Monjalon thomas at monjalon.net
Wed Oct 15 14:45:55 CEST 2025


31/07/2025 18:00, Bruce Richardson:
> The echoing of commands contained in a file loaded via the "load"
> command on testpmd CLI is governed by whether or not a cmdline-file or
> cmdline-file-noecho had been passed to testpmd on the commandline.
> 
> Remove the use of a global setting for this, and explicitly add a
> "load_echo" command to match the "load" command.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
[...]
> @@ -11646,7 +11646,9 @@ cmd_load_from_file_parsed(
>  {
>  	struct cmd_cmdfile_result *res = parsed_result;
>  
> -	cmdline_read_from_file(res->filename);
> +	if (cmdline_read_from_file(res->filename, false) != 0) {
> +		fprintf(stderr, "Failed to load commands from file: %s\n", res->filename);
> +	}
>  }
> +static void
> +cmd_load_echo_file_parsed(
> +	void *parsed_result,
> +	__rte_unused struct cmdline *cl,
> +	__rte_unused void *data)
> +{
> +	struct cmd_load_echo_result *res = parsed_result;
> +
> +	if (cmdline_read_from_file(res->filename, true) != 0)
> +		fprintf(stderr, "Failed to load commands from file: %s\n", res->filename);
> +}

These 2 functions cmd_load_from_file_parsed()
and cmd_load_echo_file_parsed() could be merged
in a single function by passing the echo boolean as callback data.




More information about the dev mailing list