1IP-STATS(8) Linux IP-STATS(8)
2
3
4
6 ip-stats - manage and show interface statistics
7
9 ip stats { COMMAND | help }
10
11
12 ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite
13 SUITE ] ... ] ... ] ...
14
15 ip stats set dev DEV l3_stats { on | off }
16
17
19 ip stats set
20 is used for toggling whether a certain HW statistics suite is
21 collected on a given netdevice. The following statistics suites
22 are supported:
23
24
25 l3_stats L3 stats reflect traffic that takes place in a HW de‐
26 vice on an object that corresponds to the given software
27 netdevice.
28
29
30 ip stats show
31 is used for showing stats on a given netdevice, or dumping sta‐
32 tistics across all netdevices. By default, all stats are re‐
33 quested. It is possible to filter which stats are requested by
34 using the group and subgroup keywords.
35
36 It is possible to specify several groups, or several subgroups
37 for one group. When no subgroups are given for a group, all the
38 subgroups are requested.
39
40 The following groups are recognized:
41
42 group link - Link statistics. The same suite that "ip -s link
43 show" shows.
44
45 group offload - A group that contains a number of HW-oriented
46 statistics. See below for individual subgroups within
47 this group.
48
49 group xstats - Extended statistics. A subgroup identifies the
50 type of netdevice to show the statistics for.
51
52 group xstats_slave - Extended statistics for the slave of a net‐
53 device of a given type. A subgroup identifies the type of
54 master netdevice.
55
56 group afstats - A group for address-family specific netdevice
57 statistics.
58
59 group offload subgroups:
60
61 subgroup cpu_hit - The cpu_hit statistics suite is useful on
62 hardware netdevices. The link statistics on these devices
63 reflect both the hardware- and software-datapath traffic.
64 The cpu_hit statistics then only reflect software-data‐
65 path traffic.
66
67 subgroup hw_stats_info - This suite does not include traffic
68 statistics, but rather communicates the state of other
69 statistics. Through this subgroup, it is possible to dis‐
70 cover whether a given statistic was enabled, and when it
71 was, whether any device driver actually configured its
72 device to collect these statistics. For example, l3_stats
73 was enabled in the following case, but no driver has in‐
74 stalled it:
75
76 # ip stats show dev swp1 group offload subgroup
77 hw_stats_info
78 56: swp1: group offload subgroup hw_stats_info
79 l3_stats on used off
80
81 After an L3 address is added to the netdevice, the
82 counter will be installed:
83
84 # ip addr add dev swp1 192.0.2.1/28
85 # ip stats show dev swp1 group offload subgroup
86 hw_stats_info
87 56: swp1: group offload subgroup hw_stats_info
88 l3_stats on used on
89
90 subgroup l3_stats - These statistics reflect L3 traffic that
91 takes place in HW on an object that corresponds to the
92 netdevice. Note that this suite is disabled by default
93 and needs to be first enabled through ip stats set.
94
95 For example:
96
97 # ip stats show dev swp2.200 group offload subgroup
98 l3_stats
99 112: swp2.200: group offload subgroup l3_stats on used on
100 RX: bytes packets errors dropped mcast
101 8900 72 2 0 3
102 TX: bytes packets errors dropped
103 7176 58 0 0
104
105 Note how the l3_stats_info for the selected group is also
106 part of the dump.
107
108 group xstats and group xstats_slave subgroups:
109
110 subgroup bridge [ suite stp ] [ suite mcast ] - Statistics for
111 STP and, respectively, IGMP / MLD (under the keyword
112 mcast) traffic on bridges and their slaves.
113
114 subgroup bond [ suite 802.3ad ] - Statistics for LACP traffic on
115 bond devices and their slaves.
116
117 group afstats subgroups:
118
119 subgroup mpls - Statistics for MPLS traffic seen on the netde‐
120 vice. For example:
121
122 # ip stats show dev veth01 group afstats subgroup mpls
123 3: veth01: group afstats subgroup mpls
124 RX: bytes packets errors dropped noroute
125 0 0 0 0 0
126 TX: bytes packets errors dropped
127 216 2 0 0
128
129
131 # ip stats set dev swp1 l3_stats on
132 Enables collection of L3 HW statistics on swp1.
133
134
135 # ip stats show group offload
136 Shows all offload statistics on all netdevices.
137
138
139 # ip stats show dev swp1 group link
140 Shows link statistics on the given netdevice.
141
142
144 ip(8), ip-link(8),
145
146
148 Manpage by Petr Machata.
149
150
151
152iproute2 16 Mar 2022 IP-STATS(8)