From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <harry.van.haaren@intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id 795D58D28
 for <dev@dpdk.org>; Tue,  9 Feb 2016 16:20:06 +0100 (CET)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga102.jf.intel.com with ESMTP; 09 Feb 2016 07:20:05 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,421,1449561600"; d="scan'208";a="899387660"
Received: from sie-lab-212-120.ir.intel.com (HELO
 silpixa00394367.ir.intel.com) ([10.237.212.120])
 by fmsmga001.fm.intel.com with ESMTP; 09 Feb 2016 07:20:04 -0800
From: Harry van Haaren <harry.van.haaren@intel.com>
To: jing.d.chen@intel.com
Date: Tue,  9 Feb 2016 15:19:54 +0000
Message-Id: <1455031194-27921-1-git-send-email-harry.van.haaren@intel.com>
X-Mailer: git-send-email 2.5.0
In-Reply-To: <1454946137-5505-1-git-send-email-harry.van.haaren@intel.com>
References: <1454946137-5505-1-git-send-email-harry.van.haaren@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2] docs: add statistics read frequency to fm10k
	guide
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Feb 2016 15:20:06 -0000

This patch documents that the statistics of fm10k based NICs must be
read regularly in order to avoid an undetected 32 bit integer-overflow.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---

v2:
-Moved notes to Known Issues section of Release Notes.

 doc/guides/nics/fm10k.rst            | 16 ++++++++++++++++
 doc/guides/rel_notes/release_2_3.rst |  4 ++++
 2 files changed, 20 insertions(+)

diff --git a/doc/guides/nics/fm10k.rst b/doc/guides/nics/fm10k.rst
index 4206b7f..4250c9e 100644
--- a/doc/guides/nics/fm10k.rst
+++ b/doc/guides/nics/fm10k.rst
@@ -65,3 +65,19 @@ The FM10000 family of NICS support a maximum of a 15K jumbo frame. The value
 is fixed and cannot be changed. So, even when the ``rxmode.max_rx_pkt_len``
 member of ``struct rte_eth_conf`` is set to a value lower than 15364, frames
 up to 15364 bytes can still reach the host interface.
+
+Statistic Polling Frequency
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The FM10000 NICs expose a set of statistics via the PCI BARs. These statistics
+are read from the hardware registers when ``rte_eth_stats_get()`` or
+``rte_eth_xstats_get()`` is called. The packet counting registers are 32 bits
+while the byte counting registers are 48 bits. As a result, the statistics must
+be polled regularly in order to ensure the consistency of the returned reads.
+
+Given the PCIe Gen3 x8, about 50Gbps of traffic can occur. With 64 byte packets
+this gives almost 100 million packets/second, causing 32 bit integer overflow
+after approx 40 seconds. To ensure these overflows are detected and accounted
+for in the statistics, it is necessary to read statistic regularly. It is
+suggested to read stats every 20 seconds, which will gaurantee the statistics
+are accurate.
diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst
index 99de186..6748b89 100644
--- a/doc/guides/rel_notes/release_2_3.rst
+++ b/doc/guides/rel_notes/release_2_3.rst
@@ -31,6 +31,10 @@ Other
 Known Issues
 ------------
 
+* **FM10K: Statistics Polling Frequency**
+
+  A section has been added to the NIC guide for fm10k about the maximum
+  time between reading statistics and 32 bit packet counter overflows.
 
 API Changes
 -----------
-- 
2.5.0