From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39A7BA04B2 for ; Tue, 25 Aug 2020 15:14:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D4D62B94; Tue, 25 Aug 2020 15:14:32 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 763E6255; Tue, 25 Aug 2020 15:14:28 +0200 (CEST) IronPort-SDR: LI6SFoGX2qToZnc+A4Wvy6FRofyurgwUSQ9/iuRmsL5AQZ6u0bJnlpAfjH1lWhkHGOpZm7+WOG 55hn6UCiI02w== X-IronPort-AV: E=McAfee;i="6000,8403,9723"; a="135649091" X-IronPort-AV: E=Sophos;i="5.76,352,1592895600"; d="scan'208";a="135649091" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2020 06:14:27 -0700 IronPort-SDR: FeP9mFg0OMLrzceN6+oyITOiKjmp5gb6ny8CPZxlThy6tFIaIVfnSvu1QOLOmHs0xcwyaMZrWL gRRcobq1xGbw== X-IronPort-AV: E=Sophos;i="5.76,352,1592895600"; d="scan'208";a="474340758" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.1.150]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 25 Aug 2020 06:14:25 -0700 Date: Tue, 25 Aug 2020 14:14:21 +0100 From: Bruce Richardson To: Ciara Power Cc: dev@dpdk.org, stable@dpdk.org, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Nipun Gupta , Hemant Agrawal , Kevin Laatz , Keith Wiles Message-ID: <20200825131421.GC554@bricha3-MOBL.ger.corp.intel.com> References: <20200825120133.44316-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825120133.44316-1-ciara.power@intel.com> Subject: Re: [dpdk-stable] [PATCH] lib/telemetry: fix passing full params string to command X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 > --- > 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."