From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Van Haaren, Harry" Subject: Re: [PATCH v5 1/3] ethdev: new xstats API add retrieving by ID Date: Wed, 12 Apr 2017 08:56:00 +0000 Message-ID: References: <1491847180-24784-2-git-send-email-jacekx.piasecki@intel.com> <1491928644-10383-1-git-send-email-michalx.k.jastrzebski@intel.com> <1491928644-10383-2-git-send-email-michalx.k.jastrzebski@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Jain, Deepak K" , "Piasecki, JacekX" , "Kozak, KubaX" , "Kulasek, TomaszX" To: "Jastrzebski, MichalX K" , "dev@dpdk.org" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6D7402C6B for ; Wed, 12 Apr 2017 10:56:04 +0200 (CEST) In-Reply-To: <1491928644-10383-2-git-send-email-michalx.k.jastrzebski@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > From: Jastrzebski, MichalX K > Sent: Tuesday, April 11, 2017 5:37 PM > To: dev@dpdk.org > Cc: Jain, Deepak K ; Van Haaren, Harry ; > Piasecki, JacekX ; Kozak, KubaX ; Kulasek, > TomaszX > Subject: [PATCH v5 1/3] ethdev: new xstats API add retrieving by ID >=20 > From: Jacek Piasecki >=20 > Extended xstats API in ethdev library to allow grouping of stats > logically so they can be retrieved per logical grouping managed > by the application. > Changed existing functions rte_eth_xstats_get_names and > rte_eth_xstats_get to use a new list of arguments: array of ids > and array of values. ABI versioning mechanism was used to > support backward compatibility. > Introduced two new functions rte_eth_xstats_get_all and > rte_eth_xstats_get_names_all which keeps functionality of the > previous ones (respectively rte_eth_xstats_get and > rte_eth_xstats_get_names) but use new API inside. > Both functions marked as deprecated. > Introduced new function: rte_eth_xstats_get_id_by_name > to retrieve xstats ids by its names. >=20 > test-pmd: add support for new xstats API retrieving by id in > testpmd application: xstats_get() and > xstats_get_names() call with modified parameters. >=20 > proc_info: add support for new xstats API retrieving by id to > proc_info application. There is a new argument --xstats-ids > in proc_info command line to retrieve statistics given by ids. > E.g. --xstats-ids=3D"1,3,5,7,8" >=20 > doc: add description for modified xstats API > Documentation change for modified extended statistics API functions. > The old API only allows retrieval of *all* of the NIC statistics > at once. Given this requires a MMIO read PCI transaction per statistic > it is an inefficient way of retrieving just a few key statistics. > Often a monitoring agent only has an interest in a few key statistics, > and the old API forces wasting CPU time and PCIe bandwidth in retrieving > *all* statistics; even those that the application didn't explicitly > show an interest in. > The new, more flexible API allow retrieval of statistics per ID. > If a PMD wishes, it can be implemented to read just the required > NIC registers. As a result, the monitoring application no longer wastes > PCIe bandwidth and CPU time. >=20 > Signed-off-by: Jacek Piasecki > Signed-off-by: Kuba Kozak > Signed-off-by: Tomasz Kulasek As part of this patchset 3 functions were added to struct eth_dev_ops, to p= rovide more flexible xstats() APIs. This patchset uses symbol versioning to keep ABI stable. I have checked ABI= using ./devtools/validate-abi.sh script for both GCC 5.4.0 and Clang 3.8.0= . GCC indicates Compatible, while Clang says there is a single Medium issue= , which I believe to be a false positive (details below). The clang Medium issue is described as follows by the ABI report; - struct rte_eth_dev : Change: Size of field dev_ops has been changed from 624 bytes to 648 byte= s [HvH: due to adding 3 xstats function pointers to end of struct]=20 Effect: Previous accesses of applications and library functions to this f= ield and fields at higher positions of the structure definition may be brok= en.=20 The reason I believe this is a false positive is that the "dev_ops" field i= s defined in the rte_eth_dev struct as follows: const struct eth_dev_ops *dev_ops; Any accesses made to dev_ops will be by this pointer-dereference, so the *s= ize* of dev_ops *in* rte_eth_dev struct is still a pointer - it hasn't chan= ged. Hence "accesses to this field and fields at higher positions of the st= ructure" will not be changed - the pointer in the rte_eth_dev struct remain= s a pointer. Acked-by: Harry van Haaren