From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [PATCH v6 1/4] lib: add information metrics library Date: Thu, 12 Jan 2017 15:30:06 +0000 Message-ID: References: <1484150594-3758-1-git-send-email-remy.horton@intel.com> <1484150594-3758-2-git-send-email-remy.horton@intel.com> <1951093.Zqtj2Qm3TA@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id BC7CF5424 for ; Thu, 12 Jan 2017 16:30:08 +0100 (CET) In-Reply-To: <1951093.Zqtj2Qm3TA@xps13> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/01/2017 13:22, Thomas Monjalon wrote: > 2017-01-12 00:03, Remy Horton: [..] >> --- /dev/null >> +++ b/lib/librte_metrics/rte_metrics.h >> +/** Used to indicate port-independent information */ >> +#define RTE_METRICS_NONPORT -1 > > I do not understand this constant. > Why using the word "port" to name any device? > What means independent? The metric library hold two sets of values: Ones specific to ports, and ones that are global/aggregate. Agree "non port" is not the clearest choice of name.. >> +/** >> + * Metric name >> + */ >> +struct rte_metric_name { >> + /** String describing metric */ >> + char name[RTE_METRICS_MAX_NAME_LEN]; >> +}; > > Why a struct for a simple string? It is modelled after xstats, which does the same thing. In this case thinking was that using: rte_metrics_get_names(struct rte_metric_name *names, uint16_t capacity) would be tidier than (e.g.): rte_metrics_get_names(char *names[RTE_METRICS_MAX_NAME_LEN], uint16_t capacity) >> + */ >> +struct rte_metric_value { >> + /** Numeric identifier of metric */ >> + uint16_t key; > > How the key is bound to the name? Corresponds to array position in struct rte_metric_name. Will amend doxygen comments. > Remember how the xstats comments were improved: > http://dpdk.org/commit/6d52d1d Will take account for them. I wrote this code back in October, so it slipped my mind to apply the same comments to this module.