DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Pattan, Reshma" <reshma.pattan@intel.com>
To: "Horton, Remy" <remy.horton@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v12 1/6] lib: add information metrics library
Date: Tue, 28 Mar 2017 14:14:18 +0000	[thread overview]
Message-ID: <3AEA2BF9852C6F48A459DA490692831F0112D6FE@irsmsx110.ger.corp.intel.com> (raw)
In-Reply-To: <1490646097-27803-2-git-send-email-remy.horton@intel.com>

Hi,

Few nits below.

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton
> Sent: Monday, March 27, 2017 9:22 PM
> To: dev@dpdk.org
> Cc: Thomas Monjalon <thomas.monjalon@6wind.com>
> Subject: [dpdk-dev] [PATCH v12 1/6] lib: add information metrics library
> 
> diff --git a/doc/guides/rel_notes/release_17_02.rst
> b/doc/guides/rel_notes/release_17_02.rst
> index 357965a..8bd706f 100644
> --- a/doc/guides/rel_notes/release_17_02.rst
> +++ b/doc/guides/rel_notes/release_17_02.rst
> @@ -368,6 +368,7 @@ The libraries prepended with a plus sign were
> incremented in this version.
>       librte_mbuf.so.2
>       librte_mempool.so.2
>       librte_meter.so.1
> +   + librte_metrics.so.1

This change should go in release_17_05.rst. 

> a/lib/librte_metrics/Makefile b/lib/librte_metrics/Makefile new file mode
> 100644 index 0000000..8d6e23a
> --- /dev/null
> +++ b/lib/librte_metrics/Makefile
> @@ -0,0 +1,51 @@
> +#   BSD LICENSE
> +#
> +#   Copyright(c) 2016 Intel Corporation. All rights reserved.
> +#   All rights reserved.
> +#

Year 2017, and same for some other files too.

> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_metrics.a
> +
> +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)

How about adding -O3 to flags?

>int
>rte_metrics_update_values(int port_id,
>	uint16_t key,
>	const uint64_t *values,
>	uint32_t count)
>{

How about adding Null check of values .

> +int
> +rte_metrics_get_names(struct rte_metric_name *names,
> +	uint16_t capacity)
> +{
> +	struct rte_metrics_data_s *stats;
> +	const struct rte_memzone *memzone;
> +	uint16_t idx_name;
> +	int return_value;
> +
> +	memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
> +	/* If not allocated, fail silently */
> +	if (memzone == NULL)
> +		return 0;
> +
> +	stats = memzone->addr;
> +	rte_spinlock_lock(&stats->lock);
> +	if (names != NULL) {

You can check names == NULL at memzone check and return instead of doing that inside lock?

> +
> +int
> +rte_metrics_get_values(int port_id,
> +	struct rte_metric_value *values,
> +	uint16_t capacity)
> +{
> +	struct rte_metrics_meta_s *entry;
> +	struct rte_metrics_data_s *stats;
> +	const struct rte_memzone *memzone;
> +	uint16_t idx_name;
> +	int return_value;
> +
> +	if (port_id != RTE_METRICS_GLOBAL &&
> +			(port_id < 0 || port_id > RTE_MAX_ETHPORTS))
> +		return -EINVAL;
> +
> +	memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
> +	/* If not allocated, fail silently */
> +	if (memzone == NULL)
> +		return 0;
> +	stats = memzone->addr;
> +	rte_spinlock_lock(&stats->lock);
> +
> +	if (values != NULL) {

Can we have values == NULL check  along with memzone and return? Then remove this if check here?

> + *  - -ENOMEM: Error, maximum metrics reached  */ int
> +rte_metrics_reg_name(const char *name);
> +
> +/**
> + * Register a set of metrics.
> + *
> + * This is a bulk version of rte_metrics_reg_metrics() and aside from

Is that rte_metrics_reg_name().

> + *
> + * @return
> + *   - -ERANGE if count exceeds metric set size
> + *   - -EIO if upable to access shared metrics memory

Typo unable

Thanks,
Reshma

  reply	other threads:[~2017-03-28 14:14 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 20:21 [dpdk-dev] [PATCH v12 0/6] Expanded statistics reporting Remy Horton
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 1/6] lib: add information metrics library Remy Horton
2017-03-28 14:14   ` Pattan, Reshma [this message]
2017-03-28 15:00     ` Remy Horton
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 2/6] app/proc_info: add metrics displaying Remy Horton
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 3/6] lib: add bitrate statistics library Remy Horton
2017-03-28 15:30   ` Pattan, Reshma
2017-03-28 15:45     ` Remy Horton
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 4/6] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-03-28 15:49   ` Pattan, Reshma
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 5/6] lib: added new library for latency stats Remy Horton
2017-03-27 20:21 ` [dpdk-dev] [PATCH v12 6/6] app/test-pmd: add latency statistics calculation Remy Horton
2017-03-27 21:03 ` [dpdk-dev] [PATCH v12 0/6] Expanded statistics reporting Stephen Hemminger
2017-03-28 11:21   ` Mcnamara, John
2017-03-29 18:28 ` [dpdk-dev] [PATCH v13 " Remy Horton
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 1/6] lib: add information metrics library Remy Horton
2017-03-30 10:01     ` Pattan, Reshma
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 2/6] app/proc_info: add metrics displaying Remy Horton
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 3/6] lib: add bitrate statistics library Remy Horton
2017-03-30 10:04     ` Pattan, Reshma
2017-03-30 10:08     ` Pattan, Reshma
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 4/6] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 5/6] lib: added new library for latency stats Remy Horton
2017-03-29 18:28   ` [dpdk-dev] [PATCH v13 6/6] app/test-pmd: add latency statistics calculation Remy Horton
2017-03-30 10:22     ` Pattan, Reshma
2017-03-30 13:18   ` [dpdk-dev] [PATCH v13 0/6] Expanded statistics reporting Pattan, Reshma
2017-03-30 21:00   ` [dpdk-dev] [PATCH v14 " Remy Horton
2017-03-30 21:00     ` [dpdk-dev] [PATCH v14 1/6] lib: add information metrics library Remy Horton
2017-04-05 13:39       ` Thomas Monjalon
2017-04-05 14:46         ` Remy Horton
2017-04-05 15:06           ` Thomas Monjalon
2017-04-05 15:16             ` Remy Horton
2017-04-05 15:23               ` Thomas Monjalon
2017-03-30 21:00     ` [dpdk-dev] [PATCH v14 2/6] app/proc_info: add metrics displaying Remy Horton
2017-03-30 21:00     ` [dpdk-dev] [PATCH v14 3/6] lib: add bitrate statistics library Remy Horton
2017-03-30 21:01     ` [dpdk-dev] [PATCH v14 4/6] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-03-30 21:01     ` [dpdk-dev] [PATCH v14 5/6] lib: added new library for latency stats Remy Horton
2017-04-05 14:24       ` Thomas Monjalon
2017-04-05 14:34         ` Remy Horton
2017-03-30 21:01     ` [dpdk-dev] [PATCH v14 6/6] app/test-pmd: add latency statistics calculation Remy Horton
2017-04-05 16:01     ` [dpdk-dev] [PATCH v14 0/6] Expanded statistics reporting Thomas Monjalon

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=3AEA2BF9852C6F48A459DA490692831F0112D6FE@irsmsx110.ger.corp.intel.com \
    --to=reshma.pattan@intel.com \
    --cc=dev@dpdk.org \
    --cc=remy.horton@intel.com \
    --cc=thomas.monjalon@6wind.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;
as well as URLs for NNTP newsgroup(s).