| 1 |
.TH IP\-STATS 8 "16 Mar 2022" "iproute2" "Linux" |
| 2 |
.SH NAME |
| 3 |
ip-stats \- manage and show interface statistics |
| 4 |
.SH SYNOPSIS |
| 5 |
.sp |
| 6 |
.ad l |
| 7 |
.in +8 |
| 8 |
.ti -8 |
| 9 |
.B ip |
| 10 |
.B stats |
| 11 |
.RI " { " COMMAND " | " |
| 12 |
.BR help " }" |
| 13 |
.sp |
| 14 |
|
| 15 |
.ti -8 |
| 16 |
.BR "ip stats show" |
| 17 |
.RB "[ " dev |
| 18 |
.IR DEV " ] " |
| 19 |
.RB "[ " group |
| 20 |
.IR GROUP " [ " |
| 21 |
.BI subgroup " SUBGROUP" |
| 22 |
.RB " [ " suite |
| 23 |
.IR " SUITE" " ] ... ] ... ] ..." |
| 24 |
|
| 25 |
.ti -8 |
| 26 |
.BR "ip stats set" |
| 27 |
.BI dev " DEV" |
| 28 |
.BR l3_stats " { " |
| 29 |
.BR on " | " off " }" |
| 30 |
|
| 31 |
.SH DESCRIPTION |
| 32 |
|
| 33 |
.TP |
| 34 |
.B ip stats set |
| 35 |
is used for toggling whether a certain HW statistics suite is collected on |
| 36 |
a given netdevice. The following statistics suites are supported: |
| 37 |
|
| 38 |
.in 21 |
| 39 |
|
| 40 |
.ti 14 |
| 41 |
.B l3_stats |
| 42 |
L3 stats reflect traffic that takes place in a HW device on an object that |
| 43 |
corresponds to the given software netdevice. |
| 44 |
|
| 45 |
.TP |
| 46 |
.B ip stats show |
| 47 |
is used for showing stats on a given netdevice, or dumping statistics |
| 48 |
across all netdevices. By default, all stats are requested. It is possible |
| 49 |
to filter which stats are requested by using the |
| 50 |
.B group |
| 51 |
and |
| 52 |
.B subgroup |
| 53 |
keywords. |
| 54 |
|
| 55 |
It is possible to specify several groups, or several subgroups for one |
| 56 |
group. When no subgroups are given for a group, all the subgroups are |
| 57 |
requested. |
| 58 |
|
| 59 |
The following groups are recognized: |
| 60 |
.in 21 |
| 61 |
|
| 62 |
.ti 14 |
| 63 |
.B group link |
| 64 |
- Link statistics. The same suite that "ip -s link show" shows. |
| 65 |
|
| 66 |
.ti 14 |
| 67 |
.B group offload |
| 68 |
- A group that contains a number of HW-oriented statistics. See below for |
| 69 |
individual subgroups within this group. |
| 70 |
|
| 71 |
.ti 14 |
| 72 |
.B group xstats |
| 73 |
- Extended statistics. A subgroup identifies the type of netdevice to show the |
| 74 |
statistics for. |
| 75 |
|
| 76 |
.ti 14 |
| 77 |
.B group xstats_slave |
| 78 |
- Extended statistics for the slave of a netdevice of a given type. A subgroup |
| 79 |
identifies the type of master netdevice. |
| 80 |
|
| 81 |
.ti 14 |
| 82 |
.B group afstats |
| 83 |
- A group for address-family specific netdevice statistics. |
| 84 |
|
| 85 |
.TQ |
| 86 |
.BR "group offload " subgroups: |
| 87 |
.in 21 |
| 88 |
|
| 89 |
.ti 14 |
| 90 |
.B subgroup cpu_hit |
| 91 |
- The |
| 92 |
.B cpu_hit |
| 93 |
statistics suite is useful on hardware netdevices. The |
| 94 |
.B link |
| 95 |
statistics on these devices reflect both the hardware- and |
| 96 |
software-datapath traffic. The |
| 97 |
.B cpu_hit |
| 98 |
statistics then only reflect software-datapath traffic. |
| 99 |
|
| 100 |
.ti 14 |
| 101 |
.B subgroup hw_stats_info |
| 102 |
- This suite does not include traffic statistics, but rather communicates |
| 103 |
the state of other statistics. Through this subgroup, it is possible to |
| 104 |
discover whether a given statistic was enabled, and when it was, whether |
| 105 |
any device driver actually configured its device to collect these |
| 106 |
statistics. For example, |
| 107 |
.B l3_stats |
| 108 |
was enabled in the following case, but no driver has installed it: |
| 109 |
|
| 110 |
# ip stats show dev swp1 group offload subgroup hw_stats_info |
| 111 |
.br |
| 112 |
56: swp1: group offload subgroup hw_stats_info |
| 113 |
.br |
| 114 |
l3_stats on used off |
| 115 |
|
| 116 |
After an L3 address is added to the netdevice, the counter will be |
| 117 |
installed: |
| 118 |
|
| 119 |
# ip addr add dev swp1 192.0.2.1/28 |
| 120 |
.br |
| 121 |
# ip stats show dev swp1 group offload subgroup hw_stats_info |
| 122 |
.br |
| 123 |
56: swp1: group offload subgroup hw_stats_info |
| 124 |
.br |
| 125 |
l3_stats on used on |
| 126 |
|
| 127 |
.ti 14 |
| 128 |
.B subgroup l3_stats |
| 129 |
- These statistics reflect L3 traffic that takes place in HW on an object |
| 130 |
that corresponds to the netdevice. Note that this suite is disabled by |
| 131 |
default and needs to be first enabled through |
| 132 |
.B ip stats set\fR. |
| 133 |
|
| 134 |
For example: |
| 135 |
|
| 136 |
# ip stats show dev swp2.200 group offload subgroup l3_stats |
| 137 |
.br |
| 138 |
112: swp2.200: group offload subgroup l3_stats on used on |
| 139 |
.br |
| 140 |
RX: bytes packets errors dropped mcast |
| 141 |
.br |
| 142 |
8900 72 2 0 3 |
| 143 |
.br |
| 144 |
TX: bytes packets errors dropped |
| 145 |
.br |
| 146 |
7176 58 0 0 |
| 147 |
|
| 148 |
Note how the l3_stats_info for the selected group is also part of the dump. |
| 149 |
|
| 150 |
.TQ |
| 151 |
.BR "group xstats " and " group xstats_slave " subgroups: |
| 152 |
.in 21 |
| 153 |
|
| 154 |
.ti 14 |
| 155 |
.B subgroup bridge\fR - Various statistics on bridges and their slaves. |
| 156 |
|
| 157 |
.ti 21 |
| 158 |
.BR "suite stp " "- STP statistics" |
| 159 |
.br |
| 160 |
.BR "suite mcast " "- IGMP / MLD statistics" |
| 161 |
.br |
| 162 |
.BR "suite vlan " "- per-VLAN traffic statistics" |
| 163 |
.br |
| 164 |
|
| 165 |
.ti 14 |
| 166 |
.B subgroup bond \fR[\fB suite 802.3ad \fR] |
| 167 |
- Statistics for LACP traffic on bond devices and their slaves. |
| 168 |
|
| 169 |
.TQ |
| 170 |
.BR "group afstats " subgroups: |
| 171 |
.in 21 |
| 172 |
|
| 173 |
.ti 14 |
| 174 |
.B subgroup mpls |
| 175 |
- Statistics for MPLS traffic seen on the netdevice. For example: |
| 176 |
|
| 177 |
# ip stats show dev veth01 group afstats subgroup mpls |
| 178 |
.br |
| 179 |
3: veth01: group afstats subgroup mpls |
| 180 |
.br |
| 181 |
RX: bytes packets errors dropped noroute |
| 182 |
.br |
| 183 |
0 0 0 0 0 |
| 184 |
.br |
| 185 |
TX: bytes packets errors dropped |
| 186 |
.br |
| 187 |
216 2 0 0 |
| 188 |
|
| 189 |
.SH EXAMPLES |
| 190 |
.PP |
| 191 |
# ip stats set dev swp1 l3_stats on |
| 192 |
.RS |
| 193 |
Enables collection of L3 HW statistics on swp1. |
| 194 |
.RE |
| 195 |
|
| 196 |
.PP |
| 197 |
# ip stats show group offload |
| 198 |
.RS |
| 199 |
Shows all offload statistics on all netdevices. |
| 200 |
.RE |
| 201 |
|
| 202 |
.PP |
| 203 |
# ip stats show dev swp1 group link |
| 204 |
.RS |
| 205 |
Shows link statistics on the given netdevice. |
| 206 |
.RE |
| 207 |
|
| 208 |
.SH SEE ALSO |
| 209 |
.br |
| 210 |
.BR ip (8), |
| 211 |
.BR ip-link (8), |
| 212 |
|
| 213 |
.SH AUTHOR |
| 214 |
Manpage by Petr Machata. |