From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 3CF2095DC for ; Wed, 8 Jun 2016 11:37:49 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id v199so55010928wmv.0 for ; Wed, 08 Jun 2016 02:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=6jmcLKPR0anQLcRY8P3bDY5PECaWegTMQOeD0SawZIg=; b=nBfc6SGutKUDA3aML0uQElbi1OfQl2rCmHa/z2yb34Z0poioeDOTr6iZ7FlOvGtly1 gQ8JgASlZCNcqV/qkombBVGm2Sw5A+jwse0rmGwNuszEaFjg+Q0U5gMFaaDXdckEY3v4 +BJlm/uwybrAwxEZ01nGynVwa7x11lNDQvo3utQ0WISEUKB6lKz9VWBMaBRJ0lAMZnrC aw1G/hsO+fs9DbyM+26nsYiSj9W8WFAkTwgcxuICVgeYeD6NoNqrU/XxrB5zcqbnslXM N3iA5FI3/b9l3Ac7hot+3RW+EDHaUiOq4xEIiWfx8KuDoC6/s1CK2NywzspQpEHD9I9y 1A6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=6jmcLKPR0anQLcRY8P3bDY5PECaWegTMQOeD0SawZIg=; b=RQ9QSsA7TPBYCs+emK1582UXzkEDPXHybwiNHTKzFGE/mHrgP46wHu5E1nIDSoelhq TOiusFgVtV8im5VIuSA/TYKpLSMZ9LC7jzTwTDGjYscHpzN1SJJEvsaCqoQb7VC/71Pj m4qvAjv1wke/raZg7kcv1bsHcDvrjErxDq5eWBSc9GvWm8LGqIpkTfUEAFJGvuBJmSkW 7LscbxZUIhXNtHI1l2JgVvVhByJrAoDpbyoOvwTE5dYG8blIcp8FZfE4LrulQ7PibeRg EbryWs9KJzhbpoXxLVi06HXmMCOiVHUT0bMFWJGQa2iJ0Rcjn+ahMDBcuRJZUAmNj0qY Z7Sg== X-Gm-Message-State: ALyK8tKNYGan0jH2UCN9EpjhchDajBye29Ali/r5cqXn0HP2QAZPygG6gYrqZ6iHRGYHgwxq X-Received: by 10.28.15.197 with SMTP id 188mr7167010wmp.75.1465378668831; Wed, 08 Jun 2016 02:37:48 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id xw8sm450741wjb.30.2016.06.08.02.37.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 02:37:47 -0700 (PDT) From: Thomas Monjalon To: Remy Horton Cc: dev@dpdk.org Date: Wed, 08 Jun 2016 11:37:47 +0200 Message-ID: <2437213.nzTWdctYcm@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1464605292-4599-2-git-send-email-remy.horton@intel.com> References: <1464605292-4599-1-git-send-email-remy.horton@intel.com> <1464605292-4599-2-git-send-email-remy.horton@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 01/10] rte: change xstats to use integer ids X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 09:37:49 -0000 2016-05-30 11:48, Remy Horton: > struct rte_eth_xstats { > + /* FIXME: Remove name[] once remaining drivers converted */ > char name[RTE_ETH_XSTATS_NAME_SIZE]; What is the plan? This field must be deprecated with an attribute. We cannot have 2 different APIs depending of the driver. What are the remaining drivers to convert? > + uint64_t id; > uint64_t value; > }; > > +/** > + * A name-key lookup element for extended statistics. > + * > + * This structure is used to map between names and ID numbers > + * for extended ethernet statistics. > + */ > +struct rte_eth_xstats_name { > + char name[RTE_ETH_XSTATS_NAME_SIZE]; > + uint64_t id; > +}; This structure and the other one (rte_eth_xstats) are badly named. There is only one stat in each. So they should not have the plural form. rte_eth_xstat and rte_eth_xstat_name would be better. [...] > /** > + * Retrieve names of extended statistics of an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param ptr_names > + * Block of memory to insert names into. Must be at least limit in size. "xstat_names" would be a better name than "ptr_names". We don't use ptr in the variable names because it doesn't really convey a semantic information. > + * @param limit > + * Capacity of ptr_strings (number of names). We are more used to "size" than "limit". > + * @return > + * If successful, number of statistics; negative on error. > + */ > +int rte_eth_xstats_names(uint8_t port_id, struct rte_eth_xstats_name *ptr_names, Why not rte_eth_xstats_get_names? > + unsigned limit); A (double) indent tab is missing. > + > +/** > + * Retrieve number of extended statistics of an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @return > + * If successful, number of statistics; negative on error. > + */ > +int rte_eth_xstats_count(uint8_t port_id); This function is useless because we can have the count with rte_eth_xstats_get(p, NULL, 0) By the way it would be more consistent to have the same behaviour in rte_eth_xstats_names().