linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] docs: networking: clarify expectation of persistent stats
@ 2025-08-25 13:47 Naveen Mamindlapalli
  2025-08-27  0:44 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Naveen Mamindlapalli @ 2025-08-25 13:47 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, horms, corbet, andrew
  Cc: netdev, linux-doc, linux-kernel, Naveen Mamindlapalli

This update clarifies the requirement for preserving statistics across
interface up/down cycles, noting that some drivers may not support this
due to inherent limitations. It also outlines the potential effects on
monitoring and observability tools.

Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
---
 Documentation/networking/statistics.rst | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/networking/statistics.rst b/Documentation/networking/statistics.rst
index 518284e287b0..857b08d633f7 100644
--- a/Documentation/networking/statistics.rst
+++ b/Documentation/networking/statistics.rst
@@ -222,8 +222,18 @@ Retrieving ethtool statistics is a multi-syscall process, drivers are advised
 to keep the number of statistics constant to avoid race conditions with
 user space trying to read them.
 
-Statistics must persist across routine operations like bringing the interface
-down and up.
+Statistics are expected to persist across routine operations like bringing the
+interface down and up. This includes both standard interface statistics and
+driver-defined statistics reported via `ethtool -S`.
+
+However, this behavior is not always strictly followed, and some drivers do
+reset these counters to zero when the device is closed and reopened. This can
+lead to misinterpretation of network behavior by monitoring tools, such as
+SNMP, that expect monotonically increasing counters.
+
+Driver authors are expected to preserve statistics across interface down/up
+cycles to ensure consistent reporting and better integration with monitoring
+tools that consume these statistics.
 
 Kernel-internal data structures
 -------------------------------
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] docs: networking: clarify expectation of persistent stats
  2025-08-25 13:47 [PATCH net-next] docs: networking: clarify expectation of persistent stats Naveen Mamindlapalli
@ 2025-08-27  0:44 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2025-08-27  0:44 UTC (permalink / raw)
  To: Naveen Mamindlapalli
  Cc: davem, edumazet, pabeni, horms, corbet, andrew, netdev, linux-doc,
	linux-kernel

On Mon, 25 Aug 2025 19:17:55 +0530 Naveen Mamindlapalli wrote:
> -Statistics must persist across routine operations like bringing the interface
> -down and up.
> +Statistics are expected to persist across routine operations like bringing the

Please don't weaken the requirement. The requirements is what it is.

> +interface down and up. This includes both standard interface statistics and
> +driver-defined statistics reported via `ethtool -S`.

Rest of the paragraph looks good, but I think the preferred form of
quotations is double back ticks? Most of this doc doesn't comply but
let's stick to double when adding new stuff.

> +However, this behavior is not always strictly followed, and some drivers do
> +reset these counters to zero when the device is closed and reopened. This can
> +lead to misinterpretation of network behavior by monitoring tools, such as
> +SNMP, that expect monotonically increasing counters.
> +
> +Driver authors are expected to preserve statistics across interface down/up
> +cycles to ensure consistent reporting and better integration with monitoring
> +tools that consume these statistics.

This feels like too many words. How about:

Note that the following legacy drivers do not comply with this requirement
and cannot be fixed without breaking existing users:
 - driver1
 - driver2
 ...
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-27  0:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 13:47 [PATCH net-next] docs: networking: clarify expectation of persistent stats Naveen Mamindlapalli
2025-08-27  0:44 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).