From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BB3048D91 for ; Tue, 29 Sep 2015 16:33:19 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 29 Sep 2015 07:33:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,608,1437462000"; d="scan'208";a="570542919" Received: from sie-lab-212-222.ir.intel.com (HELO silpixa00366884.ir.intel.com) ([10.237.212.222]) by FMSMGA003.fm.intel.com with ESMTP; 29 Sep 2015 07:33:18 -0700 From: Harry van Haaren To: dev@dpdk.org Date: Tue, 29 Sep 2015 15:32:46 +0100 Message-Id: <1443537175-13809-3-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443537175-13809-1-git-send-email-harry.van.haaren@intel.com> References: <1443537175-13809-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH 02/11] doc: add extended statistics to prog_guide 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: Tue, 29 Sep 2015 14:33:20 -0000 Add extended statistic section to the programmers guide, poll mode driver section. This section describes how the strings stats are formatted, and how the client code can use this to gather information about the stat. Signed-off-by: Harry van Haaren --- doc/guides/prog_guide/poll_mode_drv.rst | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 8780ba3..436e42a 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -294,3 +294,45 @@ Ethernet Device API ~~~~~~~~~~~~~~~~~~~ The Ethernet device API exported by the Ethernet PMDs is described in the *DPDK API Reference*. + +Extended Statistics API +~~~~~~~~~~~~~~~~~~~~~~~ + +The extended statistics API allows each individual PMD to expose a unique set +of statistics. The client of the API provides an array of +``struct rte_eth_xstats`` type. Each ``struct rte_eth_xstats`` contains a +string and value pair. The amount of xstats exposed, and position of the +statistic in the array must remain constant during runtime. + +A naming scheme exists for the strings exposed to clients of the API. This is +to allow scraping of the API for statistics of interest. The naming scheme uses +strings split by a single underscore ``_``. The scheme is as follows: + +* direction +* detail 1 +* detail 2 +* detail n +* unit + +The scheme, although quite simple, allows flexibility in presenting and reading +information from the statistic strings. The following example illustrates the +naming scheme:``rx_packets``. In this example, the string is split into two +components. The first component ``rx`` indicates that the statistic is +associated with the receive side of the NIC. The second component ``packets`` +indicates that the unit of measure is packets. + +A more complicated example: ``tx_size_128_to_255_packets``. In this example, +``tx`` indicates transmission, ``size`` is the first detail, ``128`` etc are +more details, and ``packets`` indicates that this is a packet counter. + +Some additions in the metadata scheme are as follows: + +* If the first part does not match ``rx`` or ``tx``, the statistic does not + have an affinity with either recieve of transmit. + +* If the first letter of the second part is ``q`` and this ``q`` is followed + by a number, this statistic is part of a specific queue. + +An example where queue numbers are used is as follows: ``tx_q7_bytes`` which +indicates this statistic applies to queue number 7, and represents the number +of transmitted bytes on that queue. -- 1.9.1