From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2017 01:56:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,189,1488873600"; d="scan'208";a="87770531" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga005.fm.intel.com with ESMTP; 12 Apr 2017 01:56:02 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX151.ger.corp.intel.com (163.33.192.59) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Apr 2017 09:56:01 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.153]) by IRSMSX156.ger.corp.intel.com ([169.254.3.246]) with mapi id 14.03.0319.002; Wed, 12 Apr 2017 09:56:01 +0100 From: "Van Haaren, Harry" To: "Jastrzebski, MichalX K" , "dev@dpdk.org" CC: "Jain, Deepak K" , "Piasecki, JacekX" , "Kozak, KubaX" , "Kulasek, TomaszX" Thread-Topic: [PATCH v5 1/3] ethdev: new xstats API add retrieving by ID Thread-Index: AQHSsuJ8dJuWcClB5Eq/PQ+Rl0fW3KHBbGDA 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> In-Reply-To: <1491928644-10383-2-git-send-email-michalx.k.jastrzebski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWUyMDM3ZGItNjgyOC00MjkzLWE2YzAtMWVmMDY4MGY1MDRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtxZUxkb3Y5dk5NVTRHQ0diXC95U2hXcUpSVWRUc1lBVmFQR1BjZEozMjlRPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 1/3] ethdev: new xstats API add retrieving by ID 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: Wed, 12 Apr 2017 08:56:05 -0000 > 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