patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Ciara Power <ciara.power@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Nipun Gupta <nipun.gupta@nxp.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Kevin Laatz <kevin.laatz@intel.com>,
	Keith Wiles <keith.wiles@intel.com>
Subject: Re: [dpdk-stable] [PATCH] lib/telemetry: fix passing full params string to command
Date: Tue, 25 Aug 2020 14:14:21 +0100	[thread overview]
Message-ID: <20200825131421.GC554@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20200825120133.44316-1-ciara.power@intel.com>

On Tue, Aug 25, 2020 at 01:01:33PM +0100, Ciara Power wrote:
> Telemetry only passed the first param to the command handler if multiple
> were entered by the user, separated by commas. Telemetry is required to
> pass the full params string to the command, by splitting by a comma
> delimiter only once to remove the command part of the string. This will
> enable future commands to take multiple param values.
> 
> Fixes: b1ad0e124536 ("rawdev: add telemetry callbacks")
> Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
> Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
> Cc: bruce.richardson@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.c   | 10 ++++++++--
>  lib/librte_rawdev/rte_rawdev.c   |  5 ++++-
>  lib/librte_telemetry/telemetry.c |  2 +-
>  3 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 7858ad5f11..6ba09362db 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -5284,11 +5284,14 @@ handle_port_xstats(const char *cmd __rte_unused,
>  	struct rte_eth_xstat_name *xstat_names;
>  	int port_id, num_xstats;
>  	int i, ret;
> +	char *end_param;
>  
>  	if (params == NULL || strlen(params) == 0 || !isdigit(*params))
>  		return -1;
>  
> -	port_id = atoi(params);
> +	port_id = strtoul(params, &end_param, 0);
> +	if (*end_param != '\0')
> +		RTE_ETHDEV_LOG(NOTICE, "Extra params passed to telemetry command for ethdev xstats, first param in use");

The text is a bit long, so maybe you can put the string on it's own line.
Also, I'd change "params" to the full word "parameters", and remove "first
param in use". Maybe the word "ignoring" would substitute for the last
part, e.g.

"Extra parameters passed to ethdev telemetry command, ignoring."


      reply	other threads:[~2020-08-25 13:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 12:01 Ciara Power
2020-08-25 13:14 ` Bruce Richardson [this message]

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=20200825131421.GC554@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=keith.wiles@intel.com \
    --cc=kevin.laatz@intel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).