summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man8/ip-stats.8
blob: 26336454ebeb6db5131f7bf596ae331e028f9d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
.TH IP\-STATS 8 "16 Mar 2022" "iproute2" "Linux"
.SH NAME
ip-stats \- manage and show interface statistics
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B ip
.B stats
.RI  " { " COMMAND " | "
.BR help " }"
.sp

.ti -8
.BR "ip stats show"
.RB "[ " dev
.IR DEV " ] "
.RB "[ " group
.IR GROUP " [ "
.BI subgroup " SUBGROUP"
.RB " [ " suite
.IR " SUITE" " ] ... ] ... ] ..."

.ti -8
.BR "ip stats set"
.BI dev " DEV"
.BR l3_stats " { "
.BR on " | " off " }"

.SH DESCRIPTION

.TP
.B ip stats set
is used for toggling whether a certain HW statistics suite is collected on
a given netdevice. The following statistics suites are supported:

.in 21

.ti 14
.B l3_stats
L3 stats reflect traffic that takes place in a HW device on an object that
corresponds to the given software netdevice.

.TP
.B ip stats show
is used for showing stats on a given netdevice, or dumping statistics
across all netdevices. By default, all stats are requested. It is possible
to filter which stats are requested by using the
.B group
and
.B subgroup
keywords.

It is possible to specify several groups, or several subgroups for one
group. When no subgroups are given for a group, all the subgroups are
requested.

The following groups are recognized:
.in 21

.ti 14
.B group link
- Link statistics. The same suite that "ip -s link show" shows.

.ti 14
.B group offload
- A group that contains a number of HW-oriented statistics. See below for
individual subgroups within this group.

.ti 14
.B group xstats
- Extended statistics. A subgroup identifies the type of netdevice to show the
statistics for.

.ti 14
.B group xstats_slave
- Extended statistics for the slave of a netdevice of a given type. A subgroup
identifies the type of master netdevice.

.ti 14
.B group afstats
- A group for address-family specific netdevice statistics.

.TQ
.BR "group offload " subgroups:
.in 21

.ti 14
.B subgroup cpu_hit
- The
.B cpu_hit
statistics suite is useful on hardware netdevices. The
.B link
statistics on these devices reflect both the hardware- and
software-datapath traffic. The
.B cpu_hit
statistics then only reflect software-datapath traffic.

.ti 14
.B subgroup hw_stats_info
- This suite does not include traffic statistics, but rather communicates
the state of other statistics. Through this subgroup, it is possible to
discover whether a given statistic was enabled, and when it was, whether
any device driver actually configured its device to collect these
statistics. For example,
.B l3_stats
was enabled in the following case, but no driver has installed it:

# ip stats show dev swp1 group offload subgroup hw_stats_info
.br
56: swp1: group offload subgroup hw_stats_info
.br
    l3_stats on used off

After an L3 address is added to the netdevice, the counter will be
installed:

# ip addr add dev swp1 192.0.2.1/28
.br
# ip stats show dev swp1 group offload subgroup hw_stats_info
.br
56: swp1: group offload subgroup hw_stats_info
.br
    l3_stats on used on

.ti 14
.B subgroup l3_stats
- These statistics reflect L3 traffic that takes place in HW on an object
that corresponds to the netdevice. Note that this suite is disabled by
default and needs to be first enabled through
.B ip stats set\fR.

For example:

# ip stats show dev swp2.200 group offload subgroup l3_stats
.br
112: swp2.200: group offload subgroup l3_stats on used on
.br
    RX:  bytes packets errors dropped   mcast
.br
          8900      72      2       0       3
.br
    TX:  bytes packets errors dropped
.br
          7176      58      0       0

Note how the l3_stats_info for the selected group is also part of the dump.

.TQ
.BR "group xstats " and " group xstats_slave " subgroups:
.in 21

.ti 14
.B subgroup bridge \fR[\fB suite stp \fR] [\fB suite mcast \fR]
- Statistics for STP and, respectively, IGMP / MLD (under the keyword
\fBmcast\fR) traffic on bridges and their slaves.

.ti 14
.B subgroup bond \fR[\fB suite 802.3ad \fR]
- Statistics for LACP traffic on bond devices and their slaves.

.TQ
.BR "group afstats " subgroups:
.in 21

.ti 14
.B subgroup mpls
- Statistics for MPLS traffic seen on the netdevice. For example:

# ip stats show dev veth01 group afstats subgroup mpls
.br
3: veth01: group afstats subgroup mpls
.br
    RX: bytes packets errors dropped noroute
.br
            0       0      0       0       0
.br
    TX: bytes packets errors dropped
.br
          216       2      0       0

.SH EXAMPLES
.PP
# ip stats set dev swp1 l3_stats on
.RS
Enables collection of L3 HW statistics on swp1.
.RE

.PP
# ip stats show group offload
.RS
Shows all offload statistics on all netdevices.
.RE

.PP
# ip stats show dev swp1 group link
.RS
Shows link statistics on the given netdevice.
.RE

.SH SEE ALSO
.br
.BR ip (8),
.BR ip-link (8),

.SH AUTHOR
Manpage by Petr Machata.