From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 12 Jan 2017 07:30:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,219,1477983600"; d="scan'208";a="1093236216" Received: from rhorton-mobl.ger.corp.intel.com (HELO [10.252.14.42]) ([10.252.14.42]) by fmsmga001.fm.intel.com with ESMTP; 12 Jan 2017 07:30:07 -0800 To: Thomas Monjalon References: <1484150594-3758-1-git-send-email-remy.horton@intel.com> <1484150594-3758-2-git-send-email-remy.horton@intel.com> <1951093.Zqtj2Qm3TA@xps13> Cc: dev@dpdk.org From: Remy Horton Organization: Intel Shannon Limited Message-ID: Date: Thu, 12 Jan 2017 15:30:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1951093.Zqtj2Qm3TA@xps13> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib: add information metrics library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 15:30:09 -0000 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.