[dpdk-dev,v4,8/8] doc: update xstats documentation

Message ID 1465833121-26953-9-git-send-email-remy.horton@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Remy Horton June 13, 2016, 3:52 p.m. UTC
  Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 doc/guides/prog_guide/poll_mode_drv.rst | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
  

Comments

John McNamara June 14, 2016, 2:06 p.m. UTC | #1
> -----Original Message-----
> From: Horton, Remy
> Sent: Monday, June 13, 2016 4:52 PM
> To: dev@dpdk.org; Mcnamara, John <john.mcnamara@intel.com>; Thomas
> Monjalon <thomas.monjalon@6wind.com>
> Subject: [PATCH v4 8/8] doc: update xstats documentation
> 
> Signed-off-by: Remy Horton <remy.horton@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>
  

Patch

diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
index 7698692..802fb8f 100644
--- a/doc/guides/prog_guide/poll_mode_drv.rst
+++ b/doc/guides/prog_guide/poll_mode_drv.rst
@@ -299,10 +299,27 @@  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.
+of statistics. Accessing these from application programs is done via two
+functions:
+
+* ``rte_eth_xstats_get``: Fills in an array of ``struct rte_eth_xstat``
+  with extended statistics.
+* ``rte_eth_xstats_get_names``: Fills in an array of
+  ``struct rte_eth_xstat_name`` with extended statistic name lookup
+  information.
+
+Each ``struct rte_eth_xstat`` contains an identifier and value pair, and
+each ``struct rte_eth_xstat_name`` contains an identifier and string pair.
+Each identifier within ``struct rte_eth_xstat`` must have a corresponding
+entry in ``struct rte_eth_xstat_name`` with a matching identifier. These
+identifiers, as well as the number of extended statistic exposed, must
+remain constant during runtime.
+
+Note that extended statistic identifiers are driver-specific, and hence
+might not be the same for different ports. Although it is expected that
+drivers will make the identifiers used within ``struct rte_eth_xstat`` and
+``struct rte_eth_xstat_name`` entries match the entries' array index, this
+property should not be relied on by applications for lookups.
 
 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