DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Remy Horton <remy.horton@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v9 1/7] lib: add information metrics library
Date: Mon, 30 Jan 2017 16:50:29 +0100	[thread overview]
Message-ID: <1659974.13GHXkxjEr@xps13> (raw)
In-Reply-To: <1484751943-22877-2-git-send-email-remy.horton@intel.com>

Hi Remy,

> This patch adds a new information metric library that allows other
> modules to register named metrics and update their values. It is
> intended to be independent of ethdev, rather than mixing ethdev
> and non-ethdev information in xstats.

I'm still not convinced by this library, and this introduction does
not help a lot.

I would like to thanks Harry for the review of this series.
If we had more opinions or enthousiasm about this patch, it would
be easier to accept this new library and assert it is the way to go.

It could be a matter of technical board discussion if we had a clear
explanation of the needs, the pros and cons of this design.

The overview for using this library should be given in the prog guide.


2017-01-18 15:05, Remy Horton:
> --- a/config/common_base
> +++ b/config/common_base
> @@ -593,3 +593,8 @@ CONFIG_RTE_APP_TEST_RESOURCE_TAR=n
>  CONFIG_RTE_TEST_PMD=y
>  CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES=n
>  CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS=n
> +
> +#
> +# Compile the device metrics library
> +#
> +CONFIG_RTE_LIBRTE_METRICS=y

I know the config file is not so well sorted.
However it would be a bit more logical below CONFIG_RTE_LIBRTE_JOBSTATS.

> diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> index 72d59b2..94f0f69 100644
> --- a/doc/api/doxy-api-index.md
> +++ b/doc/api/doxy-api-index.md
> @@ -150,4 +150,5 @@ There are many libraries, so their headers may be grouped by topics:
>    [common]             (@ref rte_common.h),
>    [ABI compat]         (@ref rte_compat.h),
>    [keepalive]          (@ref rte_keepalive.h),
> +  [Device Metrics]     (@ref rte_metrics.h),

No first letter uppercase in this list.

> --- a/doc/guides/rel_notes/release_17_02.rst
> +++ b/doc/guides/rel_notes/release_17_02.rst
> @@ -34,6 +34,12 @@ New Features
>  
>       Refer to the previous release notes for examples.
>  
> +   * **Added information metric library.**
> +
> +     A library that allows information metrics to be added and update. It is

update -> updated

added and updated by who?

> +     intended to provide a reporting mechanism that is independent of the
> +     ethdev library.

and independent of the cryptodev library?
Does it apply to other types of devices (cryptodev/eventdev)?

> +
>       This section is a comment. do not overwrite or remove it.
>       Also, make sure to start the actual text at the margin.
>       =========================================================

Your text should start below this line, and indented at the margin.

> @@ -205,6 +211,7 @@ The libraries prepended with a plus sign were incremented in this version.
>  .. code-block:: diff
>  
>       librte_acl.so.2
> +   + librte_bitratestats.so.1

not part of this patch

> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -58,6 +58,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_TABLE) += librte_table
>  DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += librte_pipeline
>  DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += librte_reorder
>  DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += librte_pdump
> +DIRS-$(CONFIG_RTE_LIBRTE_METRICS) += librte_metrics

insert it below librte_jobstats is a better choice

> --- /dev/null
> +++ b/lib/librte_metrics/rte_metrics.c
> +/**
> + * Internal stats metadata and value entry.
> + *
> + * @internal
> + * @param name
> + *   Name of metric
> + * @param value
> + *   Current value for metric
> + * @param idx_next_set
> + *   Index of next root element (zero for none)
> + * @param idx_next_metric
> + *   Index of next metric in set (zero for none)
> + *
> + * Only the root of each set needs idx_next_set but since it has to be
> + * assumed that number of sets could equal total number of metrics,
> + * having a separate set metadata table doesn't save any memory.
> + */
> +struct rte_metrics_meta_s {
> +	char name[RTE_METRICS_MAX_NAME_LEN];
> +	uint64_t value[RTE_MAX_ETHPORTS];
> +	uint64_t nonport_value;
> +	uint16_t idx_next_set;
> +	uint16_t idx_next_stat;
> +};

It would be a lot easier to read with comments near each field.
It would avoid to forget some fields like nonport_value in this struct.
You do not need to use a doxygen syntax in a .c file.

> --- /dev/null
> +++ b/lib/librte_metrics/rte_metrics.h
> +/**
> + * @file
> + *
> + * RTE Metrics module

RTE is not meaningful here.
Please prefer DPDK.

> + *
> + * Metric information is populated using a push model, where the
> + * information provider calls an update function on the relevant
> + * metrics. Currently only bulk querying of metrics is supported.
> + */

This description should explain who is a provider (drivers?) and who
is the reader (registered thread?).
What do you mean by "push model"? A callback is used?

> +/**
> + * Global (rather than port-specific) metric.

It does not say what kind of constant it is. A special metric id?

> + *
> + * When used instead of port number by rte_metrics_update_metric()
> + * or rte_metrics_update_metric(), the global metrics, which are
> + * not associated with any specific port, are updated.
> + */
> +#define RTE_METRICS_GLOBAL -1

I thought you agreed that "port" is not really a good wording.

> +/**
> + * A name-key lookup for metrics.
> + *
> + * An array of this structure is returned by rte_metrics_get_names().
> + * The struct rte_eth_stats references these names via their array index.

rte_eth_stats?

> + */
> +struct rte_metric_name {
> +	/** String describing metric */
> +	char name[RTE_METRICS_MAX_NAME_LEN];
> +};
[...]
> +/**
> + * Metric value structure.
> + *
> + * This structure is used by rte_metrics_get_values() to return metrics,
> + * which are statistics that are not generated by PMDs. It maps a name key,

Here we have a definition of what is a metric:
"statistics that are not generated by PMDs"
It could help in the introduction.

> + * which corresponds to an index in the array returned by
> + * rte_metrics_get_names().
> + */
> +struct rte_metric_value {
> +	/** Numeric identifier of metric. */
> +	uint16_t key;
> +	/** Value for metric */
> +	uint64_t value;
> +};
> +
> +
> +/**
> + * Initializes metric module. This function must be called from
> + * a primary process before metrics are used.

Why not integrating it in the global init?
Is there some performance drawbacks?

> + *
> + * @param socket_id
> + *   Socket to use for shared memory allocation.
> + */
> +void rte_metrics_init(int socket_id);
> +
> +/**
> + * Register a metric, making it available as a reporting parameter.
> + *
> + * Registering a metric is the way third-parties declare a parameter

third-party? You mean the provider?

> + * that they wish to be reported. Once registered, the associated
> + * numeric key can be obtained via rte_metrics_get_names(), which
> + * is required for updating said metric's value.
> + *
> + * @param name
> + *   Metric name
> + *
> + * @return
> + *  - Zero or positive: Success (index key of new metric)
> + *  - \b -EIO: Error, unable to access metrics shared memory
> + *    (rte_metrics_init() not called)
> + *  - \b -EINVAL: Error, invalid parameters
> + *  - \b -ENOMEM: Error, maximum metrics reached

Please, no extra formatting in doxygen.

> + */
> +int rte_metrics_reg_name(const char *name);
> +

  reply	other threads:[~2017-01-30 15:50 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 14:58 [dpdk-dev] [RFC PATCH v1] rte: add bit-rate metrics to xstats Remy Horton
2016-08-26 13:28 ` Pattan, Reshma
2016-08-29 10:01 ` Pattan, Reshma
2016-08-29 11:19   ` Remy Horton
2016-10-28  1:04 ` [dpdk-dev] [PATCH v2 0/3] expanded statistic reporting Remy Horton
2016-10-28  1:04   ` [dpdk-dev] [RFC PATCH v2 1/3] lib: add information metrics library Remy Horton
2016-10-28  1:04   ` [dpdk-dev] [RFC PATCH v2 2/3] lib: add bitrate statistics library Remy Horton
2016-10-28  1:12     ` Stephen Hemminger
2016-10-28  7:48       ` Remy Horton
2016-10-28  7:39     ` Morten Brørup
2016-11-01  1:53       ` Remy Horton
2016-10-28  1:04   ` [dpdk-dev] [RFC PATCH v2 3/3] app/test-pmd: add support for bitrate statistics Remy Horton
2016-11-04  3:36   ` [dpdk-dev] [PATCH v3 0/3] Expanded statistics reporting Remy Horton
2016-11-04  3:36     ` [dpdk-dev] [PATCH v3 1/3] lib: add information metrics library Remy Horton
2016-11-04 16:42       ` Pattan, Reshma
2016-11-07 15:25         ` Pattan, Reshma
2016-11-08  3:19           ` Remy Horton
2016-11-04  3:36     ` [dpdk-dev] [PATCH v3 2/3] lib: add bitrate statistics library Remy Horton
2016-11-04  3:36     ` [dpdk-dev] [PATCH v3 3/3] app/test-pmd: add support for bitrate statistics Remy Horton
2016-11-15  7:15     ` [dpdk-dev] [PATCH v4 0/3] Expanded statistics reporting Remy Horton
2016-11-15  7:15       ` [dpdk-dev] [PATCH v4 1/3] lib: add information metrics library Remy Horton
2016-11-15  7:15       ` [dpdk-dev] [PATCH v4 2/3] lib: add bitrate statistics library Remy Horton
2016-11-15 15:17         ` Pattan, Reshma
2016-11-15  7:15       ` [dpdk-dev] [PATCH v4 3/3] app/test-pmd: add support for bitrate statistics Remy Horton
2016-11-18  8:00       ` [dpdk-dev] [PATCH v5 0/4] Expanded statistics reporting Remy Horton
2016-11-18  8:00         ` [dpdk-dev] [PATCH v5 1/4] lib: add information metrics library Remy Horton
2016-11-18  8:00         ` [dpdk-dev] [PATCH v5 2/4] lib: add bitrate statistics library Remy Horton
2016-11-18  8:00         ` [dpdk-dev] [PATCH v5 3/4] app/test-pmd: add support for bitrate statistics Remy Horton
2016-11-18  8:00         ` [dpdk-dev] [PATCH v5 4/4] latencystats: added new library for latency stats Remy Horton
2017-01-11 16:03         ` [dpdk-dev] [PATCH v6 0/4] Expanded statistics reporting Remy Horton
2017-01-11 16:03           ` [dpdk-dev] [PATCH v6 1/4] lib: add information metrics library Remy Horton
2017-01-12 13:22             ` Thomas Monjalon
2017-01-12 15:30               ` Remy Horton
2017-01-12 19:05                 ` Thomas Monjalon
2017-01-16 10:27                   ` Remy Horton
2017-01-11 16:03           ` [dpdk-dev] [PATCH v6 2/4] lib: add bitrate statistics library Remy Horton
2017-01-11 16:15             ` Stephen Hemminger
2017-01-16 13:18               ` Remy Horton
2017-01-11 16:03           ` [dpdk-dev] [PATCH v6 3/4] app/test-pmd: add support for bitrate statistics Remy Horton
2017-01-12 13:32             ` Thomas Monjalon
2017-01-11 16:03           ` [dpdk-dev] [PATCH v6 4/4] latencystats: added new library for latency stats Remy Horton
2017-01-12 13:41             ` Thomas Monjalon
2017-01-12 14:44               ` Remy Horton
2017-01-13  9:45               ` Mcnamara, John
2017-01-13  9:53                 ` Thomas Monjalon
2017-01-16 16:18                   ` Mcnamara, John
2017-01-11 16:58           ` [dpdk-dev] [PATCH v6 0/4] Expanded statistics reporting Thomas Monjalon
2017-01-16 16:19           ` [dpdk-dev] [PATCH v7 0/6] " Remy Horton
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 1/6] lib: add information metrics library Remy Horton
2017-01-17 11:01               ` Van Haaren, Harry
2017-01-17 13:40                 ` Remy Horton
2017-01-17 14:23                   ` Van Haaren, Harry
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 2/6] app/proc_info: add metrics displaying Remy Horton
2017-01-17 11:08               ` Van Haaren, Harry
2017-01-17 14:27                 ` Remy Horton
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 3/6] lib: add bitrate statistics library Remy Horton
2017-01-17 11:16               ` Van Haaren, Harry
2017-01-17 15:37                 ` Remy Horton
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 4/6] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-01-17 11:19               ` Van Haaren, Harry
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 5/6] lib: added new library for latency stats Remy Horton
2017-01-17  4:29               ` Jerin Jacob
2017-01-17  6:48                 ` Remy Horton
2017-01-17  7:35                   ` Jerin Jacob
2017-01-17 11:19                 ` Mcnamara, John
2017-01-17 12:34                   ` Jerin Jacob
2017-01-17 14:53                     ` Mcnamara, John
2017-01-17 16:25                       ` Jerin Jacob
2017-01-18 20:11                         ` Olivier Matz
2017-01-24 15:24                           ` Olivier MATZ
2017-01-17 11:41               ` Van Haaren, Harry
2017-01-16 16:19             ` [dpdk-dev] [PATCH v7 6/6] app/test-pmd: add latency statistics calculation Remy Horton
2017-01-17 11:45               ` Van Haaren, Harry
2017-01-17 23:24             ` [dpdk-dev] [PATCH v8 0/7] Expanded statistics reporting Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 1/7] lib: add information metrics library Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 2/7] app/proc_info: add metrics displaying Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 3/7] lib: add bitrate statistics library Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 4/7] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 5/7] mbuf: add a timestamp to the mbuf for latencystats Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 6/7] lib: added new library for latency stats Remy Horton
2017-01-17 23:24               ` [dpdk-dev] [PATCH v8 7/7] app/test-pmd: add latency statistics calculation Remy Horton
2017-01-18 15:05               ` [dpdk-dev] [PATCH v9 0/7] Expanded statistics reporting Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 1/7] lib: add information metrics library Remy Horton
2017-01-30 15:50                   ` Thomas Monjalon [this message]
2017-01-30 21:44                     ` Remy Horton
2017-01-31 13:13                     ` Mcnamara, John
2017-01-31 13:28                       ` Bruce Richardson
2017-02-02 17:22                         ` Thomas Monjalon
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 2/7] app/proc_info: add metrics displaying Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 3/7] lib: add bitrate statistics library Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 4/7] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 5/7] mbuf: add a timestamp to the mbuf for latencystats Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 6/7] lib: added new library for latency stats Remy Horton
2017-01-18 15:05                 ` [dpdk-dev] [PATCH v9 7/7] app/test-pmd: add latency statistics calculation Remy Horton
2017-02-03 10:33                 ` [dpdk-dev] [PATCH v10 0/7] Expanded statistics reporting Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 1/7] lib: add information metrics library Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 2/7] app/proc_info: add metrics displaying Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 3/7] lib: add bitrate statistics library Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 4/7] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 5/7] mbuf: add a timestamp to the mbuf for latencystats Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 6/7] lib: added new library for latency stats Remy Horton
2017-02-03 10:33                   ` [dpdk-dev] [PATCH v10 7/7] app/test-pmd: add latency statistics calculation Remy Horton
2017-02-16 10:53                   ` [dpdk-dev] [PATCH v10 0/7] Expanded statistics reporting Thomas Monjalon
2017-02-23  7:09                     ` Remy Horton
2017-02-23  8:45                       ` Thomas Monjalon
2017-03-09 16:25                   ` [dpdk-dev] [PATCH v11 " Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 1/7] lib: add information metrics library Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 2/7] app/proc_info: add metrics displaying Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 3/7] lib: add bitrate statistics library Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 4/7] app/test-pmd: add bitrate statistics calculation Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 5/7] mbuf: add a timestamp to the mbuf for latencystats Remy Horton
2017-03-09 19:02                       ` Stephen Hemminger
2017-03-10  9:48                         ` Van Haaren, Harry
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 6/7] lib: added new library for latency stats Remy Horton
2017-03-09 16:25                     ` [dpdk-dev] [PATCH v11 7/7] app/test-pmd: add latency statistics calculation Remy Horton

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=1659974.13GHXkxjEr@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=remy.horton@intel.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).