Skip to content

Commit 8c00bd9

Browse files
kuba-moodavem330
authored andcommitted
docs: net: include the new ethtool pause stats in the stats doc
Tell people that there now is an interface for querying pause frames. A little bit of restructuring is needed given this is a first source of such statistics. Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9a27a33 commit 8c00bd9

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

Documentation/networking/statistics.rst

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
Interface statistics
55
====================
66

7+
Overview
8+
========
9+
710
This document is a guide to Linux network interface statistics.
811

9-
There are two main sources of interface statistics in Linux:
12+
There are three main sources of interface statistics in Linux:
1013

1114
- standard interface statistics based on
12-
:c:type:`struct rtnl_link_stats64 <rtnl_link_stats64>`; and
15+
:c:type:`struct rtnl_link_stats64 <rtnl_link_stats64>`;
16+
- protocol-specific statistics; and
1317
- driver-defined statistics available via ethtool.
1418

15-
There are multiple interfaces to reach the former. Most commonly used
16-
is the `ip` command from `iproute2`::
19+
Standard interface statistics
20+
-----------------------------
21+
22+
There are multiple interfaces to reach the standard statistics.
23+
Most commonly used is the `ip` command from `iproute2`::
1724

1825
$ ip -s -s link show dev ens4u1u1
1926
6: ens4u1u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
@@ -34,7 +41,26 @@ If `-s` is specified once the detailed errors won't be shown.
3441

3542
`ip` supports JSON formatting via the `-j` option.
3643

37-
Ethtool statistics can be dumped using `ethtool -S $ifc`, e.g.::
44+
Protocol-specific statistics
45+
----------------------------
46+
47+
Some of the interfaces used for configuring devices are also able
48+
to report related statistics. For example ethtool interface used
49+
to configure pause frames can report corresponding hardware counters::
50+
51+
$ ethtool --include-statistics -a eth0
52+
Pause parameters for eth0:
53+
Autonegotiate: on
54+
RX: on
55+
TX: on
56+
Statistics:
57+
tx_pause_frames: 1
58+
rx_pause_frames: 1
59+
60+
Driver-defined statistics
61+
-------------------------
62+
63+
Driver-defined ethtool statistics can be dumped using `ethtool -S $ifc`, e.g.::
3864

3965
$ ethtool -S ens4u1u1
4066
NIC statistics:
@@ -94,6 +120,17 @@ Identifiers via `ETHTOOL_GSTRINGS` with `string_set` set to `ETH_SS_STATS`,
94120
and values via `ETHTOOL_GSTATS`. User space should use `ETHTOOL_GDRVINFO`
95121
to retrieve the number of statistics (`.n_stats`).
96122

123+
ethtool-netlink
124+
---------------
125+
126+
Ethtool netlink is a replacement for the older IOCTL interface.
127+
128+
Protocol-related statistics can be requested in get commands by setting
129+
the `ETHTOOL_FLAG_STATS` flag in `ETHTOOL_A_HEADER_FLAGS`. Currently
130+
statistics are supported in the following commands:
131+
132+
- `ETHTOOL_MSG_PAUSE_GET`
133+
97134
debugfs
98135
-------
99136

@@ -130,3 +167,13 @@ user space trying to read them.
130167

131168
Statistics must persist across routine operations like bringing the interface
132169
down and up.
170+
171+
Kernel-internal data structures
172+
-------------------------------
173+
174+
The following structures are internal to the kernel, their members are
175+
translated to netlink attributes when dumped. Drivers must not overwrite
176+
the statistics they don't report with 0.
177+
178+
.. kernel-doc:: include/linux/ethtool.h
179+
:identifiers: ethtool_pause_stats

0 commit comments

Comments
 (0)